From 0c8c4d490893907237facd931d1ad8e651089f7d Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Tue, 1 Mar 2005 19:49:51 +0000 Subject: Changed tmw.ini to config.xml which is read/written using libxml2. --- src/main.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 4b5b745c..45d223d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #ifdef USE_OPENGL #include @@ -133,7 +134,7 @@ void init_engine() #ifndef __USE_UNIX98 // WIN32 and others - strcpy(dir, "tmw.ini"); + strcpy(dir, "config.xml"); #else // UNIX char *userHome; @@ -162,10 +163,10 @@ void init_engine() printf("%s can't be made... And doesn't exist ! Exitting ...", dir); exit(1); } - sprintf(dir, "%s/.manaworld/tmw.ini", userHome); + sprintf(dir, "%s/.manaworld/config.xml", userHome); #endif - // Checking if the tmw.ini file exists... otherwise creates it with + // Checking if the configuration file exists... otherwise creates it with // default options ! FILE *tmwFile = 0; tmwFile = fopen(dir, "r"); @@ -180,7 +181,7 @@ void init_engine() } else { fclose(tmwFile); - // Fill tmw.ini with defaults + // Fill configuration with defaults config.setValue("host", "animesites.de"); config.setValue("port", 6901); config.setValue("hwaccel", 0); @@ -195,7 +196,6 @@ void init_engine() config.setValue("chatlog", "chatlog.txt"); #endif config.setValue("remember", 1); - config.setValue("username", "Player"); config.write(dir); } @@ -315,6 +315,10 @@ void exit_engine() SAFE_DELETE_ARRAY(dir); SAFE_DELETE(gui); SAFE_DELETE(graphics); + + // Shutdown libxml + xmlCleanupParser(); + ResourceManager::deleteInstance(); } @@ -323,6 +327,7 @@ int main(int argc, char *argv[]) { // Initialize libxml2 and check for potential ABI mismatches between // compiled version and the shared library actually used. + xmlInitParser(); LIBXML_TEST_VERSION; // Initialize PhysicsFS -- cgit v1.2.3-70-g09d2