Browse Source

Documented World.h

Thomas Buck 10 years ago
parent
commit
bb20513f44
3 changed files with 175 additions and 376 deletions
  1. 3
    3
      include/Texture.h
  2. 167
    354
      include/World.h
  3. 5
    19
      src/World.cpp

+ 3
- 3
include/Texture.h View File

100
      * \param textureWidth width of texture, height will match it
100
      * \param textureWidth width of texture, height will match it
101
      * \param color RGB 24bit color
101
      * \param color RGB 24bit color
102
      * \param utf8Offset Offset into fonts encoding chart
102
      * \param utf8Offset Offset into fonts encoding chart
103
-     * \param cound number of glyphs to read from offset start
104
-     * \param verboxe dumps debug info to stdout
103
+     * \param count number of glyphs to read from offset start
104
+     * \param verbose dumps debug info to stdout
105
      * \returns font texture. Load it with loadFont()!
105
      * \returns font texture. Load it with loadFont()!
106
      */
106
      */
107
     ttf_texture_t *generateFontTexture(const char *filename, int pointSize,
107
     ttf_texture_t *generateFontTexture(const char *filename, int pointSize,
195
      * \brief Loads a TTF, generates texture image, glyph list and drawlist
195
      * \brief Loads a TTF, generates texture image, glyph list and drawlist
196
      * \param filename Filename of TTF font
196
      * \param filename Filename of TTF font
197
      * \param utf8Offset Offset into Unicode table
197
      * \param utf8Offset Offset into Unicode table
198
-     * \param cound number of glyphs to load
198
+     * \param count number of glyphs to load
199
      * \returns font id if successful, or < 0 on error
199
      * \returns font id if successful, or < 0 on error
200
      */
200
      */
201
     int loadFontTTF(const char *filename,
201
     int loadFontTTF(const char *filename,

+ 167
- 354
include/World.h View File

1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
1
+/*!
2
+ * \file include/World.h
3
+ * \brief The game world (model)
3
  *
4
  *
4
- * Project : OpenRaider
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : World
9
- * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: The game world ( model )
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++
14
- *           template generator script.  <stu7440@westga.edu>
15
- *
16
- *-- History ------------------------------------------------
17
- *
18
- * 2002.12.16:
19
- * Mongoose - Created
20
- ================================================================*/
21
-
5
+ * \author Mongoose
6
+ */
22
 
7
 
23
 #ifndef _WORLD_H_
8
 #ifndef _WORLD_H_
24
 #define _WORLD_H_
9
 #define _WORLD_H_
25
 
10
 
26
-#define BAD_BLOOD  // For temp rendering use
11
+#define BAD_BLOOD  //!< \todo For temp rendering use
27
 
12
 
28
 #ifdef BAD_BLOOD
13
 #ifdef BAD_BLOOD
29
 #include <SkeletalModel.h>
14
 #include <SkeletalModel.h>
33
 #include <Vector.h>
18
 #include <Vector.h>
34
 #include <MatMath.h>
19
 #include <MatMath.h>
35
 
20
 
36
-
37
 // Mirrors TombRaider class' room flags really
21
 // Mirrors TombRaider class' room flags really
38
-typedef enum
39
-{
22
+typedef enum {
40
     roomFlag_underWater    = 0x0001
23
     roomFlag_underWater    = 0x0001
41
-
42
 } room_flags_t;
24
 } room_flags_t;
43
 
25
 
44
-typedef enum
45
-{
26
+typedef enum {
46
     worldMoveType_walkNoSwim   = -1,
27
     worldMoveType_walkNoSwim   = -1,
47
     worldMoveType_walk         = 0,
28
     worldMoveType_walk         = 0,
48
     worldMoveType_noClipping   = 1,
29
     worldMoveType_noClipping   = 1,
49
     worldMoveType_fly          = 2,
30
     worldMoveType_fly          = 2,
50
     worldMoveType_swim         = 3
31
     worldMoveType_swim         = 3
51
-
52
 } worldMoveType;
32
 } worldMoveType;
53
 
33
 
54
-
55
-typedef struct vertex_s
56
-{
34
+typedef struct {
57
     vec3_t pos;
35
     vec3_t pos;
58
-
59
 } vertex_t;
36
 } vertex_t;
60
 
37
 
61
-
62
-typedef struct uv_s
63
-{
38
+/*
39
+typedef struct {
64
     vec2_t uv;
40
     vec2_t uv;
65
-
66
 } uv_t;
41
 } uv_t;
67
 
42
 
68
-typedef struct texel_s
69
-{
70
-    vec2_t st;
71
-
72
-} texel_t;
73
-
74
-
75
-typedef struct color_s
76
-{
43
+typedef struct {
77
     vec4_t rgba;
44
     vec4_t rgba;
78
-
79
 } color_t;
45
 } color_t;
46
+*/
80
 
47
 
48
+typedef struct {
49
+    vec2_t st;
50
+} texel_t;
81
 
51
 
82
-typedef struct sprite_s
83
-{
84
-    int num_verts; // 4 == Quad, 3 == Triangle, rendered as triangles
52
+typedef struct {
53
+    int num_verts;      //!< 4 == Quad, 3 == Triangle, rendered as triangles
85
     vertex_t vertex[4];
54
     vertex_t vertex[4];
86
     texel_t texel[4];
55
     texel_t texel[4];
87
     float pos[3];
56
     float pos[3];
88
-    float radius; // yeah, I know
57
+    float radius;       //!< \fixme yeah, I know
89
     int texture;
58
     int texture;
90
-
91
 } sprite_t;
59
 } sprite_t;
92
 
60
 
93
-
94
-typedef struct sprite_seq_s
95
-{
61
+typedef struct {
96
     int num_sprites;
62
     int num_sprites;
97
     sprite_t *sprite;
63
     sprite_t *sprite;
98
-
99
 } sprite_seq_t;
64
 } sprite_seq_t;
100
 
65
 
101
-
102
 /*! \fixme For now shaders are textures on tex objects
66
 /*! \fixme For now shaders are textures on tex objects
103
  * and materials on color objects. If -1
67
  * and materials on color objects. If -1
104
  * then it doesn't have that information yet.
68
  * then it doesn't have that information yet.
105
  */
69
  */
106
-
107
-typedef struct texture_tri_s
108
-{
70
+typedef struct {
109
     int index[3];
71
     int index[3];
110
     vec_t st[6];
72
     vec_t st[6];
111
     int texture;
73
     int texture;
112
     unsigned short transparency;
74
     unsigned short transparency;
113
-
114
 } texture_tri_t;
75
 } texture_tri_t;
115
 
76
 
116
-
117
-typedef struct model_mesh_s
118
-{
77
+typedef struct {
119
     Vector<texture_tri_t *> texturedTriangles;
78
     Vector<texture_tri_t *> texturedTriangles;
120
     Vector<texture_tri_t *> coloredTriangles;
79
     Vector<texture_tri_t *> coloredTriangles;
121
     Vector<texture_tri_t *> texturedRectangles;
80
     Vector<texture_tri_t *> texturedRectangles;
132
 
91
 
133
     unsigned int normalCount;
92
     unsigned int normalCount;
134
     vec_t *normals;
93
     vec_t *normals;
135
-
136
 } model_mesh_t;
94
 } model_mesh_t;
137
 
95
 
96
+typedef struct entity_s {
97
+    int id;                  //!< Unique identifier
98
+    float pos[3];            //!< World position
99
+    float angles[3];         //!< Euler angles (pitch, yaw, roll)
100
+    int type;                //!< {(0x00, item), (0x01, ai), (0x02, player)}
101
+    int room;                //!< Current room entity is in
102
+    worldMoveType moveType;  //!< Type of motion/clipping
103
+    bool moving;             //!< In motion?
104
+    struct entity_s *master; //!< Part of entity chain?
138
 
105
 
139
-////////////////////////////////////////////////////////////////
140
-
141
-
142
-typedef struct entity_s
143
-{
144
-    int id;                    // Unique identifier
145
-    float pos[3];              // World position
146
-    float angles[3];           // Euler angles (pitch, yaw, roll)
147
-    int type;                  // {(0x00, item), (0x01, ai), (0x02, player)}
148
-    int room;                  // Current room entity is in
149
-    worldMoveType moveType;    // Type of motion/clipping
150
-    bool moving;               // In motion?
151
-    struct entity_s *master;   // Part of entity chain?
106
+    int state;               //!< State of the Player, AI, or object
107
+    int objectId;            //!< What kind of entity?
152
 
108
 
153
-    int state;      // State of the Player, AI, or object
154
-    int objectId;              // What kind of entity?
155
-
156
-    int modelId;               // Animation model
109
+    int modelId;             //!< Animation model
157
     void *tmpHook;
110
     void *tmpHook;
158
     bool animate;
111
     bool animate;
159
 
112
 
160
     /*
113
     /*
161
-      float time, lastTime;
162
-      int state, lastState;
163
-      int event, lastEvent;
164
-      int goal;
165
-     */
166
-
114
+    float time, lastTime;
115
+    int state, lastState;
116
+    int event, lastEvent;
117
+    int goal;
118
+    */
167
 } entity_t;
119
 } entity_t;
168
 
120
 
169
-
170
-typedef struct static_model_s
171
-{
172
-    int index;     // model_mesh index
173
-    float yaw;     // angle of rotation on Y
174
-    float pos[3];  // position
121
+typedef struct {
122
+    int index;    //!< model_mesh index
123
+    float yaw;    //!< angle of rotation on Y
124
+    float pos[3]; //!< position
175
 
125
 
176
     //vec3_t bboxMax;
126
     //vec3_t bboxMax;
177
     //vec3_t bboxMin;
127
     //vec3_t bboxMin;
178
-
179
 } static_model_t;
128
 } static_model_t;
180
 
129
 
181
-
182
-
183
-typedef struct portal_s
184
-{
130
+typedef struct {
185
     float vertices[4][3];
131
     float vertices[4][3];
186
     float normal[3];
132
     float normal[3];
187
     int adjoining_room;
133
     int adjoining_room;
188
-
189
 } portal_t;
134
 } portal_t;
190
 
135
 
191
-
192
-typedef struct box_s
193
-{
136
+typedef struct {
194
     vertex_t a;
137
     vertex_t a;
195
     vertex_t b;
138
     vertex_t b;
196
     vertex_t c;
139
     vertex_t c;
197
     vertex_t d;
140
     vertex_t d;
198
-
199
 } box_t;
141
 } box_t;
200
 
142
 
201
-typedef struct sector_s
202
-{
143
+typedef struct {
203
     vec_t floor;
144
     vec_t floor;
204
     vec_t ceiling;
145
     vec_t ceiling;
205
 
146
 
206
     bool wall;
147
     bool wall;
207
-
208
 } sector_t;
148
 } sector_t;
209
 
149
 
210
 //! \fixme No room mesh list or sprites and etc
150
 //! \fixme No room mesh list or sprites and etc
211
-typedef struct room_mesh_s
212
-{
151
+typedef struct {
213
     Vector<int> adjacentRooms;
152
     Vector<int> adjacentRooms;
214
     Vector<portal_t *> portals;
153
     Vector<portal_t *> portals;
215
     Vector<static_model_t *> models;
154
     Vector<static_model_t *> models;
224
     float pos[3];
163
     float pos[3];
225
     vec3_t bbox_min;
164
     vec3_t bbox_min;
226
     vec3_t bbox_max;
165
     vec3_t bbox_max;
227
-
228
 } room_mesh_t;
166
 } room_mesh_t;
229
 
167
 
230
-
231
 // Workout generic entity and a client class from these entities
168
 // Workout generic entity and a client class from these entities
232
-typedef struct world_entity_s
233
-{
169
+typedef struct world_entity_s {
234
     vec3_t pos;
170
     vec3_t pos;
235
     vec3_t lastPos;
171
     vec3_t lastPos;
236
     vec3_t angle;
172
     vec3_t angle;
243
 
179
 
244
 } world_entity_t;
180
 } world_entity_t;
245
 
181
 
246
-
247
-typedef struct actor_entity_s
248
-{
182
+typedef struct {
249
     vec3_t pos;
183
     vec3_t pos;
250
     vec3_t lastPos;
184
     vec3_t lastPos;
251
     vec3_t angle;
185
     vec3_t angle;
266
 
200
 
267
 } actor_entity_t;
201
 } actor_entity_t;
268
 
202
 
269
-enum OpenRaiderEvent
270
-{
271
-    eNone            = 0,
203
+enum OpenRaiderEvent {
204
+    eNone = 0,
272
     eWeaponDischarge,
205
     eWeaponDischarge,
273
     eDying,
206
     eDying,
274
     eDead,
207
     eDead,
284
     eLand
217
     eLand
285
 };
218
 };
286
 
219
 
220
+/*!
221
+ * \brief The game world (model)
222
+ */
223
+class World {
224
+public:
287
 
225
 
288
-class World
289
-{
290
- public:
291
-
292
-    enum WorldFlag
293
-    {
226
+    enum WorldFlag {
294
         fEnableHopping = 1
227
         fEnableHopping = 1
295
     };
228
     };
296
 
229
 
297
-    ////////////////////////////////////////////////////////////
298
-    // Constructors
299
-    ////////////////////////////////////////////////////////////
300
-
230
+    /*!
231
+     * \brief Constructs an object of World
232
+     */
301
     World();
233
     World();
302
-    /*------------------------------------------------------
303
-     * Pre  :
304
-     * Post : Constructs an object of World
305
-     *
306
-     *-- History ------------------------------------------
307
-     *
308
-     * 2002.12.16:
309
-     * Mongoose - Created
310
-     ------------------------------------------------------*/
311
 
234
 
235
+    /*!
236
+     * \brief Deconstructs an object of World
237
+     */
312
     ~World();
238
     ~World();
313
-    /*------------------------------------------------------
314
-     * Pre  : World object is allocated
315
-     * Post : Deconstructs an object of World
316
-     *
317
-     *-- History ------------------------------------------
318
-     *
319
-     * 2002.12.16:
320
-     * Mongoose - Created
321
-     ------------------------------------------------------*/
322
-
323
 
239
 
324
-    ////////////////////////////////////////////////////////////
325
-    // Public Accessors
326
-    ////////////////////////////////////////////////////////////
327
-
328
-    int getRoomByLocation(int index, float x, float y, float z);
329
-    /*------------------------------------------------------
330
-     * Pre  : index - Guessed room index
331
-     * Post : Returns correct room index or -1 for unknown
332
-     *
333
-     *        NOTE: If it fails to be in a room it gives
334
-     *        closest overlapping room
335
-     *
336
-     *-- History ------------------------------------------
240
+    /*!
241
+     * \brief Find room a location is in.
337
      *
242
      *
338
-     * 2002.12.20:
339
-     * Mongoose - Created, factored out of Render class
340
-     ------------------------------------------------------*/
243
+     * If it fails to be in a room it gives closest overlapping room.
244
+     * \param index Guessed room index
245
+     * \param x X coordinate
246
+     * \param y Y coordinate
247
+     * \param z Z coordinate
248
+     * \returns correct room index or -1 for unknown
249
+     */
250
+    int getRoomByLocation(int index, float x, float y, float z);
341
 
251
 
342
-    int getRoomByLocation(float x, float y, float z);
343
-    /*------------------------------------------------------
344
-     * Pre  :
345
-     * Post : Returns correct room index or -1 for unknown
252
+    /*!
253
+     * \brief Find room a location is in.
346
      *
254
      *
347
-     *        NOTE: If it fails to be in a room it gives
348
-     *        closest overlapping room
349
-     *
350
-     *-- History ------------------------------------------
351
-     *
352
-     * 2002.12.20:
353
-     * Mongoose - Created, factored out of Render class
354
-     ------------------------------------------------------*/
255
+     * If it fails to be in a room it gives closest overlapping room.
256
+     * \param x X coordinate
257
+     * \param y Y coordinate
258
+     * \param z Z coordinate
259
+     * \returns correct room index or -1 for unknown
260
+     */
261
+    int getRoomByLocation(float x, float y, float z);
355
 
262
 
263
+    /*!
264
+     * \brief Looks for portal crossings from xyz to xyz2 segment
265
+     * from room[index]
266
+     * \param index valid room index
267
+     * \param x X coordinate of first point
268
+     * \param y Y coordinate of first point
269
+     * \param z Z coordinate of first point
270
+     * \param x2 X coordinate of second point
271
+     * \param y2 Y coordinate of second point
272
+     * \param z2 Z coordinate of second point
273
+     * \returns index of adjoined room or -1
274
+     */
356
     int getAdjoiningRoom(int index,
275
     int getAdjoiningRoom(int index,
357
-                                float x, float y, float z,
358
-                                float x2, float y2, float z2);
359
-    /*------------------------------------------------------
360
-     * Pre  :
361
-     * Post : Looks for portal crossings from xyz to xyz2 segment
362
-     *        from room[index] returns index of adjoined room or -1
363
-     *
364
-     *-- History ------------------------------------------
365
-     *
366
-     * 2003.05.29:
367
-     * Mongoose - Created
368
-     ------------------------------------------------------*/
369
-
276
+                            float x, float y, float z,
277
+                            float x2, float y2, float z2);
278
+
279
+    /*!
280
+     * \brief Gets the sector index of the position in room
281
+     * \param room valid room index
282
+     * \param x X coordinate in room
283
+     * \param z Z coordinate in room
284
+     * \returns sector index of position in room
285
+     */
370
     int getSector(int room, float x, float z);
286
     int getSector(int room, float x, float z);
371
     int getSector(int room, float x, float z, float *floor, float *ceiling);
287
     int getSector(int room, float x, float z, float *floor, float *ceiling);
372
-    /*------------------------------------------------------
373
-     * Pre  : room - valid room index
374
-     * Post : Gets the sector index of the position in room
375
-     *
376
-     *-- History ------------------------------------------
377
-     *
378
-     * 2002.12.20:
379
-     * Mongoose - Created, factored out of Render class
380
-     ------------------------------------------------------*/
381
 
288
 
382
     unsigned int getRoomInfo(int room);
289
     unsigned int getRoomInfo(int room);
383
-    /*------------------------------------------------------
384
-     * Pre  :
385
-     * Post :
386
-     *
387
-     *-- History ------------------------------------------
388
-     *
389
-     * 2003.05.28:
390
-     * Mongoose - Created
391
-     ------------------------------------------------------*/
392
 
290
 
291
+    /*!
292
+     * \brief Check if sector is a wall
293
+     * \param room valid room index
294
+     * \param sector valid sector index
295
+     * \returns true if this sector is a wall
296
+     */
393
     bool isWall(int room, int sector);
297
     bool isWall(int room, int sector);
394
-    /*------------------------------------------------------
395
-     * Pre  : room - valid room index
396
-     *        sector - valid sector index
397
-     * Post : Returns true if this sector is a wall
398
-     *
399
-     *-- History ------------------------------------------
400
-     *
401
-     * 2002.12.20:
402
-     * Mongoose - Created, factored out of Render class
403
-     ------------------------------------------------------*/
404
 
298
 
299
+    /*!
300
+     * \brief Get the world height at a position
301
+     * \param index valid room index
302
+     * \param x X coordinate
303
+     * \param y will be set to world height in that room
304
+     * \param z Z coordinate
305
+     * \returns true if position is in a room
306
+     */
405
     bool getHeightAtPosition(int index, float x, float *y, float z);
307
     bool getHeightAtPosition(int index, float x, float *y, float z);
406
-    /*------------------------------------------------------
407
-     * Pre  : index - valid room index
408
-     * Post : Returns true if position is in a room
409
-     *        and sets y to the world height in that room
410
-     *
411
-     *-- History ------------------------------------------
412
-     *
413
-     * 2002.12.20:
414
-     * Mongoose - Created, factored out of Render class
415
-     ------------------------------------------------------*/
416
 
308
 
417
-    // Temp methods for rendering use until more refactoring is done
418
 #ifdef BAD_BLOOD
309
 #ifdef BAD_BLOOD
310
+    //! \todo Temp methods for rendering use until more refactoring is done
419
     model_mesh_t *getMesh(int index);
311
     model_mesh_t *getMesh(int index);
420
     skeletal_model_t *getModel(int index);
312
     skeletal_model_t *getModel(int index);
421
     room_mesh_t *getRoom(int index);
313
     room_mesh_t *getRoom(int index);
424
     Vector<room_mesh_t *> *getRooms();
316
     Vector<room_mesh_t *> *getRooms();
425
 #endif
317
 #endif
426
 
318
 
427
-    ////////////////////////////////////////////////////////////
428
-    // Public Mutators
429
-    ////////////////////////////////////////////////////////////
430
-
319
+    /*!
320
+     * \brief Set an option flag
321
+     * \param flag flag to set
322
+     */
431
     void setFlag(WorldFlag flag);
323
     void setFlag(WorldFlag flag);
432
-    /*------------------------------------------------------
433
-     * Pre  :
434
-     * Post : Sets option flag
435
-     *
436
-     *-- History ------------------------------------------
437
-     *
438
-     * 2002.12.20:
439
-     * Mongoose - Created, factored out of Render class
440
-     ------------------------------------------------------*/
441
 
324
 
325
+    /*!
326
+     * \brief Clear an option flag
327
+     * \param flag flag to clear
328
+     */
442
     void clearFlag(WorldFlag flag);
329
     void clearFlag(WorldFlag flag);
443
-    /*------------------------------------------------------
444
-     * Pre  :
445
-     * Post : Clears option flag
446
-     *
447
-     *-- History ------------------------------------------
448
-     *
449
-     * 2002.12.20:
450
-     * Mongoose - Created, factored out of Render class
451
-     ------------------------------------------------------*/
452
 
330
 
331
+    /*!
332
+     * \brief Clears all data in world
333
+     * \todo in future will check if data is in use before clearing
334
+     */
453
     void destroy();
335
     void destroy();
454
-    /*------------------------------------------------------
455
-     * Pre  :
456
-     * Post : Clears all data in world, in future will check
457
-     *        if data is in use before clearing
458
-     *
459
-     *-- History ------------------------------------------
460
-     *
461
-     * 2002.12.20:
462
-     * Mongoose - Created
463
-     ------------------------------------------------------*/
464
 
336
 
337
+    /*!
338
+     * \brief Adds room to world
339
+     * \param room room to add
340
+     */
465
     void addRoom(room_mesh_t *room);
341
     void addRoom(room_mesh_t *room);
466
-    /*------------------------------------------------------
467
-     * Pre  :
468
-     * Post : Adds object to world
469
-     *
470
-     *-- History ------------------------------------------
471
-     *
472
-     * 2002.12.20:
473
-     * Mongoose - Created, factored out of Render class
474
-     ------------------------------------------------------*/
475
 
342
 
343
+    /*!
344
+     * \brief ADds mesh to world
345
+     * \param model mesh to add
346
+     */
476
     void addMesh(model_mesh_t *model);
347
     void addMesh(model_mesh_t *model);
477
-    /*------------------------------------------------------
478
-     * Pre  :
479
-     * Post : Adds object to world
480
-     *
481
-     *-- History ------------------------------------------
482
-     *
483
-     * 2002.12.20:
484
-     * Mongoose - Created, factored out of Render class
485
-     ------------------------------------------------------*/
486
 
348
 
349
+    /*!
350
+     * \brief Adds entity to world
351
+     * \param e entity to add
352
+     */
487
     void addEntity(entity_t *e);
353
     void addEntity(entity_t *e);
488
-    /*------------------------------------------------------
489
-     * Pre  :
490
-     * Post : Adds object to world
491
-     *
492
-     *-- History ------------------------------------------
493
-     *
494
-     * 2002.12.20:
495
-     * Mongoose - Created, factored out of Render class
496
-     ------------------------------------------------------*/
497
 
354
 
355
+    /*!
356
+     * \brief Adds model to world.
357
+     * \param model model to add
358
+     * \returns next model ID or -1 on error
359
+     */
498
     int addModel(skeletal_model_t *model);
360
     int addModel(skeletal_model_t *model);
499
-    /*------------------------------------------------------
500
-     * Pre  :
501
-     * Post : Adds object to world, returns next model Id
502
-     *        or -1 if failed to add model to world
503
-     *
504
-     *-- History ------------------------------------------
505
-     *
506
-     * 2002.12.20:
507
-     * Mongoose - Created, factored out of Render class
508
-     ------------------------------------------------------*/
509
 
361
 
362
+    /*!
363
+     * \brief Adds sprite to world
364
+     * \param sprite sprite to add
365
+     */
510
     void addSprite(sprite_seq_t *sprite);
366
     void addSprite(sprite_seq_t *sprite);
511
-    /*------------------------------------------------------
512
-     * Pre  :
513
-     * Post : Adds object to world
514
-     *
515
-     *-- History ------------------------------------------
516
-     *
517
-     * 2002.12.20:
518
-     * Mongoose - Created, factored out of Render class
519
-     ------------------------------------------------------*/
520
 
367
 
368
+    /*!
369
+     * \brief Move entity in given direction unless collision occurs
370
+     * \param e entity to move
371
+     * \param movement direction of movement ('f', 'b', 'l' or 'r')
372
+     */
521
     void moveEntity(entity_t *e, char movement);
373
     void moveEntity(entity_t *e, char movement);
522
-    /*------------------------------------------------------
523
-     * Pre  : movement - 'f' orward
524
-     *                   'b' ackward
525
-     *                   'l' eft
526
-     *                   'r' ight
527
-     *
528
-     * Post : Move entity e in a given direction, unless
529
-     *        a collision ocurrs
530
-     *
531
-     *-- History ------------------------------------------
532
-     *
533
-     * 2002.12.20:
534
-     * Mongoose - Moved to WOrld class
535
-     *
536
-     * 2002.09.02:
537
-     * Mongoose - Created
538
-     ------------------------------------------------------*/
539
-
540
-
541
- private:
542
 
374
 
543
-    ////////////////////////////////////////////////////////////
544
-    // Private Accessors
545
-    ////////////////////////////////////////////////////////////
546
-
547
-
548
-    ////////////////////////////////////////////////////////////
549
-    // Private Mutators
550
-    ////////////////////////////////////////////////////////////
375
+private:
551
 
376
 
377
+    /*!
378
+     * \brief Clears all data in world
379
+     */
552
     void clear();
380
     void clear();
553
-    /*------------------------------------------------------
554
-     * Pre  :
555
-     * Post : Clears all data in world
556
-     *
557
-     *-- History ------------------------------------------
558
-     *
559
-     * 2002.12.20:
560
-     * Mongoose - Created
561
-     ------------------------------------------------------*/
562
 
381
 
563
     bool mClearLock;
382
     bool mClearLock;
564
-
565
-    unsigned int mFlags;                   /* World flags */
566
-
567
-    Vector<entity_t *> mEntities;            /* World entities */
568
-
569
-    Vector<room_mesh_t *> mRooms;            /* Map data and meshes */
570
-
571
-    Vector<model_mesh_t *> mMeshes;       /* Unanimated meshes */
572
-
573
-    Vector<sprite_seq_t *> mSprites;          /* Sprites */
574
-
575
-    Vector<skeletal_model_t *> mModels;     /* Skeletal animation models */
383
+    unsigned int mFlags;                //!< World flags
384
+    Vector<entity_t *> mEntities;       //!< World entities
385
+    Vector<room_mesh_t *> mRooms;       //!< Map data and meshes
386
+    Vector<model_mesh_t *> mMeshes;     //!< Unanimated meshes
387
+    Vector<sprite_seq_t *> mSprites;    //!< Sprites
388
+    Vector<skeletal_model_t *> mModels; //!< Skeletal animation models
576
 };
389
 };
577
 
390
 
578
 #endif
391
 #endif

+ 5
- 19
src/World.cpp View File

1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
2
-/*================================================================
1
+/*!
2
+ * \file src/World.cpp
3
+ * \brief The game world (model)
3
  *
4
  *
4
- * Project : OpenRaider
5
- * Author  : Terry 'Mongoose' Hendrix II
6
- * Website : http://www.westga.edu/~stu7440/
7
- * Email   : stu7440@westga.edu
8
- * Object  : World
9
- * License : No use w/o permission (C) 2002 Mongoose
10
- * Comments: The game world ( model )
11
- *
12
- *
13
- *           This file was generated using Mongoose's C++
14
- *           template generator script.  <stu7440@westga.edu>
15
- *
16
- *-- History -------------------------------------------------
17
- *
18
- * 2002.12.16:
19
- * Mongoose - Created
20
- =================================================================*/
5
+ * \author Mongoose
6
+ */
21
 
7
 
22
 #ifdef DEBUG_MEMORY
8
 #ifdef DEBUG_MEMORY
23
 #include <memory_test.h>
9
 #include <memory_test.h>

Loading…
Cancel
Save