/*=========================================================================
* ErrGame.h : Management of the errors for GAME
*
* This is a part of the Game project.
*
* Version                      1.0
* Creation date        20/08/96
* Revision date
*
* That file needs to be compatible for all platforms.
*
* (c) Ubi Studios 1996
*=======================================================================*/
#if !defined(__ERRGAME_H_)
#define __ERRGAME_H_
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
 
#ifdef  __cplusplus
extern "C" {
#endif
 
#include "GAM/Header.h"
 
#define __FATAL_ERR_GAME__
#define __INFORMATION_ERR_GAME__ /**** Treat as a level 1 warning ****/
#define __WARNING_ERR_GAME__     /**** Treat as a level 2 warning ****/
 
enum e_uwGameErrNumber
{
 E_uwGameFatalErr,
 
 #if defined(__FATAL_ERR_GAME__)
 /**** Error's errors ****/
 E_uwGameFatalErrorNotAFatalError,
 E_uwGameInformationErrorIsNotAInformationError,
 E_uwGameWarningErrorIsNotAWarningError,
 /**** Memory's errors ****/
 E_uwGameInitMemoryCheckAlign,
 E_uwGameGameMallocBadBlock,
 E_uwGameGameMallocBadSize,
 E_uwGameGameMallocAlloc,
 E_uwGameIncreaseNumberOfSource,
 /**** Object's errors ****/
 E_uwGameScriptCallBackStateActionsAlreadyRead,
 E_uwGameInitAllObjectTreeNullPointer,
 E_uwGameInitAllObjectTreeBadInitType,
 E_uwGameInitDesinitOneObjectNullPointer,
 E_uwGameMiniStructAllocAlreadyAlloc,
 E_uwGameMiniStructObjectNull,
 E_uwGameMiniStructNull,
 E_uwGameCineInfoSuperObjectNull,
 /**** Engine's errors ****/
 E_uwGameChooseTheGoodInitInvalidMode,
 E_uwGameChooseTheGoodDesinitInvalidMode,
 E_uwGameChangeEngineModeNewMode,
 E_uwGameExploreWorldTreeInvalidSuperObject,
 E_uwGameVerifySomeProgramVariableHandleFunction,
 E_uwGameLanguage,
 E_uwGameLanguageDefinition,
 /**** Basic functions errors ****/
 E_uwGameAToIBadEntry,
 E_uwGameAToFBadEntry,
 /**** Script errors ****/
 E_uwGameScriptBadNumberOfArg,
 E_uwGameScriptBadIPTLinkNumber,
  /**** Animations ****/
 E_uwGameErrorWhileLoadingAnimation,
 E_uwGameBadAnimationGeneralInfo,
 E_uwGameBadFrameNumber,
 E_uwGameBadChannelNumber,
 E_uwGameTooManyAnimations,
 E_uwGameCurrentActorNotSet,
 E_uwGameNoMorePLAObj,
 E_uwGamePLA_NoWantedState,
 E_uwGameStateNotInLinkTable,
 E_uwGameScriptCallBackCreateNewStateBadNextState,
 E_uwGameScriptCallBackCreateNewStateBadTargetState,
 E_uwGameScriptCallBackCreateNewStateBadStateToGo,
 /**** ViewPort errors ****/
 E_uwGameCantCreateFixViewPort,
 E_uwGameCantClearViewPort,
 E_uwGameCantWriteToViewPort,
 E_uwGameCantWriteToViewPortFinished,
 E_uwGameCantFlipDevice,
 /**** Always errors ****/
 E_uwGameKillAlwaysByPersonalType,
  /**** Dynamics ****/
 E_uwGameDynamScriptCallBackBadParameter,
  /**** SubMap ****/
 E_uwGameUnCoherentSubMap,
#endif /* __FATAL_ERR_GAME__ */
 
 E_uwGameStartOfWarning,
 
 #if defined(__WARNING_ERR_GAME__)
 /**** Engine's warning ****/
 E_uwGameChangeEngineModeOldMode,
 /**** memory's warning ****/
 E_uwGameMallocUserDataAlreadyAllocated,
 /**** Input's warning ****/
 E_uwGameReadInputKeyboard,
 E_uwGameReadInputJoystick,
 /**** Object's warning ****/
 E_uwGameAddAnAlwaysModelAlreadyExist,
 E_uwGameAllocateAlwaysUnknownModel,
 E_uwGameAllocateAlwaysNoMorePlace,
 E_uwGameKillOneEngineObjectInvalid,
 E_uwGameFreeEngineSuperObjectNoCharacter,
 E_uwGameFirstInitFamilyStructureNoNull,
 E_uwGameFreeUnknownSuperObjectType,
 E_uwGameSaveOneEngineCharacters,
 E_uwGameSaveAllEngineCharacters,
 E_uwGameCreateSOFromEngineObjectAndParentBadSO,
 E_uwGameChangeOfMechanicsDuringOneFrame,
 E_uwGameBadNumberOfStatesInActivationList,
 E_uwGamePLA_BadInitialState,
 /*E_uwGameProblemsWithStartingPosition,*/
 E_uwGameDebugDynamicAllocation,
#endif /* __WARNING_ERR_GAME__ */
 
 E_uwGameStartOfInformationWarning,
 
 #if defined(__INFORMATION_ERR_GAME__)
 /**** Input's information ****/
 E_uwGameInitInputKeyboard,
 E_uwGameInitInputJoystick,
 /**** Memory's information ****/
 E_uwGameGameFreeNullPointer,
 /**** Object's information ****/
 E_uwGameInitOneObjectInvalidObject,
 E_uwGameKillAlwaysByRankInvalidObject,
 /**** Script's information ****/
 E_uwGameScriptCallBackDescriptionUnknownAction,
 E_uwGameScriptCallBackDescriptionScriptError,
 /**** Sector errors ****/
 E_uwGameCurrentSectorInOwnSoundList,
 E_uwGameSectorTwiceInSoundList,
 E_uwGameCurrentSectorInOwnActivityList,
 E_uwGameSectorTwiceInActivityList,
 E_uwGameCurrentSectorInOwnCollisionList,
 E_uwGameSectorTwiceInCollisionList,
 E_uwGameCurrentSectorInOwnGraphicList,
 E_uwGameSectorTwiceInGraphicList,
 
  #endif /* __INFORMATION_ERR_GAME__ */
 
	E_uwGameErrNumber,
};
 
/*------------------*/
/* Global Variables*/
/*------------------*/
 
EXTERN unsigned char g_ucGameModuleId /* number of identification of the Game module*/
#if defined(D_GameGlobals)
= C_ucModuleNotInitialized
#endif /* D_GameGlobals */
;
 
#if defined(__ERROR_STRINGS__)
 
EXTERN CPA_EXPORT char * g_a_szGameInformationModule []
#if defined(D_GameGlobals) && !defined(CPA_WANTS_IMPORT)
= {C_szGamVersion, C_szGamFullName, C_szGamDate}
#endif /* D_GameGlobals &&  CPA_WANTS_IMPORT */
	;
 
EXTERN char * g_szGameModuleName /* Obliged syntax 'sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(D_GameGlobals)
= {C_szGamFullName}
#endif /* D_GameGlobals */
;
 
EXTERN tdstErrorMsg g_a_stGameTabErr[] /* Obliged syntax 'a_sz'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(D_GameGlobals)
=
{
#if defined(__FATAL_ERR_GAME__)
/*     --------------------*/
 /**** Error's errors ****/
 E_uwGameFatalErrorNotAFatalError,"M_GameFatalError : Try to raise a warning or an information",
 E_uwGameInformationErrorIsNotAInformationError,"M_GameInformationError : Try to raise a fatal or a warning",
 E_uwGameWarningErrorIsNotAWarningError,"M_GameWarningError : Try to raise a fatal or a information",
 /**** Memory's errors ****/
 E_uwGameInitMemoryCheckAlign,"fn_vInitMemory : Bad alignment memory",
 E_uwGameGameMallocBadBlock,"fnp_vGameMalloc : Bad block memory",
 E_uwGameGameMallocBadSize,"fnp_vGameMalloc : Bad size allocation",
 E_uwGameGameMallocAlloc,"fnp_vGameMalloc : Null pointer returned",
 E_uwGameIncreaseNumberOfSource,"GAM_fn_vMemoryLogFile : Increase number of source",
 /**** Object's errors ****/
 E_uwGameScriptCallBackStateActionsAlreadyRead,"fn_vScriptCallBackStateActions : Two lines have the same state in script",
 E_uwGameInitAllObjectTreeNullPointer,"fn_vInitAllObjectTree : Null pointer",
 E_uwGameInitAllObjectTreeBadInitType,"fn_vInitAllObjectTree : Bad initialisation's type",
 E_uwGameInitDesinitOneObjectNullPointer,"fn_v(Des)InitOneObject : A object must have p_st3dDatas and p_stStandardGame",
 E_uwGameMiniStructAllocAlreadyAlloc,"fn_v####Alloc : Attempt to realloc a mini structure",
 E_uwGameMiniStructObjectNull,"Attempt to used a NULL object's pointer",
 E_uwGameMiniStructNull,"Attempt to used a NULL object mini-structure's pointer",
 E_uwGameCineInfoSuperObjectNull,"Attempt to used CineInfo with no SuperObject",
  /**** Engine's errors ****/
 E_uwGameChooseTheGoodInitInvalidMode,"fn_vChooseTheGoodInit : invalid engine mode",
 E_uwGameChooseTheGoodDesinitInvalidMode,"fn_vChooseTheGoodDesInit : invalid engine mode",
 E_uwGameChangeEngineModeNewMode,"fn_vChangeEngineMode : bad new engine mode",
 E_uwGameExploreWorldTreeInvalidSuperObject,"fn_vExploreWorldTree : unknown SuperObject type",
 E_uwGameVerifySomeProgramVariableHandleFunction,"fn_vVerifySomeProgramVariable : size of tdstEngineObject and stStructureHandleFunction are not compatible",
 E_uwGameLanguage,"Array of languages is full.",
 E_uwGameLanguageDefinition, "Redefinition of the array of languages." ,
 /**** Basic functions errors ****/
 E_uwGameAToIBadEntry,"fn_lAToI : string in number.",
 E_uwGameAToFBadEntry,"fn_lAToF : string in number.",
 /**** Script errors ****/
 E_uwGameScriptBadNumberOfArg,"Script callback : bad number of arguments",
 E_uwGameScriptBadIPTLinkNumber,"fn_eScriptCallBackIPTLink : Bad link number",
 /**** Animations ****/
 E_uwGameErrorWhileLoadingAnimation,"",
 E_uwGameBadAnimationGeneralInfo,"",
 E_uwGameBadFrameNumber,"",
 E_uwGameBadChannelNumber,"",
 E_uwGameTooManyAnimations,"",
 E_uwGameCurrentActorNotSet,"",
 E_uwGameNoMorePLAObj,"SuperObjects heap Overflow : increase constant at the top of PlayAnim.h",
 E_uwGamePLA_NoWantedState,"WantedState == NULL, a state has ended and no new state has been positionned",
 E_uwGameScriptCallBackCreateNewStateBadNextState,"fn_eScriptCallBackCreateNewState : Bad Next State",
 E_uwGameScriptCallBackCreateNewStateBadTargetState,"fn_eScriptCallBackCreateNewState : Bad Target State",
 E_uwGameScriptCallBackCreateNewStateBadStateToGo,"fn_eScriptCallBackCreateNewState : Bad StateToGo State",
 /**** ViewPort errors ****/
 E_uwGameCantCreateFixViewPort,"fn_vCreateFixViewPort : failed.",
 E_uwGameCantClearViewPort,"fn_vEngine : Can't clear ViewPort.",
 E_uwGameCantWriteToViewPort,"fn_vEngine : Can't write to ViewPort.",
 E_uwGameCantWriteToViewPortFinished,"fn_vDisplayAll : can't write to ViewPort finished",
 E_uwGameCantFlipDevice,"fn_vDisplayAll : can't write to ViewPort finished",
 /**** Always errors ****/
 E_uwGameKillAlwaysByPersonalType,"fn_vKillAlwaysByPersonalType : Bad SO type founded",
 /**** Dynamics ****/
 E_uwGameDynamScriptCallBackBadParameter,"fn_eDynamScriptCallBack : Bad parameters",
 /**** Submap ****/
 E_uwGameUnCoherentSubMap,"fn_vVerifySubMapCoherence : Some loaded sectors are not child of root",
 
 
#endif /* __FATAL_ERR_GAME__ */
 
#ifdef __WARNING_ERR_GAME__
/*     --------------------*/
 /**** Engine's warning ****/
 E_uwGameChangeEngineModeOldMode,"fn_vChangeEngineMode : bad old engine mode",
 /**** memory's warning ****/
 E_uwGameMallocUserDataAlreadyAllocated,"fn_vMallocUserData : User data already allocated.",
 /**** Input's warning ****/
 E_uwGameReadInputKeyboard,"fn_vReadInput : keyboard is read but not initialized", 
 E_uwGameReadInputJoystick,"fn_vReadInput : joystick is read but not initialized",
 /**** Object's warning ****/
 E_uwGameAddAnAlwaysModelAlreadyExist,"fn_vAddAnAlwaysModel : Always model already exist (ignored)",
 E_uwGameAllocateAlwaysUnknownModel,"fn_p_stAllocateAlways : Unknown always model",
 E_uwGameAllocateAlwaysNoMorePlace,"fn_p_stAllocateAlways : No more place",
 E_uwGameKillOneEngineObjectInvalid,"fn_vKillOneEngineObject : Attempt to kill a invalid object (ignored)",
 E_uwGameFreeEngineSuperObjectNoCharacter,"fn_p_stFreeEngineSuperObject : Attempt to free a no character SuperObject (ignored)",
 E_uwGameFirstInitFamilyStructureNoNull,"fn_vFirstInitFamilyStructure : g_p_stFamily is not NULL (lost memory) !!!",
 E_uwGameFreeUnknownSuperObjectType,"fn_vDestroyAllHierarchy : Unknown super object type (ignored).",
 E_uwGameSaveOneEngineCharacters,"fn_vSaveOneEngineCharacters : Can not save character (ignored).",
 E_uwGameSaveAllEngineCharacters,"fn_vSaveAllEngineAndAlwaysCharacters : Can not save characters (ignored).",
 E_uwGameCreateSOFromEngineObjectAndParentBadSO,"fn_hCreateSOFromEngineObjectAndParent : Try to put a Character SO above a not Physical SO",
 E_uwGameChangeOfMechanicsDuringOneFrame,"fn_vMakeCharacterReact : Kind of Mechanics should change at beginning of Frame !",
 /* JO 29/05/97*/
 E_uwGameBadNumberOfStatesInActivationList,"fn_eScriptCallBackCreateNewZoneSetArray : Will bug in few minuts!!",
 E_uwGamePLA_BadInitialState,"Bad Initial State in .car : it doesn't exist in .sta",
 /*E_uwGameProblemsWithStartingPosition,"Problem with starting point",*/
 E_uwGameDebugDynamicAllocation,"Debug version : dynamic allocation in bloc GAM (don't forget to increase the bloc)",
 
#endif /* __WARNING_ERR_GAME__ */
 
#ifdef __INFORMATION_ERR_GAME__
/*     --------------------*/
 /**** Input's information ****/
 E_uwGameInitInputKeyboard,"fn_vInitInput : no keyboard !",
 E_uwGameInitInputJoystick,"fn_vInitInput : no joystick !",
 /**** Memory's information ****/
 E_uwGameGameFreeNullPointer,"fn_vGameFree : Try to free a null pointer !",
 /**** Object's information ****/
 E_uwGameInitOneObjectInvalidObject,"fn_vInitOneObject : init a invalid object",
 E_uwGameKillAlwaysByRankInvalidObject,"fn_vKillAlwaysByRank : attempt to destroy invalid always object",
 /**** Script's information ****/
 E_uwGameScriptCallBackDescriptionUnknownAction,"fn_eScriptCallBackXxx : unknown action (ignored)",
 E_uwGameScriptCallBackDescriptionScriptError,"fn_eScriptCallBackXxx : internal script error (file skipped)",
 /**** Sector errors ****/
 E_uwGameCurrentSectorInOwnSoundList,"fn_vTestAllSectorsListForIncoherences: Current sector is in its own Sound list",
 E_uwGameSectorTwiceInSoundList,"fn_vTestAllSectorsListForIncoherences: Sector is twice in Sound list",
 E_uwGameCurrentSectorInOwnActivityList,"fn_vTestAllSectorsListForIncoherences: Current sector is in its own Activity list",
 E_uwGameSectorTwiceInActivityList,"fn_vTestAllSectorsListForIncoherences: Sector is twice in Activity list",
 E_uwGameCurrentSectorInOwnCollisionList,"fn_vTestAllSectorsListForIncoherences: Current sector is in its own Collision list",
 E_uwGameSectorTwiceInCollisionList,"fn_vTestAllSectorsListForIncoherences: Sector is twice in Collision list",
 E_uwGameCurrentSectorInOwnGraphicList,"fn_vTestAllSectorsListForIncoherences: Current sector is in its own Graphic list",
 E_uwGameSectorTwiceInGraphicList,"fn_vTestAllSectorsListForIncoherences: Sector is twice in Graphic list",
 
#endif /* __INFORMATION_ERR_GAME__ */
 
	0xffff,"\0"/*fin*/
}
#endif /* D_GameGlobals */
;
#endif /* __ERROR_STRINGS__ */
 
#ifdef  __cplusplus
}/* extern "C" */
#endif
 
 
#endif /* !__ERRGAME_H_ */
