Browse Source

Added fog command

Thomas Buck 11 years ago
parent
commit
35f3b223ef
1 changed files with 18 additions and 1 deletions
  1. 18
    1
      src/Game.cpp

+ 18
- 1
src/Game.cpp View File

324
             getConsole().print("  mode MODE");
324
             getConsole().print("  mode MODE");
325
             getConsole().print("  animate [BOOL|n|p]");
325
             getConsole().print("  animate [BOOL|n|p]");
326
             getConsole().print("  light BOOL");
326
             getConsole().print("  light BOOL");
327
+            getConsole().print("  fog BOOL");
327
         } else if (strcmp(args->at(1), "sound") == 0) {
328
         } else if (strcmp(args->at(1), "sound") == 0) {
328
             getConsole().print("game-sound-command Usage:");
329
             getConsole().print("game-sound-command Usage:");
329
             getConsole().print("  game sound INT");
330
             getConsole().print("  game sound INT");
371
             getConsole().print("Invalid use of game-light-command!");
372
             getConsole().print("Invalid use of game-light-command!");
372
             return -16;
373
             return -16;
373
         }
374
         }
375
+    } else if (strcmp(cmd, "fog") == 0) {
376
+        if (args->size() >= 2) {
377
+            bool b;
378
+            if (readBool(args->at(1), &b) < 0) {
379
+                getConsole().print("Pass BOOL to fog command!");
380
+                return -17;
381
+            }
382
+            if (b)
383
+                mRender->setFlags(Render::fFog);
384
+            else
385
+                mRender->clearFlags(Render::fFog);
386
+            getConsole().print("Fog is now %s", b ? "on" : "off");
387
+        } else {
388
+            getConsole().print("Invalid use of game-fog-command!");
389
+            return -18;
390
+        }
374
     } else {
391
     } else {
375
         getConsole().print("Invalid use of game-command (%s)!", cmd);
392
         getConsole().print("Invalid use of game-command (%s)!", cmd);
376
-        return -17;
393
+        return -19;
377
     }
394
     }
378
 
395
 
379
     return 0;
396
     return 0;

Loading…
Cancel
Save