浏览代码

Added particle, roommodel, entmodel, sprite commands

Thomas Buck 11 年前
父节点
当前提交
fdb0966aba
共有 2 个文件被更改,包括 74 次插入6 次删除
  1. 70
    2
      src/OpenRaider.cpp
  2. 4
    4
      src/Render.cpp

+ 70
- 2
src/OpenRaider.cpp 查看文件

437
             getConsole().print("Invalid use of upf-command!");
437
             getConsole().print("Invalid use of upf-command!");
438
             return -31;
438
             return -31;
439
         }
439
         }
440
+    } else if (strcmp(command, "particle") == 0) {
441
+        if (args->size() > 0) {
442
+            bool b;
443
+            if (readBool(args->at(0), &b) < 0) {
444
+                getConsole().print("Pass BOOL to particle command!");
445
+                return -32;
446
+            }
447
+            if (b)
448
+                getRender().setFlags(Render::fParticles);
449
+            else
450
+                getRender().clearFlags(Render::fParticles);
451
+            getConsole().print("Particles are now %s", b ? "on" : "off");
452
+        } else {
453
+            getConsole().print("Invalid use of particle-command!");
454
+            return -33;
455
+        }
456
+    } else if (strcmp(command, "sprite") == 0) {
457
+        if (args->size() > 0) {
458
+            bool b;
459
+            if (readBool(args->at(0), &b) < 0) {
460
+                getConsole().print("Pass BOOL to sprite command!");
461
+                return -34;
462
+            }
463
+            if (b)
464
+                getRender().setFlags(Render::fSprites);
465
+            else
466
+                getRender().clearFlags(Render::fSprites);
467
+            getConsole().print("Sprites are now %s", b ? "on" : "off");
468
+        } else {
469
+            getConsole().print("Invalid use of sprite-command!");
470
+            return -35;
471
+        }
472
+    } else if (strcmp(command, "roommodel") == 0) {
473
+        if (args->size() > 0) {
474
+            bool b;
475
+            if (readBool(args->at(0), &b) < 0) {
476
+                getConsole().print("Pass BOOL to roommodel command!");
477
+                return -36;
478
+            }
479
+            if (b)
480
+                getRender().setFlags(Render::fRoomModels);
481
+            else
482
+                getRender().clearFlags(Render::fRoomModels);
483
+            getConsole().print("Roommodels are now %s", b ? "on" : "off");
484
+        } else {
485
+            getConsole().print("Invalid use of roommodel-command!");
486
+            return -37;
487
+        }
488
+    } else if (strcmp(command, "entmodel") == 0) {
489
+        if (args->size() > 0) {
490
+            bool b;
491
+            if (readBool(args->at(0), &b) < 0) {
492
+                getConsole().print("Pass BOOL to entmodel command!");
493
+                return -38;
494
+            }
495
+            if (b)
496
+                getRender().setFlags(Render::fEntityModels);
497
+            else
498
+                getRender().clearFlags(Render::fEntityModels);
499
+            getConsole().print("Entmodels are now %s", b ? "on" : "off");
500
+        } else {
501
+            getConsole().print("Invalid use of entmodel-command!");
502
+            return -39;
503
+        }
440
     } else if (strcmp(command, "help") == 0) {
504
     } else if (strcmp(command, "help") == 0) {
441
         if (args->size() == 0) {
505
         if (args->size() == 0) {
442
             getConsole().print("Available commands:");
506
             getConsole().print("Available commands:");
458
             getConsole().print("  portal    - BOOL");
522
             getConsole().print("  portal    - BOOL");
459
             getConsole().print("  vis       - BOOL - Use Portals");
523
             getConsole().print("  vis       - BOOL - Use Portals");
460
             getConsole().print("  upf       - BOOL - Update Room List Per Frame");
524
             getConsole().print("  upf       - BOOL - Update Room List Per Frame");
525
+            getConsole().print("  particle  - BOOL");
526
+            getConsole().print("  sprite    - BOOL");
527
+            getConsole().print("  roommodel - BOOL");
528
+            getConsole().print("  entmodel  - BOOL");
461
             getConsole().print("  help      - print command help");
529
             getConsole().print("  help      - print command help");
462
             getConsole().print("  quit      - exit OpenRaider");
530
             getConsole().print("  quit      - exit OpenRaider");
463
             getConsole().print("Use help COMMAND to get additional info");
531
             getConsole().print("Use help COMMAND to get additional info");
465
             return help(args->at(0));
533
             return help(args->at(0));
466
         } else {
534
         } else {
467
             getConsole().print("Invalid use of help-command");
535
             getConsole().print("Invalid use of help-command");
468
-            return -32;
536
+            return -40;
469
         }
537
         }
470
     } else {
538
     } else {
471
         getConsole().print("Unknown command: %s ", command);
539
         getConsole().print("Unknown command: %s ", command);
472
-        return -33;
540
+        return -41;
473
     }
541
     }
474
 
542
 
475
     return 0;
543
     return 0;

+ 4
- 4
src/Render.cpp 查看文件

213
     //   note this is backwards b/c load screen is rendered upsidedown
213
     //   note this is backwards b/c load screen is rendered upsidedown
214
     //mEmitter = new Emitter(/*name*/"snow", size);
214
     //mEmitter = new Emitter(/*name*/"snow", size);
215
     mEmitter = new Emitter(name, size);
215
     mEmitter = new Emitter(name, size);
216
-    mEmitter->SetTextureId(snowTex1);
217
-    mEmitter->TextureId(120, 280, snowTex2);
218
-    mEmitter->TextureId(400, 450, snowTex2);
219
-    mEmitter->TextureId(500, 550, snowTex2);
216
+    mEmitter->SetTextureId(snowTex1 + 2); //! \fixme What's up with this +2 offset?
217
+    mEmitter->TextureId(120, 280, snowTex2 + 2);
218
+    mEmitter->TextureId(400, 450, snowTex2 + 2);
219
+    mEmitter->TextureId(500, 550, snowTex2 + 2);
220
 
220
 
221
     // Mongoose 2002.01.01, Varing force and speed should look
221
     // Mongoose 2002.01.01, Varing force and speed should look
222
     //   like varing mass/SA in wind, maybe
222
     //   like varing mass/SA in wind, maybe

正在加载...
取消
保存