Main Page | Alphabetical List | Compound List | File List | Compound Members | File Members

Gamemgr.h

Go to the documentation of this file.
00001 /****************************************************************************************/
00002 /*  GameMgr.h                                                                           */
00003 /*                                                                                      */
00004 /*  Author: John Pollard                                                                */
00005 /*  Description:                                                                        */
00006 /*                                                                                      */
00007 /*  Copyright (c) 1997, 1999, Eclipse Entertainment; All rights reserved.               */
00008 /*                                                                                      */
00009 /*  See the accompanying file LICENSE.TXT for terms on the use of this library.         */
00010 /*  This library is distributed in the hope that it will be useful but WITHOUT          */
00011 /*  ANY WARRANTY OF ANY KIND and without any implied warranty of MERCHANTABILITY        */
00012 /*  or FITNESS FOR ANY PURPOSE.  Refer to LICENSE.TXT for more details.                 */
00013 /*                                                                                      */
00014 /****************************************************************************************/
00015 #ifndef GAMEMGR_H
00016 #define GAMEMGR_H
00017 
00018 #include <Windows.h>
00019 
00020 #include "Genesis.h"
00021 #include "Console.h"
00022 
00023 // Effects
00024 #include "Fx\\Fx.h"
00025 #include "Fx\\Corona.h"
00026 #include "Fx\\Electric.h"
00027 #include "Fx\\DynLight.h"
00028 #include "Fx\\ModelCtl.h"
00029 
00030 #include "VidMode.h"
00031 
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif
00037 
00038 // Upper bounds
00039 #define GAMEMGR_MAX_WORLDS                      1
00040 
00041 #define GAMEMGR_MAX_FILENAME            128
00042 
00043 #define GAMEMGR_MAX_MESH_INDEX          128
00044 #define GAMEMGR_MAX_ACTOR_INDEX         128
00045 #define GAMEMGR_MAX_MOTION_INDEX        128
00046 #define GAMEMGR_MAX_BONE_INDEX          128
00047 #define GAMEMGR_MAX_TEXTURE_INDEX       128
00048 #define GAMEMGR_MAX_SOUND_INDEX         128
00049 
00050 #define GAMEMGR_MAX_MODELS                      256
00051 
00052 #define GAMEMGR_MAX_WORLD_NAME          256
00053 
00054 #define GAMEMGR_MAX_GFX_PATH            64
00055 #define GAMEMGR_MAX_MESH_NAME           64
00056 #define GAMEMGR_MAX_ACTOR_NAME          64
00057 #define GAMEMGR_MAX_MOTION_NAME         32
00058 #define GAMEMGR_MAX_BONE_NAME           32
00059 
00060 //====================================================================================
00061 // The GameMgr typedef
00062 //====================================================================================
00063 typedef struct  GameMgr         GameMgr;
00064 
00065 //====================================================================================
00066 //      Misc defs
00067 //====================================================================================
00068 typedef int32   GameMgr_MotionIndex;
00069 
00070 typedef geBoolean GameMgr_SetWorldCB(GameMgr *GMgr, const char *WorldName, void *Context);
00071 void GameMgr_ResetMainWindow(HWND hWnd, int32 Width, int32 Height);
00072 
00073 typedef enum
00074 {
00075         FrameState_None = 0,
00076         FrameState_Begin
00077 } GameMgr_FrameState;
00078 
00079 //
00080 //      Default presets
00081 //
00082 #define GAMEMGR_MOTION_INDEX_NONE       255
00083 
00084 //====================================================================================
00085 //      Structure defs
00086 //====================================================================================
00087 
00088 // Index data
00089 typedef struct
00090 {
00091         geBoolean               Active;
00092         
00093         char                    FileName[GAMEMGR_MAX_ACTOR_NAME];
00094 
00095         geActor_Def             *ActorDef;
00096         geActor                 *ActorHack;     // Actor is loaded for def, so textures will remain loaded...
00097 } GameMgr_ActorIndex;
00098 
00099 typedef struct
00100 {
00101         geBoolean                       Active;
00102         
00103         char                            FileName[GAMEMGR_MAX_FILENAME];
00104         char                            AFileName[GAMEMGR_MAX_FILENAME];
00105 
00106         geBitmap                        *TextureDef;
00107 
00108 } GameMgr_TextureIndex;
00109 
00110 typedef struct
00111 {
00112         geBoolean               Active;
00113         char                    MotionName[GAMEMGR_MAX_MOTION_NAME];
00114 } GameMgr_MotionIndexDef;
00115 
00116 typedef struct
00117 {
00118         geBoolean               Active;
00119         char                    BoneName[GAMEMGR_MAX_BONE_NAME];
00120 } GameMgr_BoneIndex;
00121 
00122 typedef struct
00123 {
00124         geBoolean               Active;
00125         char                    FileName[GAMEMGR_MAX_FILENAME];
00126         geSound_Def             *SoundDef;
00127 } GameMgr_SoundIndex;
00128 
00129 //====================================================================================
00130 // Function prototypes
00131 //====================================================================================
00132 // Create/Destroy management
00133 GameMgr                         *GameMgr_Create(HINSTANCE hInstance, int32 Width, int32 Height, const char *AppName);
00134 void                            GameMgr_Destroy(GameMgr *GMgr);
00135 
00136 geBoolean                       GameMgr_Frame(GameMgr *GMgr, float Time);
00137 
00138 // Sanity checking
00139 geBoolean                       GameMgr_IsValid(GameMgr *GMgr);
00140 
00141 // Driver management
00142 void                            GameMgr_PrepareToChangeMode(GameMgr *GMgr);
00143 geBoolean                       GameMgr_SetDriverAndMode(GameMgr *GMgr, geDriver *Driver, geDriver_Mode *DriverMode, int Width, int Height);
00144 
00145 // Frame management
00146 geBoolean                       GameMgr_BeginFrame(GameMgr *GMgr, geWorld *World, geBoolean ClearScreen);
00147 geBoolean                       GameMgr_EndFrame(GameMgr *GMgr);
00148 
00149 void                            GameMgr_ConsolePrintf(GameMgr *GMgr, geBoolean DrawNow, const char *Str, ...);
00150 geBoolean                       GameMgr_ClearBackground(GameMgr *GMgr, int32 x, int32 y, const char *Str);
00151 
00152 geBoolean                               GameMgr_FreeWorld(GameMgr *GMgr);
00153 geBoolean                               GameMgr_SetWorld(GameMgr *GMgr, const char *WorldName);
00154 geBoolean                               GameMgr_SetActorIndex(GameMgr *GMgr, int32 Index, const char *FileName);
00155 GameMgr_ActorIndex              *GameMgr_GetActorIndex(GameMgr *GMgr, int32 Index);
00156 geBoolean                               GameMgr_MotionIndexIsValid(GameMgr *GMgr, GameMgr_MotionIndex Index);
00157 geBoolean                               GameMgr_SetMotionIndexDef(GameMgr *GMgr, GameMgr_MotionIndex MotionIndex, const char *MotionName);
00158 GameMgr_MotionIndexDef  *GameMgr_GetMotionIndexDef(GameMgr *GMgr, GameMgr_MotionIndex Index);
00159 geBoolean                               GameMgr_SetBoneIndex(GameMgr *GMgr, int32 BoneIndex, const char *BoneName);
00160 GameMgr_BoneIndex               *GameMgr_GetBoneIndex(GameMgr *GMgr, int32 Index);
00161 geBoolean                               GameMgr_SetTextureIndex(GameMgr *GMgr, int32 Index, const char *FileName, const char *AFileName);
00162 GameMgr_TextureIndex    *GameMgr_GetTextureIndex(GameMgr *GMgr, int32 Index);
00163 geBoolean                               GameMgr_SetSoundIndex(GameMgr *GMgr, int32 SoundIndex, const char *FileName);
00164 GameMgr_SoundIndex              *GameMgr_GetSoundIndex(GameMgr *GMgr, int32 Index);
00165 
00166 // Accessor functions
00167 geEngine                        *GameMgr_GetEngine(GameMgr *GMgr);
00168 geSound_System          *GameMgr_GetSoundSystem(GameMgr *GMgr);
00169 Console_Console         *GameMgr_GetConsole(GameMgr *GMgr);
00170 geWorld                         *GameMgr_GetWorld(GameMgr *GMgr);
00171 geCamera                        *GameMgr_GetCamera(GameMgr *GMgr);
00172 GameMgr_FrameState      GameMgr_GetFrameState(GameMgr *GMgr);
00173 int32                           GameMgr_GetNumModels(GameMgr *GMgr);
00174 geWorld_Model           *GameMgr_GetModel(GameMgr *GMgr, int32 Index);
00175 Fx_System                       *GameMgr_GetFxSystem(GameMgr *GMgr);
00176 geBitmap                        *GameMgr_GetShadowMap(GameMgr *GMgr);
00177 float                           GameMgr_GetTime(GameMgr *GMgr);
00178 HWND                            GameMgr_GethWnd(GameMgr *GMgr);
00179 VidMode                         GameMgr_GetVidMode(GameMgr *GMgr);
00180 
00181 #ifdef __cplusplus
00182 }
00183 #endif
00184 
00185 #endif

Generated on Tue Sep 30 12:35:46 2003 for GTestAndEngine by doxygen 1.3.2