]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
Devtools: Add clotheslist cmd and fix devkeys in console
[lugaru.git] / Source / GameTick.cpp
index 82b75e54eb693d47db5ced0fc44bb3b01ca0d632..0b83cedef7f4e3853d76b4f4bd27118ceb94e6c6 100644 (file)
@@ -148,27 +148,6 @@ float musicvolume[4] = {};
 float oldmusicvolume[4] = {};
 int musicselected = 0;
 
-const char* rabbitskin[] = {
-    "Textures/Fur3.jpg",
-    "Textures/Fur.jpg",
-    "Textures/Fur2.jpg",
-    "Textures/Lynx.jpg",
-    "Textures/Otter.jpg",
-    "Textures/Opal.jpg",
-    "Textures/Sable.jpg",
-    "Textures/Chocolate.jpg",
-    "Textures/BW2.jpg",
-    "Textures/WB2.jpg"
-};
-
-const char* wolfskin[] = {
-    "Textures/Wolf.jpg",
-    "Textures/DarkWolf.jpg",
-    "Textures/SnowWolf.jpg"
-};
-
-const char** creatureskin[] = { rabbitskin, wolfskin };
-
 #define STATIC_ASSERT(x) extern int s_a_dummy[2 * (!!(x)) - 1];
 STATIC_ASSERT(rabbittype == 0 && wolftype == 1)
 
@@ -1043,18 +1022,6 @@ void Game::ProcessInput()
         printf("Stereo separation increased to %f\n", stereoseparation);
     }
 
-    /* Devtools */
-    if (devtools && !mainmenu) {
-        ProcessDevInput();
-    }
-}
-
-void Game::ProcessDevInput()
-{
-    if (!devtools || mainmenu) {
-        return;
-    }
-
     /* Console */
     if (Input::isKeyPressed(consolekey)) {
         console = !console;
@@ -1066,6 +1033,18 @@ void Game::ProcessDevInput()
         }
     }
 
+    /* Devtools */
+    if (devtools && !mainmenu && !console) {
+        ProcessDevInput();
+    }
+}
+
+void Game::ProcessDevInput()
+{
+    if (!devtools || mainmenu || console) {
+        return;
+    }
+
     if (Input::isKeyDown(SDL_SCANCODE_LALT)) {
         /* Enable editor */
         if (Input::isKeyPressed(SDL_SCANCODE_M) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
@@ -1213,7 +1192,7 @@ void Game::ProcessDevInput()
                 }
 
                 Person::players[closest]->skeleton.drawmodel.textureptr.load(
-                    creatureskin[Person::players[closest]->creature][Person::players[closest]->whichskin], 1,
+                    PersonType::types[Person::players[closest]->creature].skins[Person::players[closest]->whichskin], 1,
                     &Person::players[closest]->skeleton.skinText[0], &Person::players[closest]->skeleton.skinsize);
             }
 
@@ -1227,21 +1206,20 @@ void Game::ProcessDevInput()
                 closest = findClosestPlayer();
             }
 
-            // FIXME: Those proportions are buggy
             if (closest >= 0) {
                 if (Person::players[closest]->creature == rabbittype) {
                     Person::players[closest]->creature = wolftype;
                     Person::players[closest]->whichskin = 0;
                     Person::players[closest]->skeletonLoad();
-                    Person::players[closest]->scale = .23 * 5 * Person::players[0]->scale;
+                    Person::players[closest]->scale *= 1.15;
 
                     Person::players[closest]->damagetolerance = 300;
-                } else {
+                } else { // wolftype
                     Person::players[closest]->creature = rabbittype;
                     Person::players[closest]->whichskin = 0;
                     Person::players[closest]->skeletonLoad(true);
 
-                    Person::players[closest]->scale = .2 * 5 * Person::players[0]->scale;
+                    Person::players[closest]->scale /= 1.15;
 
                     Person::players[closest]->damagetolerance = 200;
                 }