Removed a few things from svn:ignore that are no longer needed to to switch to Cmake
[supertux.git] / src / title.cpp
index 3778b17..6c0c095 100644 (file)
@@ -30,9 +30,9 @@
 #include <errno.h>
 #include <unistd.h>
 #include <SDL.h>
-//#include <SDL_image.h>
-//#include <physfs.h>
-#include <unison/vfs/FileSystem.hpp>
+#include <SDL_image.h>
+#include <physfs.h>
+#include <algorithm>
 
 #include "title.hpp"
 #include "mainloop.hpp"
@@ -106,20 +106,13 @@ TitleScreen::generate_contrib_menu()
 {
   /** Generating contrib levels list by making use of Level Subset  */
   std::vector<std::string> level_worlds;
-  std::vector<std::string> files = Unison::VFS::FileSystem::get().ls("levels/");
-  for(std::vector<std::string>::iterator iter = files.begin();iter != files.end();++iter)
-  {
-    std::string filepath = "levels/" + *iter;
-    if(Unison::VFS::FileSystem::get().is_dir(filepath))
-      level_worlds.push_back(filepath);
-  }
-  /*char** files = PHYSFS_enumerateFiles("levels/");
+  char** files = PHYSFS_enumerateFiles("levels/");
   for(const char* const* filename = files; *filename != 0; ++filename) {
     std::string filepath = std::string("levels/") + *filename;
     if(PHYSFS_isDirectory(filepath.c_str()))
       level_worlds.push_back(filepath);
   }
-  PHYSFS_freeList(files);*/
+  PHYSFS_freeList(files);
 
   free_contrib_menu();
   contrib_menu.reset(new Menu());
@@ -540,8 +533,7 @@ TitleScreen::get_slotinfo(int slot)
   stream << "save/" << worlddirname << "_" << slot << ".stsg";
   std::string slotfile = stream.str();
 
-  if(Unison::VFS::FileSystem::get().exists(slotfile))
-  {
+  try {
     lisp::Parser parser;
     const lisp::Lisp* root = parser.parse(slotfile);
 
@@ -550,9 +542,7 @@ TitleScreen::get_slotinfo(int slot)
       throw std::runtime_error("file is not a supertux-savegame.");
 
     savegame->get("title", title);
-  }
-  else
-  {
+  } catch(std::exception& ) {
     std::ostringstream slottitle;
     slottitle << _("Slot") << " " << slot << " - " << _("Free");
     return slottitle.str();