]> git.jsancho.org Git - lugaru.git/blobdiff - Source/GameTick.cpp
CMake: Define build type before configuring version header
[lugaru.git] / Source / GameTick.cpp
index a0bb4b3928dddfc767f48ef7ed760dcdd9a4c267..e737a4e95f3799cf42c9b3f33cdddbeb3c91bf72 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)
 
@@ -1045,27 +1024,30 @@ void Game::ProcessInput()
 
     /* Devtools */
     if (devtools && !mainmenu) {
-        ProcessDevInput();
+        /* Console */
+        if (Input::isKeyPressed(consolekey)) {
+            console = !console;
+            if (console) {
+                OPENAL_SetFrequency(OPENAL_ALL);
+            } else {
+                freeze = 0;
+                waiting = false;
+            }
+        }
+
+        /* Other devtools, disabled when the console is shown */
+        if (!console) {
+            ProcessDevInput();
+        }
     }
 }
 
 void Game::ProcessDevInput()
 {
-    if (!devtools || mainmenu) {
+    if (!devtools || mainmenu || console) {
         return;
     }
 
-    /* Console */
-    if (Input::isKeyPressed(consolekey)) {
-        console = !console;
-        if (console) {
-            OPENAL_SetFrequency(OPENAL_ALL);
-        } else {
-            freeze = 0;
-            waiting = false;
-        }
-    }
-
     if (Input::isKeyDown(SDL_SCANCODE_LALT)) {
         /* Enable editor */
         if (Input::isKeyPressed(SDL_SCANCODE_M) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) {
@@ -1213,7 +1195,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);
             }