|
@@ -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 ------------------------------------------
|