From: Tobias Markus Date: Fri, 1 Nov 2013 16:31:17 +0000 (+0100) Subject: Fixing SuperTux crashes when compiled on Mac OS X 10.9 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=08bddcf4d4fbe2edf9a0078dc6f3c3275ef05302;p=supertux.git Fixing SuperTux crashes when compiled on Mac OS X 10.9 --- diff --git a/src/supertux/sector.cpp b/src/supertux/sector.cpp index 2355fbc3f..0add01f00 100644 --- a/src/supertux/sector.cpp +++ b/src/supertux/sector.cpp @@ -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 diff --git a/src/supertux/world.cpp b/src/supertux/world.cpp index f821dd4a4..d1fe91e7f 100644 --- a/src/supertux/world.cpp +++ b/src/supertux/world.cpp @@ -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); diff --git a/src/worldmap/worldmap.cpp b/src/worldmap/worldmap.cpp index 339e4e729..3061a9527 100644 --- a/src/worldmap/worldmap.cpp +++ b/src/worldmap/worldmap.cpp @@ -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