[Super-tux-commit] supertux/src gameloop.cpp,1.108,1.109 lispreader.cpp,1.16,1.17 sprite_manager.cpp
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-26 15:03:33
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31545/src Modified Files: gameloop.cpp lispreader.cpp sprite_manager.cpp title.cpp worldmap.cpp Log Message: - removed st_abort() from lisp reader, client code should check the return value instead Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.63 retrieving revision 1.64 diff -u -d -r1.63 -r1.64 --- title.cpp 26 Apr 2004 14:15:49 -0000 1.63 +++ title.cpp 26 Apr 2004 15:03:24 -0000 1.64 @@ -364,3 +364,5 @@ delete logo; } +// EOF // + Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- worldmap.cpp 26 Apr 2004 13:38:48 -0000 1.55 +++ worldmap.cpp 26 Apr 2004 15:03:24 -0000 1.56 @@ -921,6 +921,12 @@ return; lisp_object_t* savegame = lisp_read_from_file(filename); + if (savegame) + { + std::cout << "WorldMap:loadgame: File not found: " << filename << std::endl; + return; + } + lisp_object_t* cur = savegame; if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-savegame") != 0) Index: sprite_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite_manager.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sprite_manager.cpp 26 Apr 2004 12:21:22 -0000 1.4 +++ sprite_manager.cpp 26 Apr 2004 15:03:24 -0000 1.5 @@ -38,6 +38,12 @@ SpriteManager::load_resfile(const std::string& filename) { lisp_object_t* root_obj = lisp_read_from_file(filename); + if (!root_obj) + { + std::cout << "SpriteManager: Couldn't load: " << filename << std::endl; + return; + } + lisp_object_t* cur = root_obj; if (strcmp(lisp_symbol(lisp_car(cur)), "supertux-resources") != 0) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- gameloop.cpp 26 Apr 2004 14:24:06 -0000 1.108 +++ gameloop.cpp 26 Apr 2004 15:03:23 -0000 1.109 @@ -750,9 +750,12 @@ sprintf(slotfile,"%s/slot%d.stsg",st_save_dir,slot); lisp_object_t* savegame = lisp_read_from_file(slotfile); - LispReader reader(lisp_cdr(savegame)); - reader.read_string("title", &title); - lisp_free(savegame); + if (savegame) + { + LispReader reader(lisp_cdr(savegame)); + reader.read_string("title", &title); + lisp_free(savegame); + } if (access(slotfile, F_OK) == 0) { Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- lispreader.cpp 26 Apr 2004 12:21:22 -0000 1.16 +++ lispreader.cpp 26 Apr 2004 15:03:24 -0000 1.17 @@ -1317,18 +1317,6 @@ if (has_suffix(filename.c_str(), ".gz")) { return lisp_read_from_gzfile(filename.c_str()); -#if 0 - lisp_object_t* obj = 0; - gzFile in = gzopen(filename, "r"); - - if (in) - { - lisp_stream_init_gzfile(&stream, in); - obj = lisp_read(&stream); - gzclose(in); - } - return obj; -#endif } else { @@ -1341,12 +1329,6 @@ obj = lisp_read(&stream); fclose(in); } - else { - std::cerr << "LispReader: File not found: " << filename << endl; - st_abort("aborting", ""); - } - - return obj; } |