Procházet zdrojové kódy

Game::mLoaded now private

Thomas Buck před 11 roky
rodič
revize
8d34c76503
3 změnil soubory, kde provedl 18 přidání a 11 odebrání
  1. 4
    1
      include/Game.h
  2. 4
    0
      src/Game.cpp
  3. 10
    10
      src/OpenRaider.cpp

+ 4
- 1
include/Game.h Zobrazit soubor

28
 
28
 
29
     int initialize();
29
     int initialize();
30
 
30
 
31
+    bool isLoaded();
32
+
31
     int loadLevel(const char *level);
33
     int loadLevel(const char *level);
32
 
34
 
33
     void destroy();
35
     void destroy();
38
 
40
 
39
     //! \fixme should be private
41
     //! \fixme should be private
40
     entity_t *mLara;
42
     entity_t *mLara;
41
-    bool mLoaded;
42
 
43
 
43
 private:
44
 private:
44
 
45
 
54
     void setupTextureColor(texture_tri_t *r_tri, float *colorf);
55
     void setupTextureColor(texture_tri_t *r_tri, float *colorf);
55
 
56
 
56
     char *mName;
57
     char *mName;
58
+    bool mLoaded;
59
+
57
     TombRaider mTombRaider;
60
     TombRaider mTombRaider;
58
 
61
 
59
     unsigned int mTextureStart;
62
     unsigned int mTextureStart;

+ 4
- 0
src/Game.cpp Zobrazit soubor

74
     getSound().clear(); // Remove all previously loaded sounds
74
     getSound().clear(); // Remove all previously loaded sounds
75
 }
75
 }
76
 
76
 
77
+bool Game::isLoaded() {
78
+    return mLoaded;
79
+}
80
+
77
 int Game::loadLevel(const char *level) {
81
 int Game::loadLevel(const char *level) {
78
     if (mLoaded)
82
     if (mLoaded)
79
         destroy();
83
         destroy();

+ 10
- 10
src/OpenRaider.cpp Zobrazit soubor

176
         if (args->size() > 0) {
176
         if (args->size() > 0) {
177
             char *mode = args->at(0);
177
             char *mode = args->at(0);
178
             if (strcmp(mode, "wireframe") == 0) {
178
             if (strcmp(mode, "wireframe") == 0) {
179
-                if (getGame().mLoaded) {
179
+                if (getGame().isLoaded()) {
180
                     getRender().setMode(Render::modeWireframe);
180
                     getRender().setMode(Render::modeWireframe);
181
                     getConsole().print("Wireframe mode");
181
                     getConsole().print("Wireframe mode");
182
                 } else {
182
                 } else {
184
                     return -3;
184
                     return -3;
185
                 }
185
                 }
186
             } else if (strcmp(mode, "solid") == 0) {
186
             } else if (strcmp(mode, "solid") == 0) {
187
-                if (getGame().mLoaded) {
187
+                if (getGame().isLoaded()) {
188
                     getRender().setMode(Render::modeSolid);
188
                     getRender().setMode(Render::modeSolid);
189
                     getConsole().print("Solid mode");
189
                     getConsole().print("Solid mode");
190
                 } else {
190
                 } else {
192
                     return -4;
192
                     return -4;
193
                 }
193
                 }
194
             } else if (strcmp(mode, "texture") == 0) {
194
             } else if (strcmp(mode, "texture") == 0) {
195
-                if (getGame().mLoaded) {
195
+                if (getGame().isLoaded()) {
196
                     getRender().setMode(Render::modeTexture);
196
                     getRender().setMode(Render::modeTexture);
197
                     getConsole().print("Texture mode");
197
                     getConsole().print("Texture mode");
198
                 } else {
198
                 } else {
200
                     return -5;
200
                     return -5;
201
                 }
201
                 }
202
             } else if (strcmp(mode, "vertexlight") == 0) {
202
             } else if (strcmp(mode, "vertexlight") == 0) {
203
-                if (getGame().mLoaded) {
203
+                if (getGame().isLoaded()) {
204
                     getRender().setMode(Render::modeVertexLight);
204
                     getRender().setMode(Render::modeVertexLight);
205
                     getConsole().print("Vertexlight mode");
205
                     getConsole().print("Vertexlight mode");
206
                 } else {
206
                 } else {
224
             return -999;
224
             return -999;
225
         }
225
         }
226
         if (args->size() > 0) {
226
         if (args->size() > 0) {
227
-            if (getGame().mLoaded) {
227
+            if (getGame().isLoaded()) {
228
                 char *move = args->at(0);
228
                 char *move = args->at(0);
229
                 if (strcmp(move, "walk") == 0) {
229
                 if (strcmp(move, "walk") == 0) {
230
                     getGame().mLara->moveType = worldMoveType_walk;
230
                     getGame().mLara->moveType = worldMoveType_walk;
248
             return -11;
248
             return -11;
249
         }
249
         }
250
     } else if (strcmp(command, "sound") == 0) {
250
     } else if (strcmp(command, "sound") == 0) {
251
-        if ((!mRunning) || (!getGame().mLoaded)) {
251
+        if ((!mRunning) || (!getGame().isLoaded())) {
252
             getConsole().print("Use sound command interactively!");
252
             getConsole().print("Use sound command interactively!");
253
             return -999;
253
             return -999;
254
         }
254
         }
259
             return -12;
259
             return -12;
260
         }
260
         }
261
     } else if (strcmp(command, "animate") == 0) {
261
     } else if (strcmp(command, "animate") == 0) {
262
-        if ((!mRunning) || (!getGame().mLoaded)) {
262
+        if ((!mRunning) || (!getGame().isLoaded())) {
263
             getConsole().print("Use animate command interactively!");
263
             getConsole().print("Use animate command interactively!");
264
             return -999;
264
             return -999;
265
         }
265
         }
360
             return -20;
360
             return -20;
361
         }
361
         }
362
     } else if (strcmp(command, "viewmodel") == 0) {
362
     } else if (strcmp(command, "viewmodel") == 0) {
363
-        if ((!mRunning) || (!getGame().mLoaded)) {
363
+        if ((!mRunning) || (!getGame().isLoaded())) {
364
             getConsole().print("Use viewmodel command interactively!");
364
             getConsole().print("Use viewmodel command interactively!");
365
             return -999;
365
             return -999;
366
         }
366
         }
574
             return -45;
574
             return -45;
575
         }
575
         }
576
     } else if (strcmp(command, "pigtail") == 0) {
576
     } else if (strcmp(command, "pigtail") == 0) {
577
-        if ((!mRunning) || (!getGame().mLoaded)) {
577
+        if ((!mRunning) || (!getGame().isLoaded())) {
578
             getConsole().print("Use pigtail command interactively!");
578
             getConsole().print("Use pigtail command interactively!");
579
             return -999;
579
             return -999;
580
         }
580
         }
599
             return -47;
599
             return -47;
600
         }
600
         }
601
     } else if (strcmp(command, "ponypos") == 0) {
601
     } else if (strcmp(command, "ponypos") == 0) {
602
-        if ((!mRunning) || (!getGame().mLoaded)) {
602
+        if ((!mRunning) || (!getGame().isLoaded())) {
603
             getConsole().print("Use ponypos command interactively!");
603
             getConsole().print("Use ponypos command interactively!");
604
             return -999;
604
             return -999;
605
         }
605
         }

Loading…
Zrušit
Uložit