// 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 <cassert>
#include <cstdio>
#include <iostream>
#include <cctype>
-#include "../app/globals.h"
-#include "../app/setup.h"
-#include "../video/screen.h"
-#include "../video/surface.h"
-#include "../gui/menu.h"
-#include "../utils/configfile.h"
-#include "../audio/sound_manager.h"
-#include "../app/gettext.h"
+#include "globals.h"
+#include "setup.h"
+#include "video/screen.h"
+#include "video/surface.h"
+#include "gui/menu.h"
+#include "utils/configfile.h"
+#include "audio/sound_manager.h"
+#include "gettext.h"
using namespace SuperTux;
{
return false;
}
+ fclose(fi);
return true;
}
return sdirs;
}
-void Setup::info(const std::string& _package_name, const std::string& _package_symbol_name, const std::string& _package_version)
+void Setup::init(const std::string& _package_name,
+ const std::string& _package_symbol_name,
+ const std::string& _package_version)
{
-package_name = _package_name;
-package_symbol_name = _package_symbol_name;
-package_version = _package_version;
+ package_name = _package_name;
+ package_symbol_name = _package_symbol_name;
+ package_version = _package_version;
+
+ directories();
+ dictionary_manager.add_directory(datadir + "/locale");
}
/* --- SETUP --- */
/* Set SuperTux configuration and save directories */
-void Setup::directories(void)
+void Setup::directories()
{
std::string home;
/* Get home directory (from $HOME variable)... if we can't determine it,
mkdir((st_dir + "/levels").c_str(), 0755);
+ // try current directory as datadir
+ if(datadir.empty()) {
+ if(FileSystem::faccessible("./data/intro.txt"))
+ datadir = "./data";
+ }
+
// User has not that a datadir, so we try some magic
if (datadir.empty())
{