diff options
author | Alexander Baldeck <alexander@archlinux.org> | 2004-12-26 11:39:53 +0000 |
---|---|---|
committer | Alexander Baldeck <alexander@archlinux.org> | 2004-12-26 11:39:53 +0000 |
commit | 72a1107e594b1745026241d323f9fc44813bd91d (patch) | |
tree | 3c9760598495c373582659a18df322ab01a94778 /src/main.cpp | |
parent | 0c9ef7743aab89249f8fafdb44e362178fba988f (diff) | |
download | mana-72a1107e594b1745026241d323f9fc44813bd91d.tar.gz mana-72a1107e594b1745026241d323f9fc44813bd91d.tar.bz2 mana-72a1107e594b1745026241d323f9fc44813bd91d.tar.xz mana-72a1107e594b1745026241d323f9fc44813bd91d.zip |
- replaced default ini creation routine with new system
- testing version of write support for config system
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/src/main.cpp b/src/main.cpp index 120fb881..68f5cb2a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -173,25 +173,32 @@ void init_engine() { if ( tmwFile == NULL ) { printf("Can't create %s file. Using Defaults.\n", dir); } else { + fclose(tmwFile); // tmw.ini creation - fprintf(tmwFile, "system=\nkeyboard=en\nlanguage=\ncore_version=" CORE_VERSION "\n\n"); - fprintf(tmwFile, "host=animesites.de\nport=6901\n\n"); - fprintf(tmwFile, "#=Screen mode:\n# = 1 Fullscreen\n# = 2 Windowed\nscreen=2\n"); - fprintf(tmwFile, "# = Sound:\n#=1 enabled\n# = 0 disabled\nsound=0\n"); + config.setValue("system", ""); + config.setValue("keyboard", "en"); + config.setValue("language", ""); + config.setValue("core_version", CORE_VERSION); + + + config.setValue("host", "animesites.de"); + config.setValue("port", 6901); + config.setValue("screen", 1); + config.setValue("sound", 1); + - char * chatlogFilename = new char [400]; #ifdef __USE_UNIX98 + char * chatlogFilename = new char [400]; sprintf(chatlogFilename, "%s/.manaworld/chatlog.txt", userHome); + config.setValue("chatlog", chatlogFilename); + delete chatlogFilename; #else - strcpy(chatlogFilename, "chatlog.txt"); + config.setValue("chatlog", "chatlog.txt"); #endif - fprintf(tmwFile, "# = Chat logfile location:\nchatlog=%s\n", chatlogFilename); - delete chatlogFilename; chatlogFilename = 0; - fprintf(tmwFile, "#= Display strecth mode:\n# = 0 Disabled (Test only)\n# = 1 Normal\n# = 2 SuperEagle\n"); - fprintf(tmwFile, "stretch=1\n\n"); - fprintf(tmwFile, "[login]\nremember=1\nusername=Player\n"); - fclose(tmwFile); + config.setValue("stretch", 1); + config.setValue("remember", 1); + config.setValue("username", "Player"); } } |