reman3/Rayman_X/cpa/public/GMT/GmtProto.h

360 lines
18 KiB
C

/* (c) Ubi R&D 1996*/
/* See Alain Robin for any comment or question*/
#ifndef __GMTPROTO_H__
#define __GMTPROTO_H__
#ifdef __cplusplus
extern "C" {
#endif
/* For DLLs who are using this module : */
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
/****************************************************************************/
/* STRUCTURE */
/****************************************************************************/
typedef struct GMT_tdstCollideMaterial_
{
short wTypeOfZone; /* GMT_C_wZDM or GMT_C_wZDR or GMT_C_wZDE or GMT_C_ZDD*/
GMT_tdxMask xIdentifier;
} GMT_tdstCollideMaterial;
typedef struct GMT_tdstGameMaterial_
{
ACP_tdxHandleOfMaterial hVisualMaterial ;
DNM_tdxHandleToMecMatCharacteristics hMechanicsMaterial ;
SND_tdxHandleToSoundMaterial hSoundMaterial;
GMT_tdxHandleToCollideMaterial hCollideMaterial ;
/* fbolefeysot - 01/10/98*/
/* remove init values in GMT{*/
/* struct GMT_tdstGameMaterial_* p_stInitialValues; // To be filled with the loaded values*/
/*END fbolefeysot}*/
#ifdef SECTOR_IN_GMT
HIE_tdxHandleToSuperObject hSectorMaterial ;
#endif
} GMT_tdstGameMaterial ;
/****************************************************************************/
/* INVALID VALUES */
/****************************************************************************/
#define GMT_C_InvalidSoundMaterial ((SND_tdxHandleToSoundMaterial)(-1))
#define GMT_C_InvalidCollideMaterial ((GMT_tdxHandleToCollideMaterial)(-1))
#define GMT_C_ulInvalidHandle (GMT_tdxHandleToGameMaterial)(0xcdcdcdcd)
/****************************************************************************/
/* CONSTANTS */
/****************************************************************************/
#define GMT_C_wZDM (short)0
#define GMT_C_wZDR (short)1
#define GMT_C_wZDE (short)2
#define GMT_C_wZDD (short)3
/****************************************************************************/
/* INITIALISATION FUNCTION FOR GAME MATERIAL */
/****************************************************************************/
extern CPA_EXPORT void GMT_fn_vInitFor3DOS();
extern CPA_EXPORT void GMT_fn_vInitForA3D();
/****************************************************************************/
/* BASIC FUNCTIONS FOR GAME MATERIAL */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vInitGameMaterialErrorAndMemory
// Used to initialize the memory and error variables
----------------------------------------------------------------------------//
// Input :
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vInitGameMaterialErrorAndMemory(void);
/*----------------------------------------------------------------------------
// Description : GMT_fn_hCreateGameMaterial
// To create an empty game material handle
//----------------------------------------------------------------------------
// Input :
// Output : Handle to the created game material
----------------------------------------------------------------------------*/
extern CPA_EXPORT GMT_tdxHandleToGameMaterial GMT_fn_hCreateGameMaterial(void);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vDestroyGameMaterial
// Delete a created game material handle
//----------------------------------------------------------------------------
// Input : _hOld : game material handle to delete
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vDestroyGameMaterial(GMT_tdxHandleToGameMaterial _hOld);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyGameMaterial
// Used to copy an existing game material
//----------------------------------------------------------------------------
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vCopyGameMaterial(GMT_tdxHandleToGameMaterial _hDst, GMT_tdxHandleToGameMaterial _hSrc);
/*----------------------------------------------------------------------------
// Description : GMT_fn_b_ulIsValid
// Used to check the validity of a game material handle
//----------------------------------------------------------------------------
// Input : _hMaterial
// Output : TRUE -> valid FALSE -> not valid
----------------------------------------------------------------------------*/
extern CPA_EXPORT unsigned long GMT_fn_b_ulIsValid(GMT_tdxHandleToGameMaterial _hMaterial);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vInvalidate
// Used to invlidate a game material handle
//----------------------------------------------------------------------------
// Input : _hOld : pointer to the handle to invalidate
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vInvalidate(GMT_tdxHandleToGameMaterial* _p_hOld);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vReInitializeGameMaterial
// Restore loaded values
//----------------------------------------------------------------------------
// Input : _hGameMat : game material
// Output :
----------------------------------------------------------------------------*/
/*extern CPA_EXPORT void GMT_fn_vReInitializeGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat);*/
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetGameMaterialInitialValues
// put current values into initial values
//----------------------------------------------------------------------------
// Input : _hGameMat : game material
// Output :
----------------------------------------------------------------------------*/
/*extern CPA_EXPORT void GMT_fn_vSetGameMaterialInitialValues(GMT_tdxHandleToGameMaterial _hGameMat);*/
/****************************************************************************/
/* BASIC FUNCTIONS FOR COLLIDE MATERIAL */
/****************************************************************************/
/*----------------------------------------------------------------------------
// Description : GMT_fn_hCreateCollideMaterial
// To create an empty collide material handle
//----------------------------------------------------------------------------
// Input :
// Output : Handle to the created collide material
----------------------------------------------------------------------------*/
extern CPA_EXPORT GMT_tdxHandleToCollideMaterial GMT_fn_hCreateCollideMaterial(void);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vDestroyCollideMaterial
// Delete a created collide material handle
//----------------------------------------------------------------------------
// Input : _p_hOld : collide material handle to delete
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vDestroyCollideMaterial(GMT_tdxHandleToCollideMaterial* _p_hOld);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vCopyGameMaterial
// Used to copy an existing game material
//----------------------------------------------------------------------------
// Input : _hSrc : source game material
// Output : _hDst : copied game material
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vCopyCollideMaterial(GMT_tdxHandleToCollideMaterial _hDst, GMT_tdxHandleToCollideMaterial _hSrc);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetCollideMaterialType
// Set to 1 the corresponding bit of the identifier
//----------------------------------------------------------------------------
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vSetCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vResetCollideMaterialType
// Set to 0 the corresponding bit of the identifier
//----------------------------------------------------------------------------
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vResetCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_xTestCollideMaterialType
// Test the corresponding bit of the identifier
//----------------------------------------------------------------------------
// Input : _hCollideMat : Handle to the collide material
// _uwType : Number of the type (0 to 15)
// Output : TRUE if the bit is set to 1 FALSE else
----------------------------------------------------------------------------*/
extern CPA_EXPORT ACP_tdxBool GMT_fn_xTestCollideMaterialTypeOfIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetCollideIdentifierTypeOfGameMaterial
// Set the collide type for the identifier to 1
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _uwType : Type to set into the identifier (0 to 15)
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vSetCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vResetCollideIdentifierTypeOfGameMaterial
// Set the collide type for the identifier to 0
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _uwType : Type to reset into the identifier (0 to 15)
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vResetCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_xTestCollideIdentifierTypeOfGameMaterial
// Test the collide type for the identifier
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _uwType : Type to test into the identifier (0 to 15)
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT ACP_tdxBool GMT_fn_xTestCollideIdentifierTypeOfGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
unsigned short _uwType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_xMultipleTestCollideIdentifier
// Test the collide type for the identifier (test several bits in one operation)
------------------------------------------------------------------------------
// Input : _hCollideMat : Handle to the collide material
// _xType : Mask containing the bits to test
// Output : TRUE if all the bits set in _xType are present into the collide material
// identifier, FALSE else
----------------------------------------------------------------------------*/
extern CPA_EXPORT ACP_tdxBool GMT_fn_xMultipleTestCollideIdentifier(GMT_tdxHandleToCollideMaterial _hCollideMat,
GMT_tdxMask _xType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_xMultipleTestCollideIdentifierFromGameMaterial
// Test the collide type for the identifier (test several bits in one operation)
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the collide material
// _xType : Mask containing the bits to test
// Output : TRUE if all the bits set in _xType are present into the collide material
// identifier, FALSE else
----------------------------------------------------------------------------*/
extern CPA_EXPORT ACP_tdxBool GMT_fn_xMultipleTestCollideIdentifierFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
GMT_tdxMask _xType);
/*----------------------------------------------------------------------------
// Description : GMT_fn_xCombineMask
// Combine 2 GMT_tdxMask and return the result
------------------------------------------------------------------------------
// Input : _xMaskA, _xMaskB : The 2 masks to combine
// Output : the combinaison
----------------------------------------------------------------------------*/
extern CPA_EXPORT GMT_tdxMask GMT_fn_xCombineMask(GMT_tdxMask _xMaskA,GMT_tdxMask _xMaskB);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetEntireMask
// Set all the bits of a mask to 1
----------------------------------------------------------------------------//
// Input : _p_xMask : Pointer to the mask
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vSetEntireMask(GMT_tdxMask* _p_xMask);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vResetEntireMask
// Set all the bits of a mask to 0
----------------------------------------------------------------------------//
// Input : _p_xMask : Pointer to the mask
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vResetEntireMask(GMT_tdxMask* _p_xMask);
/*
* Returns the name linked to _xMask
*/
#if !defined(U64)
char * GMT_fn_p_szZdmMaskToName(GMT_tdxMask _xMask);
#endif /* U64 */
/*----------------------------------------------------------------------------
// Description : GMT_fn_ulGetStructureSize
//----------------------------------------------------------------------------
// Input :
// Output : the size
----------------------------------------------------------------------------*/
unsigned long GMT_fn_ulGetStructureSize();
/*----------------------------------------------------------------------------
// Description : GMT_fn_xGetOneTextureFromGameMaterial
// Get one of the texture composing the animated texture
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// _llNumberOfAnimatedTexture : Number of the texture into the texture list
// Output : The handle to the texture
----------------------------------------------------------------------------*/
extern CPA_EXPORT ACP_tdxHandleOfTexture GMT_fn_xGetOneTextureFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat,
long _llNumberOfAnimatedTexture);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vUnLockTextureFromGameMaterial
// Unlock the animated texture (locked with GMT_fn_xGetOneTextureFromGameMaterialAndLockIt)
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vUnLockTextureFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat);
/*----------------------------------------------------------------------------
// Description : GMT_fn_lGetCurrentFrameOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT long GMT_fn_lGetCurrentFrameOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat);
/*----------------------------------------------------------------------------
// Description : GMT_fn_vSetCurrentFrameOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT void GMT_fn_vSetCurrentFrameOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat, long _lTextureNumber);
/*----------------------------------------------------------------------------
// Description : GMT_fn_lGetNumberOfAnimatedTexturesFromGameMaterial
------------------------------------------------------------------------------
// Input : _hGameMat : Handle to the game material
// Output :
----------------------------------------------------------------------------*/
extern CPA_EXPORT long GMT_fn_lGetNumberOfAnimatedTexturesFromGameMaterial(GMT_tdxHandleToGameMaterial _hGameMat);
#ifdef __cplusplus
}/* extern "C" */
#endif
#endif /* __GMTPROTO_H__*/