Ver código fonte

Added viewmodel command

Thomas Buck 10 anos atrás
pai
commit
a00431e1cd
2 arquivos alterados com 24 adições e 15 exclusões
  1. 2
    2
      src/Console.cpp
  2. 22
    13
      src/OpenRaider.cpp

+ 2
- 2
src/Console.cpp Ver arquivo

@@ -139,14 +139,14 @@ void Console::handleKeyboard(KeyboardButton key, bool pressed) {
139 139
     if (pressed && (key == enter)) {
140 140
         // Execute entered command
141 141
         if ((mInputBufferPointer > 0) && (mInputBuffer[0] != '\0')) {
142
-            mHistory.push_back(bufferString("> %s", mInputBuffer));
142
+            print("> %s", mInputBuffer);
143 143
             mCommandHistory.push_back(bufferString("%s", mInputBuffer));
144 144
             int error = getOpenRaider().command(mInputBuffer);
145 145
             if (error != 0) {
146 146
                 print("Error Code: %d", error);
147 147
             }
148 148
         } else {
149
-            mHistory.push_back(bufferString("> "));
149
+            print("> ");
150 150
         }
151 151
 
152 152
         // Clear partial and input buffer

+ 22
- 13
src/OpenRaider.cpp Ver arquivo

@@ -339,22 +339,31 @@ int OpenRaider::command(const char *command, std::vector<char *> *args) {
339 339
             getConsole().print("Invalid use of hop-command!");
340 340
             return -20;
341 341
         }
342
+    } else if (strcmp(command, "viewmodel") == 0)  {
343
+        if (getGame().mLara) {
344
+            SkeletalModel *smdl = static_cast<SkeletalModel *>(getGame().mLara->tmpHook);
345
+            skeletal_model_t *mdl = getWorld().getModel(atoi(args->at(0)));
346
+            if (smdl)
347
+                smdl->setModel(mdl);
348
+        }
349
+        //m_render.ViewModel(LARA, atoi(cmd));
342 350
     } else if (strcmp(command, "help") == 0) {
343 351
         if (args->size() == 0) {
344 352
             getConsole().print("Available commands:");
345
-            getConsole().print("  load    - load a level");
346
-            getConsole().print("  set     - set a parameter");
347
-            getConsole().print("  bind    - bind a keyboard/mouse action");
348
-            getConsole().print("  sshot   - make a screenshot");
349
-            getConsole().print("  move    - [walk|fly|noclip]");
350
-            getConsole().print("  sound   - INT - Test play sound");
351
-            getConsole().print("  mode    - MODE - Render mode");
352
-            getConsole().print("  animate - [BOOL|n|p] - Animate models");
353
-            getConsole().print("  light   - BOOL - GL Lights");
354
-            getConsole().print("  fog     - BOOL - GL Fog");
355
-            getConsole().print("  hop     - BOOL - Room hop");
356
-            getConsole().print("  help    - print command help");
357
-            getConsole().print("  quit    - exit OpenRaider");
353
+            getConsole().print("  load      - load a level");
354
+            getConsole().print("  set       - set a parameter");
355
+            getConsole().print("  bind      - bind a keyboard/mouse action");
356
+            getConsole().print("  sshot     - make a screenshot");
357
+            getConsole().print("  move      - [walk|fly|noclip]");
358
+            getConsole().print("  sound     - INT - Test play sound");
359
+            getConsole().print("  mode      - MODE - Render mode");
360
+            getConsole().print("  animate   - [BOOL|n|p] - Animate models");
361
+            getConsole().print("  light     - BOOL - GL Lights");
362
+            getConsole().print("  fog       - BOOL - GL Fog");
363
+            getConsole().print("  hop       - BOOL - Room hop");
364
+            getConsole().print("  viewmodel - INT - Change Laras model");
365
+            getConsole().print("  help      - print command help");
366
+            getConsole().print("  quit      - exit OpenRaider");
358 367
             getConsole().print("Use help COMMAND to get additional info");
359 368
         } else if (args->size() == 1) {
360 369
             return help(args->at(0));

Carregando…
Cancelar
Salvar