9 //Jordan included glut.h
12 #include "TGALoader.h"
27 #include "Constants.h"
33 //#include <DrawSprocket.h>
39 extern GLuint rabbittexture;
46 typedef std::map<std::string, GLuint> TextureList;
47 typedef std::map<GLuint, std::string> GLTextureList;
48 typedef TextureList::iterator TexIter;
49 static TextureList textures;
51 GLuint terraintexture;
52 GLuint terraintexture2;
53 GLuint terraintexture3;
55 GLuint screentexture2;
57 GLuint loadscreentexture;
58 GLuint Maparrowtexture;
60 GLuint Mapcircletexture;
62 GLuint Mainmenuitems[10];
69 float selectedlong[100];
86 char menustring[100][256];
87 char registrationname[256];
88 float registrationnumber;
96 int mousecoordh,mousecoordv;
97 int oldmousecoordh,oldmousecoordv;
98 float rotation,rotation2;
101 bool cameratogglekeydown;
102 bool chattogglekeydown;
105 bool drawmodetogglekeydown;
106 bool explodetogglekeydown;
107 bool detailtogglekeydown;
127 int campaignnumlevels;
128 char campaignmapname[50][256];
129 char campaigndescription[50][256];
130 int campaignchoosenext[50];
131 int campaignnumnext[50];
132 int campaignnextlevel[50][10];
133 int campaignchoicesmade;
134 int campaignchoices[5000];
135 int campaignlocationx[50];
136 int campaignlocationy[50];
137 int campaignchoicenum;
138 int campaignchoicewhich[10];
142 int levelorder[5000];
143 int levelvisible[50];
144 int levelhighlight[50];
148 int musictype,oldmusictype,oldoldmusictype;
163 bool envtogglekeydown;
164 bool slomotogglekeydown;
165 bool texturesizetogglekeydown;
166 bool freezetogglekeydown;
172 float editorrotation;
173 float editorrotation2;
182 int numpathpointconnect[30];
183 int pathpointconnect[30][30];
184 int pathpointselected;
188 int numchallengelevels;
192 char consoletext[15][256];
193 int consolechars[15];
195 char displaytext[15][256];
196 int displaychars[15];
197 float displaytime[15];
198 float displayblinkdelay;
202 bool consoletogglekeydown;
203 float consoleblinkdelay;
207 float togglekeydelay[140];
211 unsigned short crouchkey,jumpkey,forwardkey,chatkey,backkey,leftkey,rightkey,drawkey,throwkey,attackkey;
214 long long MD5_string (char *string);
215 static void LoadTexture(char *fileName, GLuint *textureid,int mipmap, bool hasalpha);
216 static void LoadTextureSave(char *fileName, GLuint *textureid,int mipmap,GLubyte *array, int *skinsize);
217 void LoadSave(char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize);
218 bool AddClothes(char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize);
221 void LoadingScreen();
222 void FadeLoadingScreen(float howmuch);
224 int DrawGLScene(GLvoid);
227 void TickOnceAfter();
228 void SetUpLighting();
229 void Loadlevel(int which);
230 void Loadlevel(char *name);
232 void Setenvironment(int which);
233 GLvoid ReSizeGLScene(float fov, float near);
234 int findPathDist(int start,int end);
235 int checkcollide(XYZ startpoint, XYZ endpoint);
236 int checkcollide(XYZ startpoint, XYZ endpoint, int what);
248 float musicvolume[4];
249 float oldmusicvolume[4];
254 for(int i=0;i<10;i++){
255 if(Mainmenuitems[i])glDeleteTextures( 1, &Mainmenuitems[i] );
257 glDeleteTextures( 1, &cursortexture );
258 glDeleteTextures( 1, &Maparrowtexture );
259 glDeleteTextures( 1, &Mapboxtexture );
260 glDeleteTextures( 1, &Mapcircletexture );
261 glDeleteTextures( 1, &terraintexture );
262 glDeleteTextures( 1, &terraintexture2 );
263 if(screentexture>0)glDeleteTextures( 1, &screentexture );
264 if(screentexture2>0)glDeleteTextures( 1, &screentexture2 );
265 glDeleteTextures( 1, &hawktexture );
266 glDeleteTextures( 1, &logotexture );
267 glDeleteTextures( 1, &loadscreentexture );