Browse Source

Removed more old stuff from WorldData

Thomas Buck 10 years ago
parent
commit
e10084d735
5 changed files with 15 additions and 95 deletions
  1. 6
    29
      include/WorldData.h
  2. 1
    14
      src/Game.cpp
  3. 0
    42
      src/Render.cpp
  4. 6
    1
      src/Room.cpp
  5. 2
    9
      src/World.cpp

+ 6
- 29
include/WorldData.h View File

@@ -12,27 +12,14 @@
12 12
 #include "math/math.h"
13 13
 #include "SkeletalModel.h"
14 14
 
15
-// Mirrors TombRaider class' room flags really
16 15
 typedef enum {
17
-    roomFlag_underWater    = 0x0001
18
-} room_flags_t;
19
-
20
-typedef enum {
21
-    worldMoveType_walkNoSwim   = -1,
22
-    worldMoveType_walk         = 0,
23
-    worldMoveType_noClipping   = 1,
24
-    worldMoveType_fly          = 2,
25
-    worldMoveType_swim         = 3
16
+    worldMoveType_walkNoSwim = -1,
17
+    worldMoveType_walk       = 0,
18
+    worldMoveType_noClipping = 1,
19
+    worldMoveType_fly        = 2,
20
+    worldMoveType_swim       = 3
26 21
 } worldMoveType;
27 22
 
28
-typedef struct {
29
-    vec3_t pos;
30
-} vertex_t;
31
-
32
-typedef struct {
33
-    vec2_t st;
34
-} texel_t;
35
-
36 23
 /*! \fixme For now shaders are textures on tex objects
37 24
  * and materials on color objects. If -1
38 25
  * then it doesn't have that information yet.
@@ -63,15 +50,12 @@ typedef struct {
63 50
     vec_t *normals;
64 51
 } model_mesh_t;
65 52
 
66
-typedef struct entity_s {
53
+typedef struct {
67 54
     int id;                  //!< Unique identifier
68 55
     float pos[3];            //!< World position
69 56
     float angles[3];         //!< Euler angles (pitch, yaw, roll)
70
-    int type;                //!< {(0x00, item), (0x01, ai), (0x02, player)}
71 57
     int room;                //!< Current room entity is in
72 58
     worldMoveType moveType;  //!< Type of motion/clipping
73
-    bool moving;             //!< In motion?
74
-    struct entity_s *master; //!< Part of entity chain?
75 59
 
76 60
     int state;               //!< State of the Player, AI, or object
77 61
     int objectId;            //!< What kind of entity?
@@ -79,13 +63,6 @@ typedef struct entity_s {
79 63
     int modelId;             //!< Animation model
80 64
     SkeletalModel *tmpHook;
81 65
     bool animate;
82
-
83
-    /*
84
-    float time, lastTime;
85
-    int state, lastState;
86
-    int event, lastEvent;
87
-    int goal;
88
-    */
89 66
 } entity_t;
90 67
 
91 68
 #endif

+ 1
- 14
src/Game.cpp View File

@@ -447,13 +447,11 @@ void Game::processMoveable(int index, int i, int *ent,
447 447
 
448 448
     thing = new entity_t;
449 449
     thing->id = (*ent)++;
450
-    thing->type = 0x00;
451 450
     thing->pos[0] = item[i].x;
452 451
     thing->pos[1] = item[i].y;
453 452
     thing->pos[2] = item[i].z;
454 453
     thing->angles[1] = yaw;
455 454
     thing->objectId = moveable[index].object_id;
456
-    thing->moving = false;
457 455
     thing->animate = false;
458 456
 
459 457
     sModel = new SkeletalModel();
@@ -487,9 +485,7 @@ void Game::processMoveable(int index, int i, int *ent,
487 485
     if (moveable[index].object_id == 0)
488 486
     {
489 487
         lara = true;
490
-        thing->type = 0x02;
491 488
         mLara = thing; // Mongoose 2002.03.22, Cheap hack for now
492
-        mLara->master = 0x0;
493 489
 
494 490
         switch (mTombRaider.Engine())
495 491
         {
@@ -855,14 +851,7 @@ void Game::setupTextureColor(texture_tri_t *r_tri, float *colorf)
855 851
         r_tri->texture = mTextureOffset + gColorTextureHACK.size();
856 852
 
857 853
         getRender().loadTexture(Texture::generateColorTexture(color, 32, 32),
858
-                32, 32,
859
-                r_tri->texture);
860
-
861
-#ifdef DEBUG_COLOR_TEXTURE_GEN
862
-        printf("Color 0x%02x%02x%02x%02x | 0x%08xto texture[%u]?\n",
863
-                color[0], color[1], color[2], color[3], colorI,
864
-                gColorTextureHACK.size());
865
-#endif
854
+                32, 32, r_tri->texture);
866 855
     }
867 856
     else
868 857
     {
@@ -1075,8 +1064,6 @@ void Game::processModels()
1075 1064
         std::sort(mesh->coloredRectangles.begin(), mesh->coloredRectangles.end(), compareFaceTextureId);
1076 1065
 
1077 1066
         getWorld().addMesh(mesh);
1078
-        //printf(".");
1079
-        //fflush(stdout);
1080 1067
     }
1081 1068
 
1082 1069
     printf("Done! Found %d meshes.\n", mTombRaider.getMeshCount());

+ 0
- 42
src/Render.cpp View File

@@ -467,18 +467,6 @@ void Render::display()
467 467
             renderTrace(0, u, v); // v = target
468 468
         }
469 469
 
470
-        entity_t *route = getGame().mLara->master;
471
-
472
-        while (route)
473
-        {
474
-            if (route->master)
475
-            {
476
-                renderTrace(1, route->pos, route->master->pos);
477
-            }
478
-
479
-            route = route->master;
480
-        }
481
-
482 470
         glEnable(GL_CULL_FACE);
483 471
         glEnable(GL_TEXTURE_2D);
484 472
     }
@@ -751,36 +739,6 @@ void Render::drawObjects()
751 739
     // Draw lara or other player model ( move to entity rendering method )
752 740
     if (mFlags & Render::fViewModel && getGame().mLara && getGame().mLara->tmpHook)
753 741
     {
754
-        SkeletalModel *mdl = getGame().mLara->tmpHook;
755
-
756
-        if (mdl)
757
-        {
758
-            int frame;
759
-
760
-            // Mongoose 2002.03.22, Test 'idle' aniamtions
761
-            if (!getGame().mLara->moving)
762
-            {
763
-                frame = mdl->getIdleAnimation();
764
-
765
-                // Mongoose 2002.08.15, Stop flickering of idle lara here
766
-                if (frame == 11)
767
-                {
768
-                    mdl->setFrame(0);
769
-                }
770
-            }
771
-            else
772
-            {
773
-                frame = mdl->getAnimation();
774
-            }
775
-
776
-            animation_frame_t *animation = mdl->model->animation[frame];
777
-
778
-            if (animation && mdl->getFrame() > (int)animation->frame.size()-1)
779
-            {
780
-                mdl->setFrame(0);
781
-            }
782
-        }
783
-
784 742
         glPushMatrix();
785 743
 
786 744
         glTranslated(getGame().mLara->pos[0], getGame().mLara->pos[1], getGame().mLara->pos[2]);

+ 6
- 1
src/Room.cpp View File

@@ -30,7 +30,12 @@ Room::Room(TombRaider &tr, unsigned int index) {
30 30
         return;
31 31
     }
32 32
 
33
-    tr.getRoomInfo(index, &flags, pos, box[0], box[1]);
33
+    flags = 0;
34
+    unsigned int trFlags = 0;
35
+    tr.getRoomInfo(index, &trFlags, pos, box[0], box[1]);
36
+
37
+    if (trFlags & tombraiderRoom_underWater)
38
+        flags |= RoomFlagUnderWater;
34 39
 
35 40
     // Adjust positioning for OR world coordinate translation
36 41
     box[0][0] += pos[0];

+ 2
- 9
src/World.cpp View File

@@ -44,7 +44,6 @@ void World::addEntity(entity_t *e)
44 44
 {
45 45
     if (e)
46 46
     {
47
-        e->master = 0x0;
48 47
         e->moveType = worldMoveType_walk; // Walk
49 48
         e->room = getRoomByLocation(e->pos[0], e->pos[1], e->pos[2]);
50 49
         mEntities.push_back(e);
@@ -144,16 +143,12 @@ void World::moveEntity(entity_t *e, char movement)
144 143
 
145 144
     // If you're underwater you may want to swim  =)
146 145
     // ...if you're worldMoveType_walkNoSwim, you better hope it's shallow
147
-    if (roomFlags & roomFlag_underWater && e->moveType == worldMoveType_walk)
148
-    {
146
+    if (roomFlags & RoomFlagUnderWater && e->moveType == worldMoveType_walk)
149 147
         e->moveType = worldMoveType_swim;
150
-    }
151 148
 
152 149
     // Don't swim on land
153
-    if (!(roomFlags & roomFlag_underWater) && e->moveType == worldMoveType_swim)
154
-    {
150
+    if (!(roomFlags & RoomFlagUnderWater) && e->moveType == worldMoveType_swim)
155 151
         e->moveType = worldMoveType_walk;
156
-    }
157 152
 
158 153
     // Mongoose 2002.09.02, Add check for room -> room transition
159 154
     //   ( Only allow by movement between rooms by using portals )
@@ -234,12 +229,10 @@ void World::moveEntity(entity_t *e, char movement)
234 229
     }
235 230
     else
236 231
     {
237
-        e->moving = false;
238 232
         return;
239 233
     }
240 234
 
241 235
     e->room = room;
242
-    e->moving = true;
243 236
 }
244 237
 
245 238
 

Loading…
Cancel
Save