+class Game
+{
+ public:
+ GLuint terraintexture;
+ GLuint terraintexture2;
+ GLuint terraintexture3;
+ GLuint screentexture;
+ GLuint screentexture2;
+ GLuint logotexture;
+ GLuint loadscreentexture;
+ GLuint Maparrowtexture;
+ GLuint Mapboxtexture;
+ GLuint Mapcircletexture;
+ GLuint cursortexture;
+ GLuint Mainmenuitems[10];
+
+ int selected;
+ int keyselect;
+ int indemo;
+
+ bool won;
+
+ bool entername;
+
+ char menustring[100][256];
+ char registrationname[256];
+ float registrationnumber;
+
+ int newdetail;
+ int newscreenwidth;
+ int newscreenheight;
+
+ bool gameon;
+ float deltah,deltav;
+ int mousecoordh,mousecoordv;
+ int oldmousecoordh,oldmousecoordv;
+ float rotation,rotation2;
+ SkyBox skybox;
+ bool cameramode;
+ int olddrawmode;
+ int drawmode;
+ bool firstload;
+ bool oldbutton;
+
+ float leveltime;
+ float loadtime;
+
+ Model hawk;
+ XYZ hawkcoords;
+ XYZ realhawkcoords;
+ GLuint hawktexture;
+ float hawkrotation;
+ float hawkcalldelay;
+
+ Model eye;
+ Model iris;
+ Model cornea;
+
+ bool stealthloading;
+
+ std::vector<CampaignLevel> campaignlevels;
+ int whichchoice;
+ int actuallevel;
+ bool winhotspot;
+ bool windialogue;
+
+ bool minimap;
+
+ int musictype,oldmusictype,oldoldmusictype;
+ bool realthreat;
+
+ Model rabbit;
+ XYZ rabbitcoords;
+
+ XYZ mapcenter;
+ float mapradius;
+
+ Text text;
+ float fps;
+
+ XYZ cameraloc;
+ float cameradist;
+
+ int drawtoggle;
+
+ bool editorenabled;
+ int editortype;
+ float editorsize;
+ float editorrotation;
+ float editorrotation2;
+
+ float brightness;
+
+ int quit;
+ int tryquit;
+
+ XYZ pathpoint[30];
+ int numpathpoints;
+ int numpathpointconnect[30];
+ int pathpointconnect[30][30];
+ int pathpointselected;
+
+ int endgame;
+ bool scoreadded;
+ int numchallengelevels;
+
+ bool console;
+ int archiveselected;
+ char consoletext[15][256];
+ int consolechars[15];
+ bool chatting;
+ char displaytext[15][256];
+ int displaychars[15];
+ float displaytime[15];
+ float displayblinkdelay;
+ bool displayblink;
+ int displayselected;
+ bool consolekeydown;
+ float consoleblinkdelay;
+ bool consoleblink;
+ int consoleselected;
+ bool autocam;
+
+ unsigned short crouchkey,jumpkey,forwardkey,chatkey,backkey,leftkey,rightkey,drawkey,throwkey,attackkey;
+ unsigned short consolekey;
+ bool oldattackkey;
+
+ static void LoadTexture(const string fileName, GLuint *textureid,int mipmap, bool hasalpha);
+ static void LoadTextureSave(const string fileName, GLuint *textureid,int mipmap,GLubyte *array, int *skinsize);
+ void LoadSave(const char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize);
+ bool AddClothes(const char *fileName, GLubyte *array);
+ void InitGame();
+ void LoadScreenTexture();
+ void LoadStuff();
+ void LoadingScreen();
+ void LoadCampaign();
+ static std::vector<std::string> ListCampaigns();
+ void FadeLoadingScreen(float howmuch);
+ void Dispose();
+ int DrawGLScene(StereoSide side);
+ void DrawMenu();
+ void DrawGL();
+ //factored from Tick() -sf17k
+ void MenuTick();
+ void doTutorial();
+ void doDebugKeys();
+ void doJumpReversals();
+ void doAerialAcrobatics();
+ void doAttacks();
+ void doPlayerCollisions();
+ void doAI(int i);
+ //end factored
+ void Tick();
+ void TickOnce();
+ void TickOnceAfter();
+ void SetUpLighting();
+ void Loadlevel(int which);
+ void Loadlevel(const char *name);
+ void Setenvironment(int which);
+ GLvoid ReSizeGLScene(float fov, float near);
+ int findPathDist(int start,int end);
+ int checkcollide(XYZ startpoint, XYZ endpoint);
+ int checkcollide(XYZ startpoint, XYZ endpoint, int what);
+ int loading;
+ float talkdelay;
+
+ void fireSound(int sound=fireendsound);
+ void setKeySelected();
+
+ int numboundaries;
+ XYZ boundary[360];
+
+ int whichlevel;
+ int oldenvironment;
+ int targetlevel;
+ float changedelay;
+
+ float musicvolume[4];
+ float oldmusicvolume[4];
+ int musicselected;
+ int change;
+ Game();
+ ~Game() {
+ for(int i=0;i<10;i++){
+ if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] );
+ }
+ glDeleteTextures( 1, &cursortexture );
+ glDeleteTextures( 1, &Maparrowtexture );
+ glDeleteTextures( 1, &Mapboxtexture );
+ glDeleteTextures( 1, &Mapcircletexture );
+ glDeleteTextures( 1, &terraintexture );
+ glDeleteTextures( 1, &terraintexture2 );
+ if(screentexture>0)glDeleteTextures( 1, &screentexture );
+ if(screentexture2>0)glDeleteTextures( 1, &screentexture2 );
+ glDeleteTextures( 1, &hawktexture );
+ glDeleteTextures( 1, &logotexture );
+ glDeleteTextures( 1, &loadscreentexture );
+
+ Dispose();
+ }
+ bool isWaiting() { return waiting; };
+ private:
+ void setKeySelected_thread();
+ static int thread(void *data);
+ void inputText(char* str, int* charselected, int* nb_chars);
+ void flash();
+ bool waiting;
+ //int mainmenu;
+ Account* accountactive;