Browse Source

MD3 stuff builds without errors

Thomas Buck 10 years ago
parent
commit
cc3657f4b8
6 changed files with 38 additions and 39 deletions
  1. 1
    1
      src/Md3.cpp
  2. 2
    2
      src/Md3AnimModel.cpp
  3. 33
    33
      src/Md3AnimModel.h
  4. 1
    1
      src/Render.cpp
  5. 1
    0
      src/SDLSystem.cpp
  6. 0
    2
      src/System.cpp

+ 1
- 1
src/Md3.cpp View File

@@ -567,7 +567,7 @@ int Md3::load(char *filename)
567 567
 				unsigned char lat, lng;
568 568
 
569 569
 
570
-				normal = (unsigned short)m_meshes[i].vertex[j].st;
570
+				normal = *((unsigned short *)m_meshes[i].vertex[j].st);
571 571
 				lat = (unsigned char)((normal & 255) * (2 * M_PI) / 255.0);
572 572
 				lng = (unsigned char)(((normal >> 8) & 255) * (2 * M_PI) / 255.0);
573 573
 

+ 2
- 2
src/Md3AnimModel.cpp View File

@@ -315,7 +315,7 @@ int Md3AnimModel::load(char *modelPath, char *skin, md3_lod_t modelLoD)
315 315
 }
316 316
 
317 317
 
