487 lines
19 KiB
C
487 lines
19 KiB
C
/*---------------------------------------------------------------------------*/
|
|
/* DsgMemC.cpp : Definition of variables (Translation of AI in code C)*/
|
|
/* auteur : Yann Le GUYADER*/
|
|
/*---------------------------------------------------------------------------*/
|
|
#include "AIUseCPA.h"
|
|
|
|
#include "specif/AIOption.h"
|
|
#include "AIMacros.h"
|
|
#include "AI_Erm.h"
|
|
|
|
#include "AI_Struc.h"
|
|
|
|
/* not useful according to lint but i let it*/
|
|
#define _WP_D_DEFINE_WAYPOINTS_
|
|
#include "WP_Handl.h"
|
|
#include "WP_Func.h"
|
|
#undef _WP_D_DEFINE_WAYPOINTS_
|
|
|
|
#include "Intell.h" /* for the fn_lEvalTree declaration*/
|
|
#include "DsgMem.h"
|
|
#include "ReadRule.h"
|
|
|
|
#include "Convert.h"
|
|
#include "specif/AITools.h"
|
|
|
|
//XB 05/08/99
|
|
#ifndef D_THROW_CFAST_AI
|
|
//End XB
|
|
|
|
#include "DsgMemC.h"
|
|
|
|
extern AI_tdstMind *p_stGlobalMind;
|
|
|
|
/*******************************************************************************************************************/
|
|
/* Get Functions to access DsgVar */
|
|
/*******************************************************************************************************************/
|
|
/*
|
|
MTH_tdxReal CFast_fn_xGetDsgVarFloat(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ((MTH_tdxReal) (*(MTH_tdxReal *)M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
C_TypeOfPerso CFast_fn_hGetDsgVarPerso(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ((C_TypeOfPerso) *(C_TypeOfPerso *)M_GetDsgVarAddr(p_stPerso,ucId));
|
|
}
|
|
|
|
// eDsgVarType_Vector
|
|
MTH3D_tdstVector *CFast_fn_p_stGetDsgVarVector(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ((MTH3D_tdstVector *)(M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
// eDsgVarType_Caps
|
|
unsigned long CFast_fn_ucGetDsgVarCaps(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return (*((unsigned long *)(M_GetDsgVarAddr(p_stPerso,ucId))));
|
|
}
|
|
|
|
// eDsgVarType_Graph
|
|
C_TypeOfGraph CFast_fn_hGetDsgVarGraph(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return(*((C_TypeOfGraph *)M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
// eDsgVarType_WayPoint
|
|
C_TypeOfWayPoint CFast_fn_hGetDsgVarWayPoint(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return (*((C_TypeOfWayPoint *)M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
// eDsgVarType_Action
|
|
C_TypeOfAction CFast_fn_xGetDsgVarAction(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return (*((C_TypeOfAction *)M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
// eDsgVarType_Comport
|
|
C_TypeOfComport CFast_fn_xGetDsgVarComport(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return (*((C_TypeOfComport *)M_GetDsgVarAddr(p_stPerso,ucId)));
|
|
}
|
|
|
|
// eDsgVarType_List
|
|
C_TypeOfList1 * CFast_fn_p_xGetDsgVarList(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return((C_TypeOfList1 *)M_GetDsgVarAddr(p_stPerso,ucId));
|
|
}
|
|
|
|
// eDsgVarType_Boolean
|
|
long CFast_fn_lGetDsgVarBoolean(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return((long) (* ((C_TypeOfBoolean *)M_GetDsgVarAddr(p_stPerso,ucId))));
|
|
}
|
|
|
|
// eDsgVarType__128To127
|
|
long CFast_fn_lGetDsgVar_128To127(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return( (long) (* ((C_TypeOf_128To127 *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
|
|
// eDsgVarType_0To255
|
|
long CFast_fn_lGetDsgVar0To255(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return( (long) (* ((C_TypeOf0To255 *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
// eDsgVarType__32768To32767
|
|
long CFast_fn_lGetDsgVar_32768To32767(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return( (long) (* ((C_TypeOf_32768To32767 *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
// eDsgVarType_0To65535
|
|
long CFast_fn_lGetDsgVar0To65535(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return((long)(*((C_TypeOf0To65535 *)M_GetDsgVarAddr(p_stPerso,ucId))));
|
|
}
|
|
|
|
// eDsgVarType_Integer
|
|
long CFast_fn_lGetDsgVarInteger(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ( (long) (* ((C_TypeOfInteger *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
|
|
// eDsgVarType_PositiveInteger
|
|
long CFast_fn_lGetDsgVarPositiveInteger(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ( (long) (* ((C_TypeOfPositiveInteger *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
|
|
// eDsgVarType_GameMaterial
|
|
C_TypeOfGameMaterial CFast_fn_xGetDsgVarGameMaterial(unsigned char ucId, AI_tdstMind *p_stPerso)
|
|
{
|
|
return ( (C_TypeOfGameMaterial) ( *((C_TypeOfGameMaterial *)M_GetDsgVarAddr(p_stPerso,ucId)) ) );
|
|
}
|
|
*/
|
|
/* eDsgVarType_PersoArray*/
|
|
/* eDsgVarType_VectorArray*/
|
|
/* eDsgVarType_FloatArray*/
|
|
/* eDsgVarType_IntegerArray*/
|
|
/* eDsgVarType_WayPointArray*/
|
|
/* eDsgVarType_TextArray*/
|
|
HIE_tdxHandleToSuperObject CFast_fn_hGetDsgVarPersoArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
return(M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
}
|
|
|
|
MTH3D_tdstVector *CFast_fn_p_stGetDsgVarVectorArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
#if defined(OPTIMIZED_ARRAY)
|
|
return((MTH3D_tdstVector *)(M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)));
|
|
#else
|
|
return(&M_tduGetSetParam_stVertexValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
#endif
|
|
}
|
|
|
|
MTH_tdxReal CFast_fn_xGetDsgVarFloatArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
return(M_tduGetSetParam_xValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
}
|
|
|
|
long CFast_fn_lGetDsgVarIntegerArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
return(M_tduGetSetParam_lValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
}
|
|
|
|
C_TypeOfWayPoint CFast_fn_hGetDsgVarWayPointArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
return(M_tduGetSetParam_hWayPoint((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
}
|
|
|
|
char *CFast_fn_p_szGetDsgVarTextArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex)
|
|
{
|
|
return(M_tduGetSetParam_szString((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))));
|
|
}
|
|
|
|
/*******************************************************************************************************************/
|
|
/* Set Functions to access DsgVar */
|
|
/*******************************************************************************************************************/
|
|
|
|
|
|
/* eDsgVarType_Float*/
|
|
void CFast_fn_vSetDsgVarFloat(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfFloat xValue)
|
|
{
|
|
*((C_TypeOfFloat *)M_GetDsgVarAddr(p_stPerso,ucId)) = ((C_TypeOfFloat) xValue);
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarFloat(unsigned char ucId, C_TypeOfFloat xValue)
|
|
{
|
|
*((C_TypeOfFloat *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = ((C_TypeOfFloat) xValue);
|
|
}
|
|
|
|
/* eDsgVarType_Perso*/
|
|
void CFast_fn_vSetDsgVarPerso(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfPerso hPerso)
|
|
{
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stPerso,ucId)) = hPerso;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarPerso(unsigned char ucId, C_TypeOfPerso hPerso)
|
|
{
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stGlobalMind,ucId)) = hPerso;
|
|
}
|
|
|
|
/* eDsgVarType_Perso*/
|
|
void CFast_fn_vSetDsgVarPersoWithEngine(unsigned char ucId, AI_tdstMind *p_stPerso, struct tdstEngineObject_ *hPerso)
|
|
{
|
|
if (hPerso)
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOfPerso)M_GetSuperObject(hPerso);
|
|
else
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOfPerso) NULL;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarPersoWithEngine(unsigned char ucId, struct tdstEngineObject_ *hPerso)
|
|
{
|
|
if (hPerso)
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOfPerso)M_GetSuperObject(hPerso);
|
|
else
|
|
*(C_TypeOfPerso *)(M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOfPerso) NULL;
|
|
}
|
|
|
|
/* eDsgVarType_Action*/
|
|
void CFast_fn_vSetDsgVarAction(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfAction hAction)
|
|
{
|
|
*((C_TypeOfAction *)M_GetDsgVarAddr(p_stPerso,ucId))= hAction;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarAction(unsigned char ucId,C_TypeOfAction hAction)
|
|
{
|
|
*((C_TypeOfAction *)M_GetDsgVarAddr(p_stGlobalMind,ucId))= hAction;
|
|
}
|
|
|
|
/* eDsgVarType_Comport*/
|
|
void CFast_fn_vSetDsgVarComport(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfComport p_stComport)
|
|
{
|
|
*((C_TypeOfComport *)M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOfComport) p_stComport;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarComport(unsigned char ucId, C_TypeOfComport p_stComport)
|
|
{
|
|
*((C_TypeOfComport *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOfComport) p_stComport;
|
|
}
|
|
|
|
/* eDsgVarType_Vector*/
|
|
void CFast_fn_vSetDsgVarVector(unsigned char ucId, AI_tdstMind *p_stPerso,MTH3D_tdstVector *p_stVertex)
|
|
{
|
|
MTH3D_M_vCopyVector(((C_TypeOfVector *)M_GetDsgVarAddr(p_stPerso,ucId)),p_stVertex);
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarVector(unsigned char ucId, MTH3D_tdstVector *p_stVertex)
|
|
{
|
|
MTH3D_M_vCopyVector(((C_TypeOfVector *)M_GetDsgVarAddr(p_stGlobalMind,ucId)),p_stVertex);
|
|
}
|
|
|
|
/* eDsgVarType_Caps*/
|
|
void CFast_fn_vSetDsgVarCaps(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfCaps ulCaps)
|
|
{
|
|
*((C_TypeOfCaps *)M_GetDsgVarAddr(p_stPerso,ucId)) =ulCaps;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarCaps(unsigned char ucId, C_TypeOfCaps ulCaps)
|
|
{
|
|
*((C_TypeOfCaps *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) =ulCaps;
|
|
}
|
|
|
|
/* eDsgVarType_Graph*/
|
|
void CFast_fn_vSetDsgVarGraph(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfGraph hGraph)
|
|
{
|
|
*((C_TypeOfGraph *)M_GetDsgVarAddr(p_stPerso,ucId)) = hGraph;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarGraph(unsigned char ucId,C_TypeOfGraph hGraph)
|
|
{
|
|
*((C_TypeOfGraph *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = hGraph;
|
|
}
|
|
|
|
/* eDsgVarType_WayPoint*/
|
|
void CFast_fn_vSetDsgVarWayPoint(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfWayPoint hWayPoint)
|
|
{
|
|
*((C_TypeOfWayPoint *)M_GetDsgVarAddr(p_stPerso,ucId)) = hWayPoint;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarWayPoint(unsigned char ucId, C_TypeOfWayPoint hWayPoint)
|
|
{
|
|
*((C_TypeOfWayPoint *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = hWayPoint;
|
|
}
|
|
|
|
/* eDsgVarType_List*/
|
|
void CFast_fn_vSetDsgVarList(unsigned char ucId, AI_tdstMind *p_stPerso, tdstList *p_SrcList)
|
|
{
|
|
tdstList *p_TgtList = (tdstList *)M_GetDsgVarAddr(p_stPerso,ucId);
|
|
p_TgtList->ucNbElt = (unsigned char) M_Min(p_SrcList->ucNbElt, p_TgtList->ucMaxSize);
|
|
memcpy((void*) p_TgtList->d_TabElt,(void*) p_SrcList->d_TabElt,p_TgtList->ucNbElt*C_SizeOfPersoInList);
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarList(unsigned char ucId, tdstList *p_SrcList)
|
|
{
|
|
tdstList *p_TgtList = (tdstList *)M_GetDsgVarAddr(p_stGlobalMind,ucId);
|
|
p_TgtList->ucNbElt = (unsigned char) M_Min(p_SrcList->ucNbElt, p_TgtList->ucMaxSize);
|
|
memcpy((void*) p_TgtList->d_TabElt,(void*) p_SrcList->d_TabElt,p_TgtList->ucNbElt*C_SizeOfPersoInList);
|
|
}
|
|
|
|
/* eDsgVarType_Boolean*/
|
|
void CFast_fn_vSetDsgVarBoolean(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfBoolean bValue)
|
|
{
|
|
*((C_TypeOfBoolean *)M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOfBoolean) bValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarBoolean(unsigned char ucId, C_TypeOfBoolean bValue)
|
|
{
|
|
*((C_TypeOfBoolean *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOfBoolean) bValue;
|
|
}
|
|
|
|
/* eDsgVarType__128To127*/
|
|
void CFast_fn_vSetDsgVar_128To127(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOf_128To127 *)M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOf_128To127) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVar_128To127(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOf_128To127 *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOf_128To127) lValue;
|
|
}
|
|
|
|
/* eDsgVarType_0To255*/
|
|
void CFast_fn_vSetDsgVar0To255(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOf0To255 *)M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOf0To255) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVar0To255(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOf0To255 *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOf0To255) lValue;
|
|
}
|
|
|
|
/* eDsgVarType__32768To32767*/
|
|
void CFast_fn_vSetDsgVar_32768To32767(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOf_32768To32767 *)M_GetDsgVarAddr(p_stPerso,ucId)) = (C_TypeOf_32768To32767) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVar_32768To32767(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOf_32768To32767 *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = (C_TypeOf_32768To32767) lValue;
|
|
}
|
|
|
|
/* eDsgVarType_0To65535*/
|
|
void CFast_fn_vSetDsgVar0To65535(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOf0To65535 *)(M_GetDsgVarAddr(p_stPerso,ucId))) = (C_TypeOf0To65535) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVar0To65535(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOf0To65535 *)(M_GetDsgVarAddr(p_stGlobalMind,ucId))) = (C_TypeOf0To65535) lValue;
|
|
}
|
|
|
|
/* eDsgVarType_Integer*/
|
|
void CFast_fn_vSetDsgVarInteger(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOfInteger *)(M_GetDsgVarAddr(p_stPerso,ucId))) = (C_TypeOfInteger) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarInteger(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOfInteger *)(M_GetDsgVarAddr(p_stGlobalMind,ucId))) = (C_TypeOfInteger) lValue;
|
|
}
|
|
|
|
/* eDsgVarType_PositiveInteger*/
|
|
void CFast_fn_vSetDsgVarPositiveInteger(unsigned char ucId, AI_tdstMind *p_stPerso, long lValue)
|
|
{
|
|
*((C_TypeOfPositiveInteger *)(M_GetDsgVarAddr(p_stPerso,ucId))) = (C_TypeOfPositiveInteger) lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarPositiveInteger(unsigned char ucId, long lValue)
|
|
{
|
|
*((C_TypeOfPositiveInteger *)(M_GetDsgVarAddr(p_stGlobalMind,ucId))) = (C_TypeOfPositiveInteger) lValue;
|
|
}
|
|
|
|
/* eDsgVarType_GameMaterial*/
|
|
void CFast_fn_vSetDsgVarGameMaterial(unsigned char ucId, AI_tdstMind *p_stPerso, C_TypeOfGameMaterial hGameMaterial)
|
|
{
|
|
*((C_TypeOfGameMaterial *)M_GetDsgVarAddr(p_stPerso,ucId)) = hGameMaterial;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarGameMaterial(unsigned char ucId, C_TypeOfGameMaterial hGameMaterial)
|
|
{
|
|
*((C_TypeOfGameMaterial *)M_GetDsgVarAddr(p_stGlobalMind,ucId)) = hGameMaterial;
|
|
}
|
|
|
|
/* eDsgVarType_PersoArray*/
|
|
void CFast_fn_vSetDsgVarPersoArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, C_TypeOfPerso hPerso)
|
|
{
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))) = hPerso;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarPersoArray(unsigned char ucId, unsigned char ucTabIndex, C_TypeOfPerso hPerso)
|
|
{
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))) = hPerso;
|
|
}
|
|
|
|
void CFast_fn_vSetDsgVarPersoArrayWithEngine(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, struct tdstEngineObject_ *hPerso)
|
|
{
|
|
if (hPerso)
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))) = (C_TypeOfPerso)M_GetSuperObject(hPerso);
|
|
else
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))) = (C_TypeOfPerso) NULL;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarPersoArrayWithEngine(unsigned char ucId, unsigned char ucTabIndex, struct tdstEngineObject_ *hPerso)
|
|
{
|
|
if (hPerso)
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))) = (C_TypeOfPerso)M_GetSuperObject(hPerso);
|
|
else
|
|
( M_tduGetSetParam_hSuperObject((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))) = (C_TypeOfPerso) NULL;
|
|
}
|
|
|
|
|
|
/* eDsgVarType_VectorArray*/
|
|
void CFast_fn_vSetDsgVarVectorArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, MTH3D_tdstVector *p_stVector)
|
|
{
|
|
#if defined(OPTIMIZED_ARRAY)
|
|
MTH3D_M_vCopyVector((MTH3D_tdstVector *)(M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)), p_stVector);
|
|
#else
|
|
MTH3D_M_vCopyVector((MTH3D_tdstVector *)(&M_tduGetSetParam_stVectorValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))), p_stVector);
|
|
#endif
|
|
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarVectorArray(unsigned char ucId, unsigned char ucTabIndex, MTH3D_tdstVector *p_stVector)
|
|
{
|
|
#if defined(OPTIMIZED_ARRAY)
|
|
MTH3D_M_vCopyVector((MTH3D_tdstVector *)(M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)), p_stVector);
|
|
#else
|
|
MTH3D_M_vCopyVector((MTH3D_tdstVector *)(&M_tduGetSetParam_stVectorValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))), p_stVector);
|
|
#endif
|
|
}
|
|
|
|
/* eDsgVarType_FloatArray*/
|
|
void CFast_fn_vSetDsgVarFloatArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, MTH_tdxReal xValue)
|
|
{
|
|
*((MTH_tdxReal *)&M_tduGetSetParam_xValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))) = xValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarFloatArray(unsigned char ucId, unsigned char ucTabIndex, MTH_tdxReal xValue)
|
|
{
|
|
*((MTH_tdxReal *)&M_tduGetSetParam_xValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))) = xValue;
|
|
}
|
|
|
|
/* eDsgVarType_IntegerArray*/
|
|
void CFast_fn_vSetDsgVarIntegerArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, long lValue)
|
|
{
|
|
*((long *)&M_tduGetSetParam_lValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))) = lValue;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarIntegerArray(unsigned char ucId, unsigned char ucTabIndex, long lValue)
|
|
{
|
|
*((long *)&M_tduGetSetParam_lValue((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))) = lValue;
|
|
}
|
|
|
|
/* eDsgVarType_WayPointArray*/
|
|
void CFast_fn_vSetDsgVarWayPointArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, C_TypeOfWayPoint hWayPoint)
|
|
{
|
|
*((C_TypeOfWayPoint *)&M_tduGetSetParam_hWayPoint((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex))))= hWayPoint;
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarWayPointArray(unsigned char ucId, unsigned char ucTabIndex, C_TypeOfWayPoint hWayPoint)
|
|
{
|
|
*((C_TypeOfWayPoint *)&M_tduGetSetParam_hWayPoint((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex))))= hWayPoint;
|
|
}
|
|
|
|
/* eDsgVarType_TextArray*/
|
|
void CFast_fn_vSetDsgVarTextArray(unsigned char ucId, AI_tdstMind *p_stPerso, unsigned char ucTabIndex, char *p_szString)
|
|
{
|
|
strcpy(((char *)M_tduGetSetParam_szString((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stPerso,ucId),ucTabIndex)))), p_szString);
|
|
}
|
|
void LocalCFast_fn_vSetDsgVarTextArray(unsigned char ucId, unsigned char ucTabIndex, char *p_szString)
|
|
{
|
|
strcpy(((char *)M_tduGetSetParam_szString((M_ARRAY_ELEMENT((tdstArray*)M_GetDsgVarAddr(p_stGlobalMind,ucId),ucTabIndex)))), p_szString);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* A voir
|
|
unsigned char fn_ucSetDsgVarArray(void *pMyVarAddr,unsigned char ucIndex,tdstGetSetParam *p_stGetSetParam)
|
|
{
|
|
unsigned char ret=C_INVALID_SET;
|
|
tdstArray *p_stArray=(tdstArray*) pMyVarAddr;
|
|
tdeDsgVarTypeId eDsgVarTypeId=M_ARRAY_TYPE(p_stArray);
|
|
#if defined(__DEBUG_AI__)
|
|
if (M_GetSetParam_Type(p_stGetSetParam)==fn_GetDsgVarType(eDsgVarTypeId))
|
|
if (ucIndex<M_ARRAY_SIZE(p_stArray))
|
|
#endif
|
|
{
|
|
tdp_fn_ucSetDsgVarFunctionPtr p_fn_ucSetDsgVar=fn_p_fn_pGetDsgVarSetFunctionPtr(eDsgVarTypeId);
|
|
ret=p_fn_ucSetDsgVar((void *) M_ARRAY_ELEMENT(p_stArray,ucIndex),0,p_stGetSetParam);
|
|
}
|
|
return(ret);
|
|
}
|
|
*/
|
|
|
|
//XB 05/08/99
|
|
#endif /* D_THROW_CFAST_AI */
|
|
//End XB
|