Skip to content

Commit

Permalink
Fixing SuperTux crashes when compiled on Mac OS X 10.9
Browse files Browse the repository at this point in the history
  • Loading branch information
tobbi authored and Tobias Markus committed Jan 24, 2014
1 parent 05a40bd commit 82ee53f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/supertux/sector.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/supertux/world.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 3 additions & 2 deletions src/worldmap/worldmap.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 82ee53f

Please sign in to comment.