aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authorJames Brown2002-04-27 16:58:29 +0000
committerJames Brown2002-04-27 16:58:29 +0000
commit2b50dd27420654d3eeee7c163ec96aedc0478936 (patch)
tree1c9f8406ec52560777848b2a63692c0fec50e890 /main.cpp
parentd2fe8ce153ac764cf65a1ab4a895d57a150df116 (diff)
downloadscummvm-rg350-2b50dd27420654d3eeee7c163ec96aedc0478936.tar.gz
scummvm-rg350-2b50dd27420654d3eeee7c163ec96aedc0478936.tar.bz2
scummvm-rg350-2b50dd27420654d3eeee7c163ec96aedc0478936.zip
Add config file support. Thanks |Pixel| :)
svn-id: r4111
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.cpp b/main.cpp
index caae3d0f6e..188545d399 100644
--- a/main.cpp
+++ b/main.cpp
@@ -26,12 +26,15 @@
#include "gameDetector.h"
#include "gui.h"
#include "simon/simon.h"
+#include "config-file.h"
GameDetector detector;
Gui gui;
Scumm *g_scumm;
+Config * scummcfg;
+
#if defined(__APPLE__)
#include <SDL.h>
@@ -39,6 +42,8 @@ Scumm *g_scumm;
#undef main
#endif
+#define DEFAULT_CONFIG_FILE "scummvm.ini"
+
int main(int argc, char *argv[])
{
#if defined(MACOS)
@@ -74,7 +79,8 @@ int main(int argc, char *argv[])
fclose(argf);
#endif
-
+ scummcfg = new Config(DEFAULT_CONFIG_FILE, "scummvm");
+ scummcfg->set("versioninfo", SCUMMVM_VERSION);
if (detector.detectMain(argc, argv))
return (-1);
@@ -83,7 +89,7 @@ int main(int argc, char *argv[])
{
char *s = detector.getGameName();
system->property(OSystem::PROP_SET_WINDOW_CAPTION, (long)s);
- free(s);
+ Scumm::free(s);
}
/* Simon the Sorcerer? */
@@ -108,5 +114,7 @@ int main(int argc, char *argv[])
scumm->go();
}
+ delete scummcfg;
+
return 0;
}