ソースを参照

Added viewmodel command

Thomas Buck 10年前
コミット
a00431e1cd
2個のファイルの変更24行の追加15行の削除
  1. 2
    2
      src/Console.cpp
  2. 22
    13
      src/OpenRaider.cpp

+ 2
- 2
src/Console.cpp ファイルの表示

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

+ 22
- 13
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)  {
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
     } else if (strcmp(command, "help") == 0) {
350
     } else if (strcmp(command, "help") == 0) {
343
         if (args->size() == 0) {
351
         if (args->size() == 0) {
344
             getConsole().print("Available commands:");
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
             getConsole().print("Use help COMMAND to get additional info");
367
             getConsole().print("Use help COMMAND to get additional info");
359
         } else if (args->size() == 1) {
368
         } else if (args->size() == 1) {
360
             return help(args->at(0));
369
             return help(args->at(0));

読み込み中…
キャンセル
保存