Merge branch 'master' into dev

dev-time-step
krzys-h 2016-04-02 23:55:32 +02:00
commit 02633e32c3
2 changed files with 12 additions and 5 deletions

View File

@ -13,7 +13,7 @@ project(colobot C CXX)
set(COLOBOT_VERSION_CODENAME "Gold") set(COLOBOT_VERSION_CODENAME "Gold")
set(COLOBOT_VERSION_MAJOR 0) set(COLOBOT_VERSION_MAJOR 0)
set(COLOBOT_VERSION_MINOR 1) set(COLOBOT_VERSION_MINOR 1)
set(COLOBOT_VERSION_REVISION 7) set(COLOBOT_VERSION_REVISION 7b)
# Used on official releases # Used on official releases
#set(COLOBOT_VERSION_RELEASE_CODENAME "-alpha") #set(COLOBOT_VERSION_RELEASE_CODENAME "-alpha")

View File

@ -44,6 +44,7 @@
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <boost/filesystem.hpp>
/* Doxygen main page */ /* Doxygen main page */
@ -98,13 +99,19 @@ int main(int argc, char *argv[])
systemUtils->Init(); systemUtils->Init();
// Add file output to the logger // Add file output to the logger
std::string logfile; std::string logFileName;
#if DEV_BUILD #if DEV_BUILD
logfile = "log.txt"; logFileName = "log.txt";
#else #else
logfile = systemUtils->GetSaveDir() + "/log.txt"; boost::filesystem::create_directories(systemUtils->GetSaveDir());
logFileName = systemUtils->GetSaveDir() + "/log.txt";
#endif #endif
logger.AddOutput(fopen(logfile.c_str(), "w")); FILE* logFile = fopen(logFileName.c_str(), "w");
if (logFile)
logger.AddOutput(logFile);
else
logger.Error("Failed to create log file, writing log to file disabled\n");
// Workaround for character encoding in argv on Windows // Workaround for character encoding in argv on Windows
#if PLATFORM_WINDOWS #if PLATFORM_WINDOWS