/*========================================================================= * ####.cpp : ####'s functions * * * * #### MUST BE REPLACE BY THE C FILENAME * * * Version 1.0 * Creation date 01/10/96 * Revision date * * That file needs to be compatible for all platforms. * * (c) Ubi Studios 1996 *=======================================================================*/ //***************************************************** //*** For the structures and variables declarations *** //***************************************************** #define D_####_StructureDefine #define D_####_VariableDefine #include "ToolsCPA.h" #include "Options/Options.h" #include "Macros.h" #include "Actions/AllActs.h" #include "Structur/MemGame.h" #include "Structur/ErrGame.h" #include "Structur/Objects.h" #include "Structur/GameScpt.h" #include "Structur/StdObjSt.h" #include "Structur/EngMode.h" #include "Basic.h" #include "ObjInit.h" #include "ZeMem.h" /*----------------------------------------------------------------------------- * Description : ####'s object action script callback *----------------------------------------------------------------------------- * Input : Object pointer * Output : None *----------------------------------------------------------------------------- * Creation date : 01/10/96 Author : xxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ SCR_tde_Anl_ReturnValue fn_e####ScriptCallback(SCR_tdst_File_Description *_p_stFile,char *_p_szName,char *_ap_szParams[],SCR_tde_Anl_Action _eAction) { SCR_tde_Anl_ReturnValue eReturnValue = SCR_ERV_Anl_NormalReturn; MS_tdxHandleTo#### h_####; struct tdstEngineObject_ *p_stEngineObject; _p_stFile=_p_stFile; SCR_M_RdL0_GetSectionLong(C_ParentSection,0,struct tdstEngineObject_ *, p_stEngineObject); if (M_IsTitle) { h_#### = fn_h_####RealAlloc(); p_stEngineObject->h_#### = h_####; SCR_M_RdL0_SetSectionLong(C_ThisSection,0,h_####); } else if (M_IsEntry) { SCR_M_RdL0_GetSectionLong(C_ThisSection,0,MS_tdxHandleTo####,h_####); } return(eReturnValue); } /*----------------------------------------------------------------------------- * Description : ####'s save structure *----------------------------------------------------------------------------- * Input : SCR_tdst_File_Description *, struct tdstEngineObject_ * * Output : Void *----------------------------------------------------------------------------- * Creation date : 28/02/97 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ /* void fn_v####SaveMiniStructure(SCR_tdst_File_Description *p_stFile,struct tdstEngineObject_ *p_stObject) { char szSection[SCR_CV_ui_Cfg_MaxLenName]; MS_tdxHandleTo#### h_#### = p_stObject->h_####; SCR_M_SvL0_SaveBlankLine(p_stFile); SCR_M_SvL0_SaveComment(p_stFile, "**** #### mini-structure definition ****"); sprintf(szSection,"%s:",C_Section####Description); SCR_M_SvL0_SaveBeginSection(p_stFile,szSection,SCR_CC_C_Cfg_EOL); //** Put here the saving script functions ** SCR_M_SvL0_SaveEndSection(p_stFile, SCR_CC_C_Cfg_EOL) } */ /*----------------------------------------------------------------------------- * Description : ####'s mini-structure sizeof *----------------------------------------------------------------------------- * Input : None * Output : Size of *----------------------------------------------------------------------------- * Creation date : 14/10/96 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ unsigned long fn_ul####SizeOf() { return(sizeof(struct tdst####_)); } /*----------------------------------------------------------------------------- * Description : ####'s object action allocation *----------------------------------------------------------------------------- * Input : Object pointer * Output : None *----------------------------------------------------------------------------- * Creation date : 01/10/96 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####Alloc(struct tdstEngineObject_ *p_stObject) { if (p_stObject==NULL) M_GameFatalError(E_uwGameMiniStructObjectNull); if (p_stObject->h_####!=NULL) M_GameFatalError(E_uwGameMiniStructAllocAlreadyAlloc); p_stObject->h_#### = fn_h_####RealAlloc(); fn_v####InitValueSAI(MS_tdxHandleTo#### h_####); } MS_tdxHandleTo#### fn_h_####RealAlloc() { MS_tdxHandleTo#### h_####; h_#### = (MS_tdxHandleTo####)M_p_GameMallocInHLM(fn_ul####SizeOf()); return(h_####); } /*----------------------------------------------------------------------------- * Description : ####'s object action free *----------------------------------------------------------------------------- * Input : Object pointer * Output : None *----------------------------------------------------------------------------- * Creation date : 01/10/96 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####Free(struct tdstEngineObject_ *p_stObject) { if (p_stObject==NULL) M_GameFatalError(E_uwGameMiniStructObjectNull); if (p_stObject->h_####==NULL) M_GameFatalError(E_uwGameMiniStructNull); fn_v####FreeInitValueSAI(MS_tdxHandleTo#### h_####); M_GameFreeInHLM(E_ucGameEngineObjectMemory,p_stObject->h_####); } /*----------------------------------------------------------------------------- * Description : ####'s object action initialisation *----------------------------------------------------------------------------- * Input : When this function's called (see ObjInit.h) * Output : None *----------------------------------------------------------------------------- * Creation date : 01/10/96 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####Init(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit) { if (p_stObject==NULL) M_GameFatalError(E_uwGameMiniStructObjectNull); if (p_stObject->h_####==NULL) M_GameFatalError(E_uwGameMiniStructNull); switch(eObjectInit) { case OTI_WhenGameStart: break; case OTI_ReinitTheMap: break; case OTI_LoadSavedGame: break; case OTI_MapLoaded: fn_v####InitValueSAI(MS_tdxHandleTo#### h_####); fn_v####SavedValueSAI(MS_tdxHandleTo#### h_####); break; case OTI_PlayerDead: break; } } /*----------------------------------------------------------------------------- * Description : ####'s object action desinitialisation *----------------------------------------------------------------------------- * Input : When this function's called (see ObjInit.h) * Output : None *----------------------------------------------------------------------------- * Creation date : 01/10/96 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####Desinit(struct tdstEngineObject_ *p_stObject,enum tdeObjectTreeInit_ eObjectInit) { if (p_stObject==NULL) M_GameFatalError(E_uwGameMiniStructObjectNull); if (p_stObject->h_####==NULL) M_GameFatalError(E_uwGameMiniStructNull); switch(eObjectInit) { case OTI_WhenGameStart: break; case OTI_ReinitTheMap: break; case OTI_MapLoaded: break; case OTI_PlayerDead: break; } } /*----------------------------------------------------------------------------- * Description : ####'s object copy clone action *----------------------------------------------------------------------------- * Input : Handle to destination, handle to source * Output : None *----------------------------------------------------------------------------- * Creation date : 30/06/97 Author : Olivier Jourdan *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####CopyClone(struct tdstEngineObject_ * _p_stObjectDest,struct tdstEngineObject_ * _p_stObjectSrc) { // If #### doesn't contains pointers to structure that may be // changed during the game, this function must only be a : // memcpy(_p_stObjectDest->h_####,_p_stObjectSrc->h_####,fn_ul####SizeOf()); } /*----------------------------------------------------------------------------- * Description : #### access functions *----------------------------------------------------------------------------- * Input : MS_tdxHandleTo#### + (value) * Output : (value or pointer) *----------------------------------------------------------------------------- * Creation date : 29/01/97 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ xtype fn_x####Getxxxxxx(MS_tdxHandleTo####) { return(h_####->xxxxxx); } void fn_v####Setxxxxxx(MS_tdxHandleTo####,xtype xValue) { h_####->xxxxxx = xValue; } /*----------------------------------------------------------------------------- * Description : #### SAI functions *----------------------------------------------------------------------------- * Input : MS_tdxHandleTo#### + (value) * Output : (value or pointer) *----------------------------------------------------------------------------- * Creation date : 29/01/97 Author : xxxxxxxxx *----------------------------------------------------------------------------- * Modification date : Modification Author : * Modifications : *---------------------------------------------------------------------------*/ void fn_v####InitValueSAI(MS_tdxHandleTo#### h_####) { //*** Put here the functions : //*** SAI_fn_bInsertMTHVectorInTable((void*)&_h_####->xxx,SAI_eInitWhenPlayerDead|SAI_eInitWhenReinitTheMap|SAI_eInitWhenMapLoaded); } void fn_v####SavedValueSAI(MS_tdxHandleTo#### h_####) { //*** Put here the functions : //*** SAI_fn_bInsertMTHVectorInTable((void*)&p_####->xxx,SAI_eSaveCurrentValue); } void fn_v####FreeInitValueSAI(MS_tdxHandleTo#### h_####) { //*** Put here the functions : //*** }