8 //Jordan included glut.h
11 #include "TGALoader.h"
23 #include "Constants.h"
29 //#include <DrawSprocket.h>
35 extern GLuint rabbittexture;
42 typedef std::map<std::string, GLuint> TextureList;
43 typedef std::map<GLuint, std::string> GLTextureList;
44 typedef TextureList::iterator TexIter;
45 static TextureList textures;
47 GLuint terraintexture;
48 GLuint terraintexture2;
49 GLuint terraintexture3;
51 GLuint screentexture2;
53 GLuint loadscreentexture;
54 GLuint Maparrowtexture;
56 GLuint Mapcircletexture;
58 GLuint Mainmenuitems[10];
65 float selectedlong[100];
82 char menustring[100][256];
83 char registrationname[256];
84 float registrationnumber;
92 int mousecoordh,mousecoordv;
93 int oldmousecoordh,oldmousecoordv;
94 float rotation,rotation2;
97 bool cameratogglekeydown;
98 bool chattogglekeydown;
101 bool drawmodetogglekeydown;
102 bool explodetogglekeydown;
103 bool detailtogglekeydown;
123 int campaignnumlevels;
124 char campaignmapname[50][256];
125 char campaigndescription[50][256];
126 int campaignchoosenext[50];
127 int campaignnumnext[50];
128 int campaignnextlevel[50][10];
129 int campaignchoicesmade;
130 int campaignchoices[5000];
131 int campaignlocationx[50];
132 int campaignlocationy[50];
133 int campaignchoicenum;
134 int campaignchoicewhich[10];
138 int levelorder[5000];
139 int levelvisible[50];
140 int levelhighlight[50];
144 int musictype,oldmusictype,oldoldmusictype;
159 bool envtogglekeydown;
160 bool slomotogglekeydown;
161 bool texturesizetogglekeydown;
162 bool freezetogglekeydown;
168 float editorrotation;
169 float editorrotation2;
178 int numpathpointconnect[30];
179 int pathpointconnect[30][30];
180 int pathpointselected;
184 int numchallengelevels;
188 char consoletext[15][256];
189 int consolechars[15];
191 char displaytext[15][256];
192 int displaychars[15];
193 float displaytime[15];
194 float displayblinkdelay;
198 bool consoletogglekeydown;
199 float consoleblinkdelay;
203 float togglekeydelay[140];
207 unsigned short crouchkey,jumpkey,forwardkey,chatkey,backkey,leftkey,rightkey,drawkey,throwkey,attackkey;
210 long long MD5_string (char *string);
211 static void LoadTexture(char *fileName, GLuint *textureid,int mipmap, bool hasalpha);
212 static void LoadTextureSave(char *fileName, GLuint *textureid,int mipmap,GLubyte *array, int *skinsize);
213 void LoadSave(char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize);
214 bool AddClothes(char *fileName, GLuint *textureid,bool mipmap,GLubyte *array, int *skinsize);
217 void LoadingScreen();
218 void FadeLoadingScreen(float howmuch);
220 int DrawGLScene(GLvoid);
223 void TickOnceAfter();
224 void SetUpLighting();
225 void Loadlevel(int which);
226 void Loadlevel(char *name);
228 void Setenvironment(int which);
229 GLvoid ReSizeGLScene(float fov, float near);
230 int findPathDist(int start,int end);
231 int checkcollide(XYZ startpoint, XYZ endpoint);
232 int checkcollide(XYZ startpoint, XYZ endpoint, int what);
244 float musicvolume[4];
245 float oldmusicvolume[4];
250 for(int i=0;i<10;i++){
251 if(Mainmenuitems[i])glDeleteTextures( 1, (const unsigned long *)&Mainmenuitems[i] );
253 glDeleteTextures( 1, (const unsigned long *)&cursortexture );
254 glDeleteTextures( 1, (const unsigned long *)&Maparrowtexture );
255 glDeleteTextures( 1, (const unsigned long *)&Mapboxtexture );
256 glDeleteTextures( 1, (const unsigned long *)&Mapcircletexture );
257 glDeleteTextures( 1, (const unsigned long *)&terraintexture );
258 glDeleteTextures( 1, (const unsigned long *)&terraintexture2 );
259 if(screentexture>0)glDeleteTextures( 1, (const unsigned long *)&screentexture );
260 if(screentexture2>0)glDeleteTextures( 1, (const unsigned long *)&screentexture2 );
261 glDeleteTextures( 1, (const unsigned long *)&hawktexture );
262 glDeleteTextures( 1, (const unsigned long *)&logotexture );
263 glDeleteTextures( 1, (const unsigned long *)&loadscreentexture );