/*=========================================================================
* Basic.h : Basic engine functions
* 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(__BASIC_H__)
#define __BASIC_H__
 
/******************************************/
#if _MSC_VER >= 1000
#pragma once
#endif /* _MSC_VER >= 1000 */
/******************************************/
#include "Options/Options.h"
#include "GAM/Header.h"
#if defined(__cplusplus)
extern "C"
{
#endif /* __cplusplus */
 
M_BeginDeclareEnumerate(tdeEngineDisplayMode)
 edmDisplayModeAll                  = 0x00000000,
 edmDisplayModeGouraud              = 0x00000001,
 edmDisplayModeTexture              = 0x00000002,
 edmDisplayModeUseStaticLight       = 0x00000003,
 edmDisplayModeUseRLI               = 0x00000004,
 edmDisplayModeWired                = 0x00000005,
 edmDisplayModeChromed              = 0x00000006,
 edmNumberOfDisplayMode,
M_EndDeclareEnumerate(tdeEngineDisplayMode,unsigned long)
 
#if !defined(U64) 
/* for the choice of preferences*/
typedef struct tdstPreferences_
{
	char cAsk;
	char cBinary;
	char cSave;
	char szBinaryDirectory[64];
 
    /* GuS 13/08/98*/
    char cBinaryDsc;    /* Pour les game.dsc, game.mem... binarises.*/
} tdstPreferences;
extern CPA_EXPORT void GAM_fn_vSavePreferences(void);
#endif /* U64 */
 
void fn_vChangeEngineMode(tdeEngineMode eNewMode);
tdeEngineMode fn_eGetEngineMode();
 
extern CPA_EXPORT char *fn_zsGetCharaterFilenameByEngineObject(char *_szFilename,struct tdstEngineObject_ *_stEngineObject,unsigned char _bCommon);
extern CPA_EXPORT char *fn_zsGetCharaterFilenameByTypeName(char *_szFilename,char *_szFamily,char *_szModel,char *_szPersonnal,unsigned char _bCommon);
extern CPA_EXPORT char *fn_zsGetLevelFilename(char *_szFilename,char *_szLevelName,char *_szExtension);
extern CPA_EXPORT char *fn_zsGetActualLevelFilename(char *_szFilename,char *_szExtension);
 
extern CPA_EXPORT unsigned char fn_bIsLevelExist(char *_szLevelName);
 
extern CPA_EXPORT void fn_vSetFirstLevelName(char * _szName);
extern CPA_EXPORT char *fn_p_szGetFirstLevelName(void);
 
extern CPA_EXPORT void fn_vSetLevelName(char * _szName);
extern CPA_EXPORT char *fn_p_szGetLevelName(void);
 
extern CPA_EXPORT void fn_vSetNextLevelName(char * _szName);
extern CPA_EXPORT char *fn_p_szGetNextLevelName(void);
extern CPA_EXPORT void fn_vFreeNextLevelName(void);
extern CPA_EXPORT unsigned char fn_bIsNextLevelNameValid(void);
 
/* ANNECY MT - 08/09/98 {*/
extern CPA_EXPORT long fn_lGetSubMapNumber(void);
/* END ANNECY MT }*/
 
/*extern CPA_EXPORT void fn_vSetNextLevelPositionName(char * _szPersoName,char * _szCameraName);*/
/*extern CPA_EXPORT char *fn_p_szGetNextLevelPositionPersoName(void);*/
/*extern CPA_EXPORT char *fn_p_szGetNextLevelPositionCameraName(void);*/
/*extern CPA_EXPORT void fn_vFreeNextLevelPositionName(void);*/
/*extern CPA_EXPORT unsigned char fn_bIsLevelPositionNameValid(void);*/
 
/*extern CPA_EXPORT void GAM_fn_vSetPlayerName(char * _szName);*/
/*extern CPA_EXPORT char *GAM_fn_p_szGetPlayerName(void);*/
/*extern CPA_EXPORT unsigned char GAM_fn_bIsPlayerNameValid(char *_szName);*/
extern CPA_EXPORT void GAM_fn_vSetSlotName(short _wSlotdId, char *_szSlotName);
extern CPA_EXPORT char *GAM_fn_szGetSlotName(short _wSlotId);
extern CPA_EXPORT unsigned char GAM_fn_bIsSlotNameValid(const char *_szName);
unsigned char GAM_fn_bIsSlotValid(short _wSlotdId);
 
 
 
extern CPA_EXPORT void fn_vRecurseSetDisplayBoudingVolumeFlag(HIE_tdxHandleToSuperObject _hSuperObject,unsigned char _bOnOff);
 
long fn_lAToI(char *szString);
MTH_tdxReal fn_fAToF(char *szString);
void fn_vInitAndRegisterAllScriptSections(void);
 
extern CPA_EXPORT void fn_vSetDisplayFlag(tdeEngineDisplayMode ulFlag,unsigned char ucValue);
extern CPA_EXPORT void fn_vSetGLIDisplayFlag(unsigned long *p_DisplayMode,tdeEngineDisplayMode ulFlag,unsigned char ucValue);
 
extern CPA_EXPORT void fn_vChangeViewPortPercent
(
	unsigned long	_ulMode,
	unsigned long	_ulWhat, 
	unsigned long	_ulWidth,
	unsigned long	_ulHeight,
	unsigned long	_ulClipTop,
	unsigned long	_ulClipLeft, 
	unsigned long	_ulClipBottom, 
	unsigned long	_ulClipRight,
	int				_iPosX,
	int				_iPosY
);
extern CPA_EXPORT void fn_vChangeViewportRatio ( unsigned long ulMode, MTH_tdxReal xRatio) ;
 
extern CPA_EXPORT void GAM_fn_vActualizeAllGameViewportSize(void);
extern CPA_EXPORT void GAM_fn_vCreateGameDeviceAndViewPorts(void);
extern CPA_EXPORT void GAM_fn_vDestroyGameDeviceAndViewPorts(void);
extern CPA_EXPORT void fn_vCreateFixViewPort(GLD_tdhDevice _hDevice);
extern CPA_EXPORT void fn_vDestroyFixViewPort(GLD_tdhDevice _hDevice);
extern CPA_EXPORT void fn_vChangeFixViewPortSize(unsigned long _ulXMin,unsigned long _ulYMin,unsigned long _ulXMax,unsigned long _ulYMax);
extern CPA_EXPORT void fn_vCreateFixCamera(void);
extern CPA_EXPORT void fn_vCreateGameViewPortCamera(void);
extern CPA_EXPORT void fn_vReputGameViewportCamera(void);
extern CPA_EXPORT void GAM_fn_vAskToChangeLevel(char *szNewLevelName, ACP_tdxBool _bAskForAutosave ) ;
/*extern CPA_EXPORT void GAM_fn_vAskToChangeLevelWithPosition(char *szNewLevelName,char *szNewPositionPersoName,char *szNewPositionCameraName);*/
 
extern CPA_EXPORT void GAM_fn_vCreateListOfLevel(void);
 
extern CPA_EXPORT unsigned char GAM_fn_bIsEngineInFixMode(void);
extern CPA_EXPORT unsigned char GAM_fn_bIsEngineInLevelMode(void);
 
extern CPA_EXPORT void GAM_fn_vSetEngineInFixMode(void);
extern CPA_EXPORT void GAM_fn_vSetEngineInLevelMode(void);
 
extern CPA_EXPORT void GAM_fn_vTreatExeParameters(void);
extern CPA_EXPORT void GAM_fn_vReadUbiIniFileForGame(void);
 
#if defined(GAM_VIDEO)
extern CPA_EXPORT char *fn_szGetIntroductionVideoName(void);
extern CPA_EXPORT void fn_vRunTheGameVideo(void);
#endif /* GAM_VIDEO */
 
extern CPA_EXPORT void fn_vSetEngineInPaused(void);
extern CPA_EXPORT void fn_vResetEngineFromPaused(void);
extern CPA_EXPORT unsigned char fn_bIsEngineInPause(void);
 
extern CPA_EXPORT void fn_vSetDisplayFixFlag(enum tdeDisplayFixMode_ _eValue);
 
/* For demo management*/
extern void GAM_fn_vInitDemoTimer();
extern void GAM_fn_vTestDemoTimer();
extern void GAM_fn_vReturnToMenuLevel();
extern void GAM_fn_vLaunchDemoMode();
  
 
#if defined(__cplusplus)
}
#endif /* __cplusplus */
 
#endif /* !__BASIC_H__ */
