// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
-
#include <config.h>
#include <sstream>
#include <stdexcept>
#include <assert.h>
#include <unistd.h>
-#include "app/setup.h"
#include "level.h"
#include "resources.h"
-#include "app/globals.h"
+#include "file_system.h"
#include "video/surface.h"
#include "level_subset.h"
#include "lisp/parser.h"
#include "lisp/lisp.h"
-using namespace SuperTux;
-
static bool has_suffix(const std::string& data, const std::string& suffix)
{
if (data.length() >= suffix.length())
throw new std::runtime_error(msg.str());
}
+ // test is a worldmap exists
+ has_worldmap = false;
+ std::string worldmap = get_resource_filename(
+ std::string("levels/") + subset + "/worldmap.stwm");
+ if(worldmap != "") {
+ has_worldmap = true;
+ }
+
if (levels.empty())
{ // Level info file doesn't define any levels, so read the
// directory to see what we can find
filename = datadir + "/levels/" + subset + "/";
files = FileSystem::read_directory(filename);
- filename = st_dir + "/levels/" + subset + "/";
+ filename = user_dir + "/levels/" + subset + "/";
std::set<std::string> user_files = FileSystem::read_directory(filename);
files.insert(user_files.begin(), user_files.end());
filename = "/levels/" + name + "/";
FileSystem::fcreatedir(filename.c_str());
- filename = std::string(st_dir) + "/levels/" + name + "/info";
+ filename = std::string(user_dir) + "/levels/" + name + "/info";
if(!FileSystem::fwriteable(filename.c_str()))
filename = datadir + "/levels/" + name + "/info";
if(FileSystem::fwriteable(filename.c_str()))
return levels[num];
}
+std::string
+LevelSubset::get_worldmap_filename()
+{
+ return std::string("/levels/" + name + "/worldmap.stwm");
+}
+
int
LevelSubset::get_num_levels() const
{