318
-int Md3AnimModel::loadWeapon(char *modelPath, char *name)
318
+int Md3AnimModel::loadWeapon(char *modelPath, const char *name)
319 319
 {
320 320
 	int err = 0;
321 321
 
@@ -857,7 +857,7 @@ int Md3AnimModel::addAnim(char *modelPath, md3_animation_id_t id,
857 857
 }
858 858
 
859 859
 
860
-int Md3AnimModel::loadMd3(Md3 &model, char *base, char *modelPath, char *skin,
860
+int Md3AnimModel::loadMd3(Md3 &model, const char *base, char *modelPath, char *skin,
861 861
 								  md3_lod_t modelLoD)
862 862
 {
863 863
 	char filename[256];

+ 33
- 33
src/Md3AnimModel.h View File

@@ -1,6 +1,6 @@
1 1
 /* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2 2
 /*================================================================
3
- * 
3
+ *
4 4
  * Project : Freyja
5 5
  * Author  : Terry 'Mongoose' Hendrix II
6 6
  * Website : http://www.westga.edu/~stu7440/
@@ -10,13 +10,13 @@
10 10
  * Comments: Md3 animation model class
11 11
  *
12 12
  *
13
- *           This file was generated using Mongoose's C++ 
13
+ *           This file was generated using Mongoose's C++
14 14
  *           template generator script.  <stu7440@westga.edu>
15 15
  *
16 16
  *
17 17
  *-- Test Defines -----------------------------------------------
18
- *           
19
- * UNIT_TEST_MD3 - Builds Md3 class as a console unit test 
18
+ *
19
+ * UNIT_TEST_MD3 - Builds Md3 class as a console unit test
20 20
  *
21 21
  *-- History ----------------------------------------------------
22 22
  *
@@ -47,7 +47,7 @@ typedef enum
47 47
 
48 48
 } md3_sex_t;
49 49
 
50
-typedef enum 
50
+typedef enum
51 51
 {
52 52
 	UNSUPPORTED = -1,
53 53
 	BOTH_DEATH1 = 0,		// The first twirling death animation
@@ -56,7 +56,7 @@ typedef enum
56 56
 	BOTH_DEAD2,				// The end of the second twirling death animation
57 57
 	BOTH_DEATH3,			// The back flip death animation
58 58
 	BOTH_DEAD3,				// The end of the back flip death animation
59
-	TORSO_GESTURE,			// The torso's gesturing animation	
59
+	TORSO_GESTURE,			// The torso's gesturing animation
60 60
 	TORSO_ATTACK,			// The torso's attack1 animation
61 61
 	TORSO_ATTACK2,			// The torso's attack2 animation
62 62
 	TORSO_DROP,				// The torso's weapon drop animation
@@ -122,7 +122,7 @@ class Md3AnimModel
122 122
 
123 123
 	Md3AnimModel();
124 124
 	/*------------------------------------------------------
125
-	 * Pre  : 
125
+	 * Pre  :
126 126
 	 * Post : Md3AnimModel object is deconstructed
127 127
 	 *
128 128
 	 *-- History ------------------------------------------
@@ -149,7 +149,7 @@ class Md3AnimModel
149 149
 
150 150
 	unsigned int getFlags();
151 151
 	/*------------------------------------------------------
152
-	 * Pre  : 
152
+	 * Pre  :
153 153
 	 * Post : Gets option flags
154 154
 	 *
155 155
 	 *-- History ------------------------------------------
@@ -160,7 +160,7 @@ class Md3AnimModel
160 160
 
161 161
 	md3_animation_id_t getAnimUpper();
162 162
 	/*------------------------------------------------------
163
-	 * Pre  : 
163
+	 * Pre  :
164 164
 	 * Post : Get animation for upper model
165 165
 	 *
166 166
 	 *-- History ------------------------------------------
@@ -171,7 +171,7 @@ class Md3AnimModel
171 171
 
172 172
 	md3_animation_id_t getAnimLower();
173 173
 	/*------------------------------------------------------
174
-	 * Pre  : 
174
+	 * Pre  :
175 175
 	 * Post : Get animation for lower model
176 176
 	 *
177 177
 	 *-- History ------------------------------------------
@@ -187,7 +187,7 @@ class Md3AnimModel
187 187
 
188 188
 	void setFlag(Md3AnimModelFlags flag);
189 189
 	/*------------------------------------------------------
190
-	 * Pre  : 
190
+	 * Pre  :
191 191
 	 * Post : Sets option flag
192 192
 	 *
193 193
 	 *-- History ------------------------------------------
@@ -198,7 +198,7 @@ class Md3AnimModel
198 198
 
199 199
 	void toggleFlag(Md3AnimModelFlags flag);
200 200
 	/*------------------------------------------------------
201
-	 * Pre  : 
201
+	 * Pre  :
202 202
 	 * Post : Clear/Set option flag
203 203
 	 *
204 204
 	 *-- History ------------------------------------------
@@ -209,7 +209,7 @@ class Md3AnimModel
209 209
 
210 210
 	void setAnimUpper(md3_animation_id_t anim);
211 211
 	/*------------------------------------------------------
212
-	 * Pre  : 
212
+	 * Pre  :
213 213
 	 * Post : Animation is set for upper model
214 214
 	 *
215 215
 	 *-- History ------------------------------------------
@@ -220,7 +220,7 @@ class Md3AnimModel
220 220
 
221 221
 	void setAnimLower(md3_animation_id_t anim);
222 222
 	/*------------------------------------------------------
223
-	 * Pre  : 
223
+	 * Pre  :
224 224
 	 * Post : Animation is set for lower model
225 225
 	 *
226 226
 	 *-- History ------------------------------------------
@@ -231,7 +231,7 @@ class Md3AnimModel
231 231
 
232 232
 	void setDebug(unsigned char level);
233 233
 	/*------------------------------------------------------
234
-	 * Pre  : 
234
+	 * Pre  :
235 235
 	 * Post : level 0 = errors, 1 = warnings, 2 = debug1
236 236
 	 *
237 237
 	 *-- History ------------------------------------------
@@ -250,7 +250,7 @@ class Md3AnimModel
250 250
 	 *
251 251
 	 *           eg 'default' or 'red' or 'blue' etc
252 252
 	 *
253
-	 *        modelLoD - Level of detail to use, 
253
+	 *        modelLoD - Level of detail to use,
254 254
 	 *
255 255
 	 * Post : Error code is returned, 0 no error
256 256
 	 *        Md3s are read into memory
@@ -258,9 +258,9 @@ class Md3AnimModel
258 258
 	 *-- History ------------------------------------------
259 259
 	 *
260 260
 	 *
261
-	 * 2002.12.29: 
261
+	 * 2002.12.29:
262 262
 	 * Mongoose - Progressively loads lower LoDs if it can't
263
-	 *            find passed LoD 
263
+	 *            find passed LoD
264 264
 	 *
265 265
 	 * 2002.06.19:
266 266
 	 * Mongoose - Created
@@ -268,7 +268,7 @@ class Md3AnimModel
268 268
 
269 269
 	int loadAnimations(char *modelPath);
270 270
 	/*------------------------------------------------------
271
-	 * Pre  : 
271
+	 * Pre  :
272 272
 	 * Post : Loads animations for composite model
273 273
 	 *
274 274
 	 *-- History ------------------------------------------
@@ -277,9 +277,9 @@ class Md3AnimModel
277 277
 	 * Mongoose - Created
278 278
 	 ------------------------------------------------------*/
279 279
 
280
-	int loadWeapon(char *modelPath, char *name);
280
+	int loadWeapon(char *modelPath, const char *name);
281 281
 	/*------------------------------------------------------
282
-	 * Pre  : 
282
+	 * Pre  :
283 283
 	 * Post : Loads a weapon model
284 284
 	 *
285 285
 	 *-- History ------------------------------------------
@@ -340,7 +340,7 @@ private:
340 340
 
341 341
 	void setCurrentTime(Md3 &model);
342 342
 	/*------------------------------------------------------
343
-	 * Pre  : 
343
+	 * Pre  :
344 344
 	 * Post : time is set for model animation
345 345
 	 *
346 346
 	 *-- History ------------------------------------------
@@ -351,7 +351,7 @@ private:
351 351
 
352 352
 	void updateModel(Md3 &model);
353 353
 	/*------------------------------------------------------
354
-	 * Pre  : 
354
+	 * Pre  :
355 355
 	 * Post : Sets up md3 for next render pass
356 356
 	 *
357 357
 	 *-- History ------------------------------------------
@@ -362,7 +362,7 @@ private:
362 362
 
363 363
 	void initMd3(Md3 &model, unsigned int id);
364 364
 	/*------------------------------------------------------
365
-	 * Pre  : 
365
+	 * Pre  :
366 366
 	 * Post : Sets up md3 init animation values
367 367
 	 *
368 368
 	 *-- History ------------------------------------------
@@ -371,11 +371,11 @@ private:
371 371
 	 * Mongoose - Created, obsoletes old anim arrays
372 372
 	 ------------------------------------------------------*/
373 373
 
374
-	int addAnim(char *modelPath, md3_animation_id_t id, 
375
-					unsigned int firstFrame, unsigned int numFrames, 
374
+	int addAnim(char *modelPath, md3_animation_id_t id,
375
+					unsigned int firstFrame, unsigned int numFrames,
376 376
 					unsigned int loopingFrames, unsigned int framesPerSecond);
377 377
 	/*------------------------------------------------------
378
-	 * Pre  : 
378
+	 * Pre  :
379 379
 	 * Post : Sets up animation array
380 380
 	 *
381 381
 	 *-- History ------------------------------------------
@@ -384,10 +384,10 @@ private:
384 384
 	 * Mongoose - Created, forked off load()
385 385
 	 ------------------------------------------------------*/
386 386
 
387
-	int loadMd3(Md3 &model, char *base, char *modelPath, char *skin, 
387
+	int loadMd3(Md3 &model, const char *base, char *modelPath, char *skin,
388 388
 					md3_lod_t modelLoD);
389 389
 	/*------------------------------------------------------
390
-	 * Pre  : 
390
+	 * Pre  :
391 391
 	 * Post : Loads model and if given skin
392 392
 	 *
393 393
 	 *-- History ------------------------------------------
@@ -398,7 +398,7 @@ private:
398 398
 
399 399
 	int loadSkin(Md3 &model, char *filename);
400 400
 	/*------------------------------------------------------
401
-	 * Pre  : 
401
+	 * Pre  :
402 402
 	 * Post : Loads skin for model
403 403
 	 *
404 404
 	 *-- History ------------------------------------------
@@ -409,7 +409,7 @@ private:
409 409
 
410 410
 	int loadShader(Md3 &model, char *filename);
411 411
 	/*------------------------------------------------------
412
-	 * Pre  : 
412
+	 * Pre  :
413 413
 	 * Post : Loads shader for model
414 414
 	 *
415 415
 	 *-- History ------------------------------------------
@@ -420,7 +420,7 @@ private:
420 420
 
421 421
 	void connectModels(char *tagName, Md3 &modelA, Md3 &modelB);
422 422
 	/*------------------------------------------------------
423
-	 * Pre  : 
423
+	 * Pre  :
424 424
 	 * Post : Connects models as A slave to B master
425 425
 	 *
426 426
 	 *-- History ------------------------------------------
@@ -431,7 +431,7 @@ private:
431 431
 
432 432
 	int cacheTexture(char *texture);
433 433
 	/*------------------------------------------------------
434
-	 * Pre  : 
434
+	 * Pre  :
435 435
 	 * Post : Sets up texture filename caching
436 436
 	 *
437 437
 	 *-- History ------------------------------------------

+ 1
- 1
src/Render.cpp View File

@@ -372,7 +372,7 @@ void Render::loadMd3(char *model, char *skin)
372 372
 		{
373 373
 			snprintf(filename, 255, "data/%s", gMd3.texTest[i].name);
374 374
 
375
-			gMd3.texTest[i].gl_texture_id = mTexture.loadTGA(filename, true);
375
+			gMd3.texTest[i].gl_texture_id = mTexture.loadTGA(filename);
376 376
 
377 377
 			if (gMd3.texTest[i].gl_texture_id < 0)
378 378
 			{

+ 1
- 0
src/SDLSystem.cpp View File

@@ -131,6 +131,7 @@ SDLSystem::SDLSystem() : System()
131 131
 	gWidth = &m_width;
132 132
 	gHeight = &m_height;
133 133
     mFirstMouseEvent = false;
134
+    mFullscreen = false;
134 135
 }
135 136
 
136 137
 

+ 0
- 2
src/System.cpp View File

@@ -65,8 +65,6 @@ System::System()
65 65
 
66 66
 	mConsoleMode = false;
67 67
 
68
-    mFullscreen = false;
69
-
70 68
 	printf("[System.Core]\n");
71 69
 
72 70
 	// Hack for bad Map class, as well as reserved commands

Loading…
Cancel
Save