"goal2-1.png"
"goal2-1.png"))
-
+ (tile (id 131)
+ (images "black.png"))
)
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)
{
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
{
obj = lisp_read(&stream);
fclose(in);
}
- else {
- std::cerr << "LispReader: File not found: " << filename << endl;
- st_abort("aborting", "");
- }
-
-
return obj;
}
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)
delete logo;
}
+// EOF //
+
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)