Browse Source

Game::mLoaded now private

Thomas Buck 10 years ago
parent
commit
8d34c76503
3 changed files with 18 additions and 11 deletions
  1. 4
    1
      include/Game.h
  2. 4
    0
      src/Game.cpp
  3. 10
    10
      src/OpenRaider.cpp

+ 4
- 1
include/Game.h View File

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

+ 4
- 0
src/Game.cpp View File

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

+ 10
- 10
src/OpenRaider.cpp View File

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

Loading…
Cancel
Save