Fixing SuperTux crashes when compiled on Mac OS X 10.9
authorTobias Markus <tobbi@mozilla-uk.org>
Fri, 1 Nov 2013 16:31:17 +0000 (17:31 +0100)
committerTobias Markus <tobiasmarkus1@tobiass-mbp.fritz.box>
Fri, 24 Jan 2014 21:56:52 +0000 (22:56 +0100)
src/supertux/sector.cpp
src/supertux/world.cpp
src/worldmap/worldmap.cpp

index 2355fbc..0add01f 100644 (file)
@@ -45,7 +45,7 @@
 #include "object/snow_particle_system.hpp"
 #include "object/text_object.hpp"
 #include "object/tilemap.hpp"
-#include "physfs/ifile_stream.hpp"
+#include "physfs/ifile_streambuf.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "supertux/collision.hpp"
 #include "supertux/constants.hpp"
@@ -615,7 +615,8 @@ Sector::activate(const Vector& player_pos)
   std::string basedir = FileSystem::dirname(get_level()->filename);
   if(PHYSFS_exists((basedir + "/info").c_str())) {
     try {
-      IFileStream in(basedir + "/default.nut");
+      IFileStreambuf ins(basedir + "/default.nut");
+      std::istream in(&ins);
       run_script(in, "default.nut");
     } catch(std::exception& ) {
       // doesn't exist or erroneous; do nothing
index f821dd4..d1fe91e 100644 (file)
@@ -18,7 +18,7 @@
 
 #include "lisp/parser.hpp"
 #include "lisp/writer.hpp"
-#include "physfs/ifile_stream.hpp"
+#include "physfs/ifile_streambuf.hpp"
 #include "scripting/serialize.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "supertux/globals.hpp"
@@ -143,7 +143,8 @@ World::run()
 
   std::string filename = basedir + "/world.nut";
   try {
-    IFileStream in(filename);
+    IFileStreambuf ins(filename);
+    std::istream in(&ins);
 
     sq_release(global_vm, &world_thread);
     world_thread = create_thread(global_vm);
index 339e4e7..3061a95 100644 (file)
@@ -39,7 +39,7 @@
 #include "object/background.hpp"
 #include "object/decal.hpp"
 #include "object/tilemap.hpp"
-#include "physfs/ifile_stream.hpp"
+#include "physfs/ifile_streambuf.hpp"
 #include "scripting/squirrel_error.hpp"
 #include "scripting/squirrel_util.hpp"
 #include "sprite/sprite.hpp"
@@ -927,7 +927,8 @@ WorldMap::setup()
 
   //Run default.nut just before init script
   try {
-    IFileStream in(levels_path + "/default.nut");
+    IFileStreambuf ins(levels_path + "default.nut");
+    std::istream in(&ins);
     run_script(in, "WorldMap::default.nut");
   } catch(std::exception& ) {
     // doesn't exist or erroneous; do nothing