void System::init_directories() { if (userdir.empty()) userdir = find_userdir(); std::string statdir = get_userdir(); // FIXME: We need a better seperation between user created levels, // FIXME: third party levels and levels from the base distri create_dir(statdir + "levels/dist"); create_dir(statdir + "themes/"); // Savegames (FIXME: rename to savegames/?) create_dir(statdir + "savegames/"); // User created images create_dir(statdir + "images/"); // Thumbnail cache create_dir(statdir + "cache/"); // Recorded demos will per default be writen in this directory create_dir(statdir + "demos/"); // User created images create_dir(statdir + "backup/"); // Screenshots will be dumped to that directory: create_dir(statdir + "screenshots/"); }
PhysfsSubsystem(const char* argv0, boost::optional<std::string> forced_datadir, boost::optional<std::string> forced_userdir) : m_forced_datadir(forced_datadir), m_forced_userdir(forced_userdir) { if (!PHYSFS_init(argv0)) { std::stringstream msg; msg << "Couldn't initialize physfs: " << PHYSFS_getLastError(); throw std::runtime_error(msg.str()); } else { // allow symbolic links PHYSFS_permitSymbolicLinks(1); find_userdir(); find_datadir(); } }