浏览代码

Added my Todo list

Thomas Buck 10 年前
父节点
当前提交
138b5d3d95
共有 5 个文件被更改,包括 13 次插入17 次删除
  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 查看文件


+ 1
- 1
include/World.h 查看文件

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

+ 3
- 2
include/WorldData.h 查看文件

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

+ 4
- 5
src/Command.cpp 查看文件

@@ -252,10 +252,9 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
252 252
             return -999;
253 253
         }
254 254
         if (getGame().mLara) {
255
-            SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
256 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 259
         //m_render.ViewModel(LARA, atoi(cmd));
261 260
     } else if (strcmp(command, "pos") == 0) {
@@ -455,7 +454,7 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
455 454
                 getConsole().print("Pass BOOL to pigtail command!");
456 455
                 return -46;
457 456
             }
458
-            SkeletalModel *tmp = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
457
+            SkeletalModel *tmp = getGame().mLara->tmpHook;
459 458
             tmp->model->pigtails = b;
460 459
             if (b) {
461 460
                 tmp->model->ponyOff -= 20;
@@ -475,7 +474,7 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
475 474
             return -999;
476 475
         }
477 476
         if (args->size() > 3) {
478
-            SkeletalModel *tmp = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
477
+            SkeletalModel *tmp = getGame().mLara->tmpHook;
479 478
             tmp->model->ponytail[0] = (float)atof(args->at(0));
480 479
             tmp->model->ponytail[1] = (float)atof(args->at(1));
481 480
             tmp->model->ponytail[2] = (float)atof(args->at(2));

+ 5
- 9
src/Render.cpp 查看文件

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

正在加载...
取消
保存