diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-26 21:51:01 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2006-11-26 21:51:01 +0000 |
commit | a8a90f2df98e13971566af63567e31da4666b1c9 (patch) | |
tree | dfabbaf186faeb262f72948aea94b1ad160420a4 /src/main.cpp | |
parent | 42f18ad42f3b908d6af849a74273a58840fa67a1 (diff) | |
download | mana-a8a90f2df98e13971566af63567e31da4666b1c9.tar.gz mana-a8a90f2df98e13971566af63567e31da4666b1c9.tar.bz2 mana-a8a90f2df98e13971566af63567e31da4666b1c9.tar.xz mana-a8a90f2df98e13971566af63567e31da4666b1c9.zip |
Higher precision log timestamps, some more logging and support for TGA images.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/main.cpp b/src/main.cpp index 0faf5c12..f1a4ed88 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -137,17 +137,6 @@ struct Options */ void init_engine(const Options &options) { - // Initialize SDL - if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { - std::cerr << "Could not initialize SDL: " << - SDL_GetError() << std::endl; - exit(1); - } - atexit(SDL_Quit); - - SDL_EnableUNICODE(1); - SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); - std::string homeDir = ""; #if !(defined __USE_UNIX98 || defined __FreeBSD__) // In Windows and other systems we currently store data next to executable. @@ -169,6 +158,18 @@ void init_engine(const Options &options) // Set log file logger->setLogFile(homeDir + std::string("/tmw.log")); + // Initialize SDL + logger->log("Initializing SDL..."); + if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER) < 0) { + std::cerr << "Could not initialize SDL: " << + SDL_GetError() << std::endl; + exit(1); + } + atexit(SDL_Quit); + + SDL_EnableUNICODE(1); + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL); + ResourceManager *resman = ResourceManager::getInstance(); if (!resman->setWriteDir(homeDir)) { @@ -195,6 +196,7 @@ void init_engine(const Options &options) resman->addToSearchPath(TMW_DATADIR "data", true); // Fill configuration with defaults + logger->log("Initializing configuration..."); config.setValue("host", "animesites.de"); config.setValue("port", 6901); config.setValue("hwaccel", 0); |