[Super-tux-commit] supertux/src gameloop.cpp,1.106,1.107
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-26 13:19:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9523 Modified Files: gameloop.cpp Log Message: - added more meaningfull savegame titles Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- gameloop.cpp 26 Apr 2004 12:48:33 -0000 1.106 +++ gameloop.cpp 26 Apr 2004 13:18:40 -0000 1.107 @@ -746,10 +746,21 @@ { char tmp[1024]; char slotfile[1024]; + std::string title; 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 (access(slotfile, F_OK) == 0) - sprintf(tmp,"Slot %d - Savegame",slot); + { + if (!title.empty()) + snprintf(tmp,1024,"Slot %d - %s",slot, title.c_str()); + else + snprintf(tmp, 1024,"Slot %d - Savegame",slot); + } else sprintf(tmp,"Slot %d - Free",slot); |