 
/****************************************************************
*                                                               *
*    RastMmg.h                                                  *
*                                                               *
*  Functions to have a dump of the memory used type by type     *
*                                                               *
*  Author : Alexis Vaisse                                       *
*                                                               *
****************************************************************/
 
 
#ifndef __RASTMMG_H__
#define __RASTMMG_H__
 
#ifdef __cplusplus
    extern "C" {
#endif
 
 
#define  MMG_C_lTypeScript         1
    #define  MMG_C_lSubTypeScript      0
 
#define  MMG_C_lTypeMiniStructure  2
    #define  MMG_C_lSubType3dData      0
    #define  MMG_C_lSubTypeStdGame     1
    #define  MMG_C_lSubTypeDynamics    2
    #define  MMG_C_lSubTypeBrain       3
    #define  MMG_C_lSubTypeCineInfo    4
    #define  MMG_C_lSubTypeCollSet     5
    #define  MMG_C_lSubTypeMSWay       6
    #define  MMG_C_lSubTypeLight       7
    #define  MMG_C_lSubTypeSectInfo    8
    #define  MMG_C_lSubTypeMicro       9
    #define  MMG_C_lSubTypePrtSrc     10
    #define  MMG_C_lSubTypeMSSound    11
    #define  MMG_C_lSubTypeAnimEffect 12
    #define  MMG_C_lSubTypeMagnet     13
 
#define  MMG_C_lTypeFamily         3
    #define  MMG_C_lSubTypeFamily					0
    #define  MMG_C_lSubTypeState					1
    #define  MMG_C_lSubTypeAnimation				2
    #define  MMG_C_lSubTypeTransition				3
    #define  MMG_C_lSubTypeProhibit					4
    #define  MMG_C_lSubTypeTBLList					5
    #define  MMG_C_lSubTypeTBLElement				6
	#define  MMG_C_lSubTypeTBLEvent					7
	#define  MMG_C_lSubTypeZdxListElement			8
	#define  MMG_C_lSubTypeZdxIndexListElement		9
	#define  MMG_C_lSubTypeGeometricZdxListElement 10
	#define  MMG_C_lSubTypeZoneSetListElement	   11
	#define  MMG_C_lSubTypeCsaListElement		   12
	#define  MMG_C_lSubTypeZoneSetEncapsulation	   13
 
#define  MMG_C_lTypeAI             4
    #define  MMG_C_lSubTypeMind                0
    #define  MMG_C_lSubTypeMacro               1
    #define  MMG_C_lSubTypeNodeMacro           2
    #define  MMG_C_lSubTypeComport             3
    #define  MMG_C_lSubTypeRule                4
    #define  MMG_C_lSubTypeNodeInterpret       5
    #define  MMG_C_lSubTypeActionTableEntry    6
    #define  MMG_C_lSubTypeActionTable         7
    #define  MMG_C_lSubTypeModel               8
    #define  MMG_C_lSubTypeScriptAI            9
    #define  MMG_C_lSubTypeIntelligence       10
    #define  MMG_C_lSubTypeDsgVarInfo         11
    #define  MMG_C_lSubTypeDsgVar             12
    #define  MMG_C_lSubTypeDsgMemBuffer       13
    #define  MMG_C_lSubTypeDsgMem             14
    #define  MMG_C_lSubTypeNodeString         15
    #define  MMG_C_lSubTypeNodeVector         16
    #define  MMG_C_lSubTypeListOfArc          17
    #define  MMG_C_lSubTypeArc                18
    #define  MMG_C_lSubTypeNameOfGraph        19
    #define  MMG_C_lSubTypeNameOfGraphSection 20
    #define  MMG_C_lSubTypeGraph              21
    #define  MMG_C_lSubTypeGraphNode          22
    #define  MMG_C_lSubTypeAIDEBUG            23
 
#define MMG_C_lTypePosition     5
    #define  MMG_C_lSubTypePosition             0
 
#define MMG_C_lTypeSuperObject  6
    #define  MMG_C_lSubTypeSuperObject          0
    #define  MMG_C_lSubTypeSuperObjectTable     1
 
#define MMG_C_lTypeSector       7
    #define  MMG_C_lSubTypeSector               0
    #define  MMG_C_lSubTypeGraphicElement       1
    #define  MMG_C_lSubTypeCollisionElement     2
    #define  MMG_C_lSubTypeCharacterElement     3
    #define  MMG_C_lSubTypeActiveElement        4
    #define  MMG_C_lSubTypeSoundElement         5
    #define  MMG_C_lSubTypeDNMLightElement      6
    #define  MMG_C_lSubTypeStaticLightElement   7
    #define  MMG_C_lSubTypeSoundEvent           8
 
#define MMG_C_lTypeGeometricObject  8
    #define  MMG_C_lSubTypePointsNormals         0
    #define  MMG_C_lSubTypeIndexUsedByElement    1
    #define  MMG_C_lSubTypeMainObject            2
    #define  MMG_C_lSubTypeListOfElementType     3
    #define  MMG_C_lSubTypeListOfElement         4
    #define  MMG_C_lSubTypeListOfPoint           5
    #define  MMG_C_lSubTypeListOfEdge            6
    #define  MMG_C_lSubTypeListOfEdgeMaterial    7
    #define  MMG_C_lSubTypePointsMaterial        8
    #define  MMG_C_lSubTypeParallelBox           9
    #define  MMG_C_lSubTypeRotativeSprite       10
    #define  MMG_C_lSubTypeBoundingSphere       11
    #define  MMG_C_lSubTypeElementSprite        12
    #define  MMG_C_lSubTypeElementIT            13
    #define  MMG_C_lSubTypeElementFaceMap       14
    #define  MMG_C_lSubTypeElementTMeshes       15
    #define  MMG_C_lSubTypeElementPoint         16
    #define  MMG_C_lSubTypeElementLine          17
    #define  MMG_C_lSubTypeElementSphere        18
    #define  MMG_C_lSubTypeElementAlignedBox    19
    #define  MMG_C_lSubTypeElementCone          20
 
#define  MMG_C_lTypeSAI             9
    #define  MMG_C_lSubTypeSAI                   0
 
#define  MMG_C_lTypeIPT			10
	#define  MMG_C_lSubTypeIPT	                 0
 
#define  MMG_C_lTypeFile            11
    #define  MMG_C_lSubTypeBmpFile               0
    #define  MMG_C_lSubTypeConcatFile            1
    #define  MMG_C_lSubTypeGfFile                2
    #define  MMG_C_lSubTypeTgaFile               3
    #define  MMG_C_lSubTypeMiscellaneousFile     4
 
#define  MMG_C_lTypeGMT			12
	#define  MMG_C_lSubTypeCollideMaterial		0
	#define  MMG_C_lSubTypeFor3DOS				1
	#define  MMG_C_lSubTypeForA3D				2
	#define  MMG_C_lSubTypeMain					3
 
#define  MMG_C_lTypeMOR			13
	#define  MMG_C_lSubTypeElement				0
	#define  MMG_C_lSubTypePO					1
 
#define  MMG_C_lTypeISI			14
	#define  MMG_C_lSubTypeLOD					0
	#define  MMG_C_lSubTypeArray				1
	#define  MMG_C_lSubTypeStruct				2
	#define  MMG_C_lSubTypeBlendRLI				3
 
#define  MMG_C_lTypeInterpol    15
    #define  MMG_C_lSubTypeA3dGENERAL           0
    #define  MMG_C_lSubTypeVectors              1
    #define  MMG_C_lSubTypeQuaternions          2
    #define  MMG_C_lSubTypeHierarchies          3
    #define  MMG_C_lSubTypeNTTO                 4
    #define  MMG_C_lSubTypeOnlyFrames           5
    #define  MMG_C_lSubTypeChannels             6
    #define  MMG_C_lSubTypeFrames               7
    #define  MMG_C_lSubTypeFramesKF             8
    #define  MMG_C_lSubTypeKeyFrames            9
    #define  MMG_C_lSubTypeEvents              10
    #define  MMG_C_lSubTypeMorphData           11
    #define  MMG_C_lSubTypeSpeedCuttedAnim     12
    #define  MMG_C_lSubTypeSpeedMatrix         13
 
#define  MMG_C_lTypeVignette    16
    #define  MMG_C_lSubTypeVignette             0
 
#define  MMG_C_lTypeGAM         17
    #define  MMG_C_lSubTypePlayer               0
    #define  MMG_C_lSubTypeCSO                  1
    #define  MMG_C_lSubTypeLipSynchro           2
    #define  MMG_C_lSubTypeSnapShot             3
    #define  MMG_C_lSubTypeBinAnim              4
    #define  MMG_C_lSubTypeListOfMaps           5
    #define  MMG_C_lSubTypeMorphChannelList     6
    #define  MMG_C_lSubTypeMorphList            7
    #define  MMG_C_lSubTypeAlwaysActiveChar     8
    #define  MMG_C_lSubTypeFont                 9
    #define  MMG_C_lSubTypeMainChar            10
    #define  MMG_C_lSubTypeEngineObject        11
    #define  MMG_C_lSubTypeAlwaysGenerator     12
    #define  MMG_C_lSubTypeAlwaysModel         13
    #define  MMG_C_lSubTypeObjectTypeElement   14
    #define  MMG_C_lSubTypeViewPortArray       15
 
#define  MMG_C_lTypeGLI         18
    #define  MMG_C_lSubTypeTexture              0
    #define  MMG_C_lSubTypeGlobal               1
    #define  MMG_C_lSubTypeZBufferForLight      2
    #define  MMG_C_lSubTypeGliLight             3
    #define  MMG_C_lSubTypePolice               4
    #define  MMG_C_lSubTypeZList                5
    #define  MMG_C_lSubTypeCamera               6
    #define  MMG_C_lSubTypeMaterial             7
    #define  MMG_C_lSubTypeAnimatedTexture      8
    #define  MMG_C_lSubTypeMipMapping           9
    #define  MMG_C_lSubTypeVisualSet           10
    #define  MMG_C_lSubTypeRLI                 11
 
#define  MMG_C_lTypeOctree      19
    #define  MMG_C_lSubTypeElementBaseTable     0
    #define  MMG_C_lSubTypeFaceIndex            1
    #define  MMG_C_lSubTypeTaggedPointTable     2
    #define  MMG_C_lSubTypeTaggedFaceTable      3
    #define  MMG_C_lSubTypeOctreeNode           4
    #define  MMG_C_lSubTypeFaceIndexList        5
    #define  MMG_C_lSubTypeOctreeStructure      6
 
#define  MMG_C_lTypePO          20
    #define  MMG_C_lSubTypePOStructure          0
 
#define  MMG_C_lTypePCS         21
    #define  MMG_C_lSubTypePCSStructure         0
 
#define  MMG_C_lTypeIPO         22
    #define  MMG_C_lSubTypeIPOStructure         0
 
#define  MMG_C_lTypeMEC         23
    #define  MMG_C_lSubTypeMecMatCharacteristic 0
    #define  MMG_C_lSubTypeMecCameraCard        1
    #define  MMG_C_lSubTypeMecBaseCard          2
 
#define  MMG_C_lTypeRND         24
    #define  MMG_C_lSubTypeRND                  0
 
 
#if (defined(USE_PROFILER) && !defined(U64))
 
    void MMG_fn_vInitMemoryRasterDeclaration(void);                                     /* Called once when the first memory block is allocated*/
    void MMG_fn_vDesinitMemoryRasterDeclaration (void);                                 /* Called once at the end of the program*/

    void MMG_fn_vInitMemoryRaster           (long _lNumberOfType);                      /* Must be called once at the beginning of the game*/
    void MMG_fn_vInitTypeForMemoryRaster    (long _lType , char * _szTypeName , long _lNumberOfSubType);
    void MMG_fn_vInitSubTypeForMemoryRaster (long _lType , long _lSubType , char * _szSubTypeName , long _lNumberOfObject);
 
    void MMG_fn_vAddMemoryInfo   (long _lType , long _lSubType , void * _p_vObject);    /* Must be called before making a memory allocation*/
    void MMG_fn_vBeginMemoryInfo (long _lType , long _lSubType , void * _p_vObject);    /* Must be called before making several memory allocations. Then one must call the MMG_fn_vEndMemoryInfo function*/
    void MMG_fn_vEndMemoryInfo   ();                                                    /* Must be called after calling the MMG_fn_vBeginMemoryInfo and making memory allocations*/
 
    void MMG_fn_vRegisterMemoryAllocation (long _lChannelNumber , long _lRequestedSize);/* This function is called only by the fn_p_vGenAlloc function*/
    void MMG_fn_vRegisterMemoryFree       (long _lChannelNumber , void * _p_vBlock);    /* This function is called only by the fn_p_vGenFree  function*/
 
    void MMG_fn_vDumpMemory               ();                                           /* Save all memory informations into a dump file*/
 
    void MMG_fn_vClearMemoryRaster        ();
 
#else
 
    #define MMG_fn_vInitMemoryRasterDeclaration()
    #define MMG_fn_vDesinitMemoryRasterDeclaration()

    #define MMG_fn_vInitMemoryRaster(a)
    #define MMG_fn_vInitTypeForMemoryRaster(a,b,c)
    #define MMG_fn_vInitSubTypeForMemoryRaster(a,b,c,d)
 
    #define MMG_fn_vAddMemoryInfo(a,b,c)
    #define MMG_fn_vBeginMemoryInfo(a,b,c)
    #define MMG_fn_vEndMemoryInfo()
    #define MMG_fn_vRegisterMemoryAllocation(a,b)
 
    #define MMG_fn_vDumpMemory()
 
    #define MMG_fn_vClearMemoryRaster()
 
#endif
 
#ifdef __cplusplus
    };
#endif
 
#endif
