/* ////////////////////////////////////////////////////////////////////// AI Debug trace file ////////////////////////////////////////////////////////////////////// File Name : AID_Trac.h Date : September 29, 1997 Author : David Reizer ////////////////////////////////////////////////////////////////////// Purpose : This file defines structures and prototypes for AI engine debug trace ////////////////////////////////////////////////////////////////////// */ #if !defined(__AID_TRACE_TYPES__) #define __AID_TRACE_TYPES__ #if !defined(ONLY_TYPES) #define AID_TRACE_UNDEF #define ONLY_TYPES #endif /* !ONLY_TYPES */ #if defined(AID_TRACE_UNDEF) #undef ONLY_TYPES #undef AID_TRACE_UNDEF #endif /* AID_TRACE_UNDEF */ #if defined(ACTIVE_AIDEBUG) #include "AI\AIBASE\GSParam.h" /* Different types of SectionEntry */ typedef enum AIDebug_tdeSectionType_ { AIDebug_E_SecTyp_EngineLoop, AIDebug_E_SecTyp_ReflexOrAI, AIDebug_E_SecTyp_CurrentComport, AIDebug_E_SecTyp_Field, AIDebug_E_SecTyp_Constant, AIDebug_E_SecTyp_DsgVarId, AIDebug_E_SecTyp_DsgVar, AIDebug_E_SecTyp_Button, AIDebug_E_SecTyp_EnvRef, AIDebug_E_SecTyp_SectorRef, AIDebug_E_SecTyp_SurfaceRef, AIDebug_E_SecTyp_PersoRef, AIDebug_E_SecTyp_ActionRef, AIDebug_E_SecTyp_Real, AIDebug_E_SecTyp_Vector, AIDebug_E_SecTyp_ConstantVector, AIDebug_E_SecTyp_WayPoint, AIDebug_E_SecTyp_Module, AIDebug_E_SecTyp_Mask, AIDebug_E_SecTyp_String, AIDebug_E_SecTyp_LipsSynchroRef, AIDebug_E_SecTyp_SoundEventRef, AIDebug_E_SecTyp_FamilyRef, AIDebug_E_SecTyp_BeginMacro, AIDebug_E_SecTyp_EndMacro, AIDebug_E_SecTyp_Comport, AIDebug_E_SecTyp_KeyWord, AIDebug_E_SecTyp_Condition, AIDebug_E_SecTyp_Function, AIDebug_E_SecTyp_Operator, AIDebug_E_SecTyp_Procedure, AIDebug_E_SecTyp_MetaAction, AIDebug_E_SecTyp_MacroRef, AIDebug_E_SecTyp_BeginMetaAction, AIDebug_E_SecTyp_TextRef, AIDebug_E_SecTyp_FontRef, AIDebug_E_SecTyp_ParticleGenerator, AIDebug_E_SecTyp_ObjectTableRef, AIDebug_E_SecTyp_GameMaterialRef, AIDebug_E_SecTyp_NbOfSectionType } AIDebug_tdeSectionType; /* * A Section Entry contains : * a Type of Section * a GetSetParam field (value and type of the data) * an optional Id * the depth in the Ai tree * the optionnal adress of the corresponding node */ typedef struct AIDebug_tdstSectionEntry_ { AIDebug_tdeSectionType m_eSectionType; tdstGetSetParam m_stGetSetParam; tdstNodeInterpret *m_p_stNode; } AIDebug_tdstSectionEntry; /* * A trace contains : * an array of SectionEntry * a pointer to the position to insert a new SectionEntry * a flag indicating if whole the array is used * the number of EngineLoop * the first EngineLoop recorded in the buffer * a flag to enable/desable the trace for a perso * an index for the exploitation of the trace */ typedef struct AIDebug_tdstTrace_ { struct AIDebug_tdstSectionEntry_ *m_d_stBuffer ; unsigned short m_uwSizeOfBuffer; unsigned short m_uwCurrentIndex; unsigned short m_b_uwBufferIsFull; /* unsigned short m_uwCurrentEngineLoop;*/ /* unsigned short m_uwFirstEngineLoop;*/ unsigned short m_b_uwIsEnable; unsigned short m_uwExplIndex; } AIDebug_tdstTrace; #endif /*ACTIVE_AIDEBUG*/ #endif /* !__AID_TRACE_TYPES__ */ #if !defined(ONLY_TYPES) #if !defined(__AID_TRACE_VARS__) #define __AID_TRACE_VARS__ #undef AID_TRACE_EXTERN #undef extern #if !defined(AID_TRACE_GLOBALS) #define AID_TRACE_EXTERN extern #else #define AID_TRACE_EXTERN #endif /* AID_TRACE_GLOBALS */ #if defined(ACTIVE_AIDEBUG) #define AIDebug_C_uwInvalidPosition ((unsigned short)-1) #define AIDebug_C_uwDefaultSizeOfBuffer ((unsigned short)10000) #define AIDebug_C_ucMaxSectionNameLength ((unsigned char)250) /* * MACRO Declarations */ /* check a Section Type */ #define AIDebug_M_bIsValidSectionType(_eType)\ (\ ((_eType)>=AIDebug_E_SecTyp_EngineLoop)\ &&((_eType)m_d_stBuffer) #define AIDebug_M_uwGetSizeOfBuffer(_pstTrace) ((_pstTrace)->m_uwSizeOfBuffer) #define AIDebug_M_uwGetCurrentIndex(_pstTrace) ((_pstTrace)->m_uwCurrentIndex) #define AIDebug_M_bBufferIsFull(_pstTrace) ((_pstTrace)->m_b_uwBufferIsFull) /*#define AIDebug_M_uwGetCurrentEngineLoop(_pstTrace) ((_pstTrace)->m_uwCurrentEngineLoop)*/ /*#define AIDebug_M_uwGetFirstEngineLoop(_pstTrace) ((_pstTrace)->m_uwFirstEngineLoop)*/ #define AIDebug_M_bIsEnable(_pstTrace) ((_pstTrace)->m_b_uwIsEnable) #define AIDebug_M_uwGetExplIndex(_pstTrace) ((_pstTrace)->m_uwExplIndex) #define AIDebug_M_bBufferIsEmpty(_p_stTrace)\ ((!AIDebug_M_bBufferIsFull(_p_stTrace))&&(AIDebug_M_uwGetCurrentIndex(_p_stTrace)==0)) #define AIDebug_M_bIsValidIndex(_p_stTrace,_uwIndex)\ ( (_uwIndex=AIDebug_M_uwGetCurrentIndex(_p_stTrace))\ &&(AIDebug_M_bBufferIsFull(_p_stTrace))\ &&(_uwIndex