Sfoglia il codice sorgente

Added my Todo list

Thomas Buck 10 anni fa
parent
commit
138b5d3d95
5 ha cambiato i file con 13 aggiunte e 17 eliminazioni
  1. 0
    0
      ChangeLog.md
  2. 1
    1
      include/World.h
  3. 3
    2
      include/WorldData.h
  4. 4
    5
      src/Command.cpp
  5. 5
    9
      src/Render.cpp

ChangeLog → ChangeLog.md Vedi File


+ 1
- 1
include/World.h Vedi File

128
     void addRoom(room_mesh_t *room);
128
     void addRoom(room_mesh_t *room);
129
 
129
 
130
     /*!
130
     /*!
131
-     * \brief ADds mesh to world
131
+     * \brief Adds mesh to world
132
      * \param model mesh to add
132
      * \param model mesh to add
133
      */
133
      */
134
     void addMesh(model_mesh_t *model);
134
     void addMesh(model_mesh_t *model);

+ 3
- 2
include/WorldData.h Vedi File

10
 #define _WORLDDATA_H_
10
 #define _WORLDDATA_H_
11
 
11
 
12
 #include "math/math.h"
12
 #include "math/math.h"
13
+#include "SkeletalModel.h"
13
 
14
 
14
 // Mirrors TombRaider class' room flags really
15
 // Mirrors TombRaider class' room flags really
15
 typedef enum {
16
 typedef enum {
37
     vertex_t vertex[4];
38
     vertex_t vertex[4];
38
     texel_t texel[4];
39
     texel_t texel[4];
39
     float pos[3];
40
     float pos[3];
40
-    float radius;       //!< \fixme yeah, I know
41
+    float radius;       //!< \fixme yeah, I know (I don't? --xythobuz)
41
     int texture;
42
     int texture;
42
 } sprite_t;
43
 } sprite_t;
43
 
44
 
90
     int objectId;            //!< What kind of entity?
91
     int objectId;            //!< What kind of entity?
91
 
92
 
92
     int modelId;             //!< Animation model
93
     int modelId;             //!< Animation model
93
-    void *tmpHook;
94
+    SkeletalModel *tmpHook;
94
     bool animate;
95
     bool animate;
95
 
96
 
96
     /*
97
     /*

+ 4
- 5
src/Command.cpp Vedi File

252
             return -999;
252
             return -999;
253
         }
253
         }
254
         if (getGame().mLara) {
254
         if (getGame().mLara) {
255
-            SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
256
             skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
255
             skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
257
-            if (smdl)
258
-                smdl->setModel(mdl);
256
+            if (getGame().mLara->tmpHook)
257
+                getGame().mLara->tmpHook->setModel(mdl);
259
         }
258
         }
260
         //m_render.ViewModel(LARA, atoi(cmd));
259
         //m_render.ViewModel(LARA, atoi(cmd));
261
     } else if (strcmp(command, "pos") == 0) {
260
     } else if (strcmp(command, "pos") == 0) {
455
                 getConsole().print("Pass BOOL to pigtail command!");
454
                 getConsole().print("Pass BOOL to pigtail command!");
456
                 return -46;
455
                 return -46;
457
             }
456
             }
458
-            SkeletalModel *tmp = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
457
+            SkeletalModel *tmp = getGame().mLara->tmpHook;
459
             tmp->model->pigtails = b;
458
             tmp->model->pigtails = b;
460
             if (b) {
459
             if (b) {
461
                 tmp->model->ponyOff -= 20;
460
                 tmp->model->ponyOff -= 20;
475
             return -999;
474
             return -999;
476
         }
475
         }
477
         if (args->size() > 3) {
476
         if (args->size() > 3) {
478
-            SkeletalModel *tmp = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
477
+            SkeletalModel *tmp = getGame().mLara->tmpHook;
479
             tmp->model->ponytail[0] = (float)atof(args->at(0));
478
             tmp->model->ponytail[0] = (float)atof(args->at(0));
480
             tmp->model->ponytail[1] = (float)atof(args->at(1));
479
             tmp->model->ponytail[1] = (float)atof(args->at(1));
481
             tmp->model->ponytail[2] = (float)atof(args->at(2));
480
             tmp->model->ponytail[2] = (float)atof(args->at(2));

+ 5
- 9
src/Render.cpp Vedi File

490
     // Let's see the LoS -- should be event controled
490
     // Let's see the LoS -- should be event controled
491
     if (getGame().mLara)
491
     if (getGame().mLara)
492
     {
492
     {
493
-        // SkeletalModel *mdl = (SkeletalModel *)getGame().mLara->tmpHook;
493
+        // SkeletalModel *mdl = getGame().mLara->tmpHook;
494
 
494
 
495
         // Draw in solid colors
495
         // Draw in solid colors
496
         glDisable(GL_TEXTURE_2D);
496
         glDisable(GL_TEXTURE_2D);
573
             // Mongoose 2002.08.15, Nothing to draw, skip
573
             // Mongoose 2002.08.15, Nothing to draw, skip
574
             // Mongoose 2002.12.24, Some entities have no animation  =p
574
             // Mongoose 2002.12.24, Some entities have no animation  =p
575
             if (e->tmpHook)
575
             if (e->tmpHook)
576
-            {
577
-                SkeletalModel *mdl = static_cast<SkeletalModel *>(e->tmpHook);
578
-
579
-                if (mdl->model->animation.empty())
576
+                if (e->tmpHook->model->animation.empty())
580
                     continue;
577
                     continue;
581
-            }
582
 
578
 
583
             // Is it in view volume? ( Hack to use sphere )
579
             // Is it in view volume? ( Hack to use sphere )
584
             if (!isVisible(e->pos[0], e->pos[1], e->pos[2], 512.0f))
580
             if (!isVisible(e->pos[0], e->pos[1], e->pos[2], 512.0f))
608
             glPushMatrix();
604
             glPushMatrix();
609
             glTranslatef(e->pos[0], e->pos[1], e->pos[2]);
605
             glTranslatef(e->pos[0], e->pos[1], e->pos[2]);
610
             glRotatef(e->angles[1], 0, 1, 0);
606
             glRotatef(e->angles[1], 0, 1, 0);
611
-            drawModel(static_cast<SkeletalModel *>(e->tmpHook));
607
+            drawModel(e->tmpHook);
612
             glPopMatrix();
608
             glPopMatrix();
613
         }
609
         }
614
     }
610
     }
849
     // Draw lara or other player model ( move to entity rendering method )
845
     // Draw lara or other player model ( move to entity rendering method )
850
     if (mFlags & Render::fViewModel && getGame().mLara && getGame().mLara->tmpHook)
846
     if (mFlags & Render::fViewModel && getGame().mLara && getGame().mLara->tmpHook)
851
     {
847
     {
852
-        SkeletalModel *mdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
848
+        SkeletalModel *mdl = getGame().mLara->tmpHook;
853
 
849
 
854
         if (mdl)
850
         if (mdl)
855
         {
851
         {
890
         glRotated(OR_RAD_TO_DEG(getCamera().getRadianYaw()), 0, 1, 0);
886
         glRotated(OR_RAD_TO_DEG(getCamera().getRadianYaw()), 0, 1, 0);
891
 #endif
887
 #endif
892
 
888
 
893
-        drawModel(static_cast<SkeletalModel *>(getGame().mLara->tmpHook));
889
+        drawModel(getGame().mLara->tmpHook);
894
         glPopMatrix();
890
         glPopMatrix();
895
     }
891
     }
896
 
892
 

Loading…
Annulla
Salva