浏览代码

Added pos command

Thomas Buck 11 年前
父节点
当前提交
d8f8645b43
共有 1 个文件被更改,包括 14 次插入3 次删除
  1. 14
    3
      src/OpenRaider.cpp

+ 14
- 3
src/OpenRaider.cpp 查看文件

339
             getConsole().print("Invalid use of hop-command!");
339
             getConsole().print("Invalid use of hop-command!");
340
             return -20;
340
             return -20;
341
         }
341
         }
342
-    } else if (strcmp(command, "viewmodel") == 0)  {
342
+    } else if (strcmp(command, "viewmodel") == 0) {
343
         if (getGame().mLara) {
343
         if (getGame().mLara) {
344
             SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
344
             SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
345
             skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
345
             skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
347
                 smdl->setModel(mdl);
347
                 smdl->setModel(mdl);
348
         }
348
         }
349
         //m_render.ViewModel(LARA, atoi(cmd));
349
         //m_render.ViewModel(LARA, atoi(cmd));
350
+    } else if (strcmp(command, "pos") == 0) {
351
+        if (getGame().mLara) {
352
+            getConsole().print("Position:");
353
+            getConsole().print("  Room %i (0x%X)", getGame().mLara->room, getWorld().getRoomInfo(getGame().mLara->room));
354
+            getConsole().print("  %.1fx %.1fy %.1fz", getGame().mLara->pos[0], getGame().mLara->pos[1], getGame().mLara->pos[2]);
355
+            getConsole().print("  %.1f Yaw %.1f Pitch", OR_RAD_TO_DEG(getGame().mLara->angles[1]), OR_RAD_TO_DEG(getGame().mLara->angles[2]));
356
+        } else {
357
+            getConsole().print("Load a level to get Laras position!");
358
+            return -21;
359
+        }
350
     } else if (strcmp(command, "help") == 0) {
360
     } else if (strcmp(command, "help") == 0) {
351
         if (args->size() == 0) {
361
         if (args->size() == 0) {
352
             getConsole().print("Available commands:");
362
             getConsole().print("Available commands:");
362
             getConsole().print("  fog       - BOOL - GL Fog");
372
             getConsole().print("  fog       - BOOL - GL Fog");
363
             getConsole().print("  hop       - BOOL - Room hop");
373
             getConsole().print("  hop       - BOOL - Room hop");
364
             getConsole().print("  viewmodel - INT - Change Laras model");
374
             getConsole().print("  viewmodel - INT - Change Laras model");
375
+            getConsole().print("  pos       - Print position info");
365
             getConsole().print("  help      - print command help");
376
             getConsole().print("  help      - print command help");
366
             getConsole().print("  quit      - exit OpenRaider");
377
             getConsole().print("  quit      - exit OpenRaider");
367
             getConsole().print("Use help COMMAND to get additional info");
378
             getConsole().print("Use help COMMAND to get additional info");
369
             return help(args->at(0));
380
             return help(args->at(0));
370
         } else {
381
         } else {
371
             getConsole().print("Invalid use of help-command");
382
             getConsole().print("Invalid use of help-command");
372
-            return -21;
383
+            return -22;
373
         }
384
         }
374
     } else {
385
     } else {
375
         getConsole().print("Unknown command: %s ", command);
386
         getConsole().print("Unknown command: %s ", command);
376
-        return -22;
387
+        return -23;
377
     }
388
     }
378
 
389
 
379
     return 0;
390
     return 0;

正在加载...
取消
保存