Browse Source

Work still in progress

Thomas Buck 10 years ago
parent
commit
bd5a177989
4 changed files with 9 additions and 18 deletions
  1. 1
    1
      include/Game.h
  2. 1
    1
      include/SkeletalModel.h
  3. 6
    15
      src/Game.cpp
  4. 1
    1
      src/SkeletalModel.cpp

+ 1
- 1
include/Game.h View File

66
     unsigned int mTextureStart;
66
     unsigned int mTextureStart;
67
     unsigned int mTextureOffset;
67
     unsigned int mTextureOffset;
68
 
68
 
69
-    unsigned int mLara;
69
+    int mLara;
70
 };
70
 };
71
 
71
 
72
 #endif
72
 #endif

+ 1
- 1
include/SkeletalModel.h View File

56
 
56
 
57
 class SkeletalModel {
57
 class SkeletalModel {
58
 public:
58
 public:
59
-    SkeletalModel(TombRaider &tr, );
59
+    SkeletalModel(TombRaider &tr, unsigned int index);
60
     ~SkeletalModel();
60
     ~SkeletalModel();
61
     int getId();
61
     int getId();
62
 
62
 

+ 6
- 15
src/Game.cpp View File

36
 Game::Game() {
36
 Game::Game() {
37
     mLoaded = false;
37
     mLoaded = false;
38
     mName = NULL;
38
     mName = NULL;
39
-    mLara = 0;
39
+    mLara = -1;
40
     mTextureStart = 0;
40
     mTextureStart = 0;
41
     mTextureOffset = 0;
41
     mTextureOffset = 0;
42
 }
42
 }
395
     }
395
     }
396
 
396
 
397
     if (!cached) {
397
     if (!cached) {
398
-        getWorld().addSkeletalModel(*new SkeletalModel(mTombRaider /* ... */));
398
+        getWorld().addSkeletalModel(*new SkeletalModel(mTombRaider, index));
399
     }
399
     }
400
 
400
 
401
     getWorld().addEntity(*new Entity(mTombRaider, /* ... */ mod));
401
     getWorld().addEntity(*new Entity(mTombRaider, /* ... */ mod));
448
         }
448
         }
449
     }
449
     }
450
 
450
 
451
-    //! \fixme Check here and see if we already have one for object_id later
452
-    // if (getWorld().isCachedSkeletalModel(moveable[index].object_id))
453
-    // {
454
-    //   thing->modelId = getRender().add(sModel);
455
-    //   return;
456
-    // }
457
-
458
     skeletal_model_t *r_model = new skeletal_model_t;
451
     skeletal_model_t *r_model = new skeletal_model_t;
459
     r_model->id = moveable[index].object_id;
452
     r_model->id = moveable[index].object_id;
460
 
453
 
588
         return;
581
         return;
589
     }
582
     }
590
 
583
 
591
-    int aloop = mTombRaider.getNumAnimsForMoveable(index);
592
-
593
     //a = moveable[index].animation;
584
     //a = moveable[index].animation;
594
     //frame_offset = animation[a].frame_offset / 2;
585
     //frame_offset = animation[a].frame_offset / 2;
595
     //frame_step = animation[a].frame_size;
586
     //frame_step = animation[a].frame_size;
596
 
587
 
597
-    for (; a < aloop; ++a,
598
-            frame_offset = animation[a].frame_offset / 2,
599
-            frame_step = animation[a].frame_size)
600
-    {
588
+    for (; a < mTombRaider.getNumAnimsForMoveable(index); a++) {
589
+        frame_offset = animation[a].frame_offset / 2;
590
+        frame_step = animation[a].frame_size;
591
+
601
         animation_frame_t *animation_frame = new animation_frame_t;
592
         animation_frame_t *animation_frame = new animation_frame_t;
602
         r_model->animation.push_back(animation_frame);
593
         r_model->animation.push_back(animation_frame);
603
 
594
 

+ 1
- 1
src/SkeletalModel.cpp View File

58
     frame.push_back(&b);
58
     frame.push_back(&b);
59
 }
59
 }
60
 
60
 
61
-SkeletalModel::SkeletalModel() {
61
+SkeletalModel::SkeletalModel(TombRaider &tr, unsigned int index) {
62
 
62
 
63
 }
63
 }
64
 
64
 

Loading…
Cancel
Save