#ifndef __CG_DECLARATIONS_H__ #define __CG_DECLARATIONS_H__ #include #include #include #define MAX_COMMANDS 8 #define MAX_SOUND_LENGTH 1024 #define MAX_SOUNDS 50 #define MAX_NUMBER_OF_FILES 100 struct stDisplay { unsigned int Width; unsigned int Height; unsigned short Depth; short Mode; short Fullscreen; short Filtermode; short Zoom; unsigned short FrameSkip; // as long as we only have POD stDisplay() { memset(this, 0, sizeof(stDisplay)); } }; struct stDevice { SDL_Joystick *Joystick; SDL_Event Event; }; struct stLevelControl { // level control int command; // used to give a command to playgame_levelmanager() int chglevelto; // parameter to LVLC_CHANGE_LEVEL int tobonuslevel; // if 1 player will warp to bonus level on return to WM (for ep1) // data about current level int curlevel; // number of current level char success; // 1 if level was finished, 0 if he died char isfinallevel; // 1 if this is the final level bool canexit; // true if player is allowed to use the exit door char gameovermode; // 1 if "Game Over" is displayed bool dokeensleft; // 1 if we need to do the "Keens Left" bool dark; // true if level is currently dark (lights are out) int episode; // which episode we're playing (1-3) bool hardmode; bool usedhintmb; // Has the message box been used? int demomode; // array of which levels have been completed (have "Done" tiles over them // on the world map) int levels_completed[MAX_LEVELS+1]; // exitXpos: the X pixel position (not < 0, the screen will shake and it will decrement each frame. // used when you push a switch on a tantalus ray (ep2), and Mortimer's machine int vibratetime; // if 1, then while vibrating the game will be paused char vibratepause; // as long as we only have POD stLevelControl() { memset(this, 0, sizeof(stLevelControl)); } // stuff for custom episode's options struct { char DoorOpenDir; char pShotSpeed; char VortDieDoFade; char vgatiles; char vgasprites; } cepvars; }; struct stControl { bool eseq; // see only the ending sequence bool dtm; // go direct to map. bool storyboard; // go to storyboard bool skipstarting; // Skip Startmenu, Intro and Mainmenu. stLevelControl levelcontrol; stControl() : eseq(false), dtm(false), storyboard(false), skipstarting(false) {} }; struct stGameData { std::string DataDirectory; short Episode; std::string Name; std::string FileList[MAX_NUMBER_OF_FILES]; stGameData() : Episode(0) {} }; typedef struct stResources { unsigned short GameSelected; } stResources; typedef struct stJoyevent { unsigned short button; short axis; } stJoyevent; typedef struct stCommand { char name[10]; char description[80]; Uint8 eventtype; SDL_KeyboardEvent key; SDL_MouseMotionEvent motion; SDL_MouseButtonEvent button; SDL_JoyAxisEvent jaxis; SDL_JoyBallEvent jball; SDL_JoyHatEvent jhat; SDL_JoyButtonEvent jbutton; short state; } stCommand; typedef struct stNewPlayer { stCommand Command; } stNewPlayer; #endif