]> git.jsancho.org Git - lugaru.git/blobdiff - Source/Devtools/ConsoleCmds.cpp
Cleaned up a bit Tutorial::active ifs in Person
[lugaru.git] / Source / Devtools / ConsoleCmds.cpp
index 6b30e3f038d6ae08b0d162bb3c73263ab3cd31c6..57e9f4a8b78150eaefd7fa4b2469bdff77db183f 100644 (file)
@@ -24,6 +24,7 @@ along with Lugaru.  If not, see <http://www.gnu.org/licenses/>.
 #include "Level/Dialog.hpp"
 #include "Level/Hotspot.hpp"
 #include "Utils/Folders.hpp"
+#include "Tutorial.hpp"
 
 const char *cmd_names[cmd_count] = {
 #define DECLARE_COMMAND(cmd) #cmd,
@@ -49,10 +50,8 @@ extern int environment;
 extern float fadestart;
 extern float slomospeed;
 extern float slomofreq;
-extern int tutoriallevel;
 extern int hostile;
 extern int maptype;
-extern Objects objects;
 extern int slomo;
 extern float slomodelay;
 extern bool skyboxtexture;
@@ -210,11 +209,11 @@ void ch_save(const char *args)
 
     fpackf(tfile, "Bi", environment);
 
-    fpackf(tfile, "Bi", objects.numobjects);
+    fpackf(tfile, "Bi", Object::objects.size());
 
-    for (int k = 0; k < objects.numobjects; k++)
-        fpackf(tfile, "Bi Bf Bf Bf Bf Bf Bf", objects.type[k], objects.yaw[k], objects.pitch[k],
-               objects.position[k].x, objects.position[k].y, objects.position[k].z, objects.scale[k]);
+    for (int k = 0; k < Object::objects.size(); k++)
+        fpackf(tfile, "Bi Bf Bf Bf Bf Bf Bf", Object::objects[k]->type, Object::objects[k]->yaw, Object::objects[k]->pitch,
+               Object::objects[k]->position.x, Object::objects[k]->position.y, Object::objects[k]->position.z, Object::objects[k]->scale);
 
     fpackf(tfile, "Bi", Hotspot::hotspots.size());
     for (unsigned i = 0; i < Hotspot::hotspots.size(); i++) {
@@ -505,7 +504,7 @@ void ch_sizemin(const char *args)
 
 void ch_tutorial(const char *args)
 {
-    tutoriallevel = atoi(args);
+    Tutorial::active = atoi(args);
 }
 
 void ch_hostile(const char *args)
@@ -717,7 +716,7 @@ void ch_skytint(const char *args)
     SetUpLighting();
 
     terrain.DoShadows();
-    objects.DoShadows();
+    Object::DoShadows();
 }
 
 void ch_skylight(const char *args)
@@ -727,7 +726,7 @@ void ch_skylight(const char *args)
     SetUpLighting();
 
     terrain.DoShadows();
-    objects.DoShadows();
+    Object::DoShadows();
 }
 
 void ch_skybox(const char *args)
@@ -737,5 +736,5 @@ void ch_skybox(const char *args)
     SetUpLighting();
 
     terrain.DoShadows();
-    objects.DoShadows();
+    Object::DoShadows();
 }