First step towards multiple tilesets per tilemap. Code is very inefficient for now...
[supertux.git] / src / sector.cpp
index cd4276b..c340ddb 100644 (file)
@@ -28,8 +28,7 @@
 #include <float.h>
 #include <math.h>
 #include <limits>
-//#include <physfs.h>
-#include <unison/vfs/FileSystem.hpp>
+#include <physfs.h>
 
 #include "sector.hpp"
 #include "object/player.hpp"
@@ -178,6 +177,9 @@ Sector::parse_object(const std::string& name, const lisp::Lisp& reader)
 void
 Sector::parse(const lisp::Lisp& sector)
 {
+
+  TileMap::loading_worldmap = false;
+
   bool has_background = false;
   lisp::ListIterator iter(&sector);
   while(iter.next()) {
@@ -237,6 +239,9 @@ Sector::parse(const lisp::Lisp& sector)
 void
 Sector::parse_old_format(const lisp::Lisp& reader)
 {
+
+  TileMap::loading_worldmap = false;
+
   name = "main";
   reader.get("gravity", gravity);
 
@@ -246,7 +251,7 @@ Sector::parse_old_format(const lisp::Lisp& reader)
     if (backgroundimage == "arctis2.jpg") backgroundimage = "arctis.jpg";
     if (backgroundimage == "ocean.png") backgroundimage = "ocean.jpg";
     backgroundimage = "images/background/" + backgroundimage;
-    if (!Unison::VFS::FileSystem::get().exists(backgroundimage)) {
+    if (!PHYSFS_exists(backgroundimage.c_str())) {
       log_warning << "Background image \"" << backgroundimage << "\" not found. Ignoring." << std::endl;
       backgroundimage = "";
     }