Add config file support. Thanks |Pixel| :)

svn-id: r4111
This commit is contained in:
James Brown 2002-04-27 16:58:29 +00:00
parent d2fe8ce153
commit 2b50dd2742
8 changed files with 196 additions and 64 deletions

View file

@ -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;
}