From 76c43cddb2464673f0d2041ec6de90b87be02bdf Mon Sep 17 00:00:00 2001 From: krzys-h Date: Sun, 24 Jan 2016 21:31:45 +0100 Subject: [PATCH] Rename CSoundInterface::AddMusicFiles to CacheCommonMusic --- src/app/app.cpp | 2 +- src/app/main.cpp | 8 +++++--- src/app/system.cpp | 2 +- src/sound/sound.cpp | 2 +- src/sound/sound.h | 2 +- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/app/app.cpp b/src/app/app.cpp index 10baa731..a12057b5 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -457,7 +457,7 @@ bool CApplication::Create() m_sound->Create(); m_sound->CacheAll(); - m_sound->AddMusicFiles(); + m_sound->CacheCommonMusic(); GetLogger()->Info("CApplication created successfully\n"); diff --git a/src/app/main.cpp b/src/app/main.cpp index 7d3e6656..ecfd2530 100644 --- a/src/app/main.cpp +++ b/src/app/main.cpp @@ -93,6 +93,11 @@ int main(int argc, char *argv[]) { CLogger logger; // single instance of logger + auto systemUtils = CSystemUtils::Create(); // platform-specific utils + systemUtils->Init(); + + logger.SetOutputFile(systemUtils->GetSaveDir() + "/log.txt"); + // Workaround for character encoding in argv on Windows #if PLATFORM_WINDOWS int wargc = 0; @@ -124,9 +129,6 @@ int main(int argc, char *argv[]) logger.Info("%s starting\n", COLOBOT_FULLNAME); - auto systemUtils = CSystemUtils::Create(); // platform-specific utils - systemUtils->Init(); - CSignalHandlers::Init(systemUtils.get()); CResourceManager manager(argv[0]); diff --git a/src/app/system.cpp b/src/app/system.cpp index 01450c4a..2b0e1591 100644 --- a/src/app/system.cpp +++ b/src/app/system.cpp @@ -193,5 +193,5 @@ std::string CSystemUtils::GetLangPath() std::string CSystemUtils::GetSaveDir() { - return std::string("save"); + return std::string("saves"); } diff --git a/src/sound/sound.cpp b/src/sound/sound.cpp index fb10d2f4..307f93dc 100644 --- a/src/sound/sound.cpp +++ b/src/sound/sound.cpp @@ -54,7 +54,7 @@ void CSoundInterface::CacheAll() } } -void CSoundInterface::AddMusicFiles() +void CSoundInterface::CacheCommonMusic() { CacheMusic("music/Intro1.ogg"); CacheMusic("music/Intro2.ogg"); diff --git a/src/sound/sound.h b/src/sound/sound.h index cb37e08b..29ce576b 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -73,7 +73,7 @@ public: void CacheAll(); /** Function called to add all music files to list */ - void AddMusicFiles(); + void CacheCommonMusic(); /** Function called to cache sound effect file. * This function is called by plugin interface for each file.