summaryrefslogtreecommitdiffstats
path: root/src/app/main.cpp
diff options
context:
space:
mode:
authorPiotr Dziwinski <piotrdz@gmail.com>2012-07-04 19:20:22 +0200
committerPiotr Dziwinski <piotrdz@gmail.com>2012-07-04 19:20:22 +0200
commit092e4ae75e28fca8cf13d0315eb3923ba1c27133 (patch)
tree626db24b153b1ef43486a50361fde4dd046dc2ad /src/app/main.cpp
parent398186afd0f4f18ccdcffe8b7eb37f1873c28e61 (diff)
downloadcolobot-092e4ae75e28fca8cf13d0315eb3923ba1c27133.tar.gz
colobot-092e4ae75e28fca8cf13d0315eb3923ba1c27133.tar.bz2
colobot-092e4ae75e28fca8cf13d0315eb3923ba1c27133.zip
Enabled logging & minor fixes
- added logger to main() - removed reference to Snd namespace and renamed back to sound.h - fixed minor issues
Diffstat (limited to 'src/app/main.cpp')
-rw-r--r--src/app/main.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 54d305e..151cd20 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -19,6 +19,7 @@
#include "app/app.h"
#include "app/system.h"
+#include "common/logger.h"
#include "common/misc.h"
#include "common/restext.h"
@@ -26,6 +27,10 @@
//! Entry point to the program
int main(int argc, char *argv[])
{
+ CLogger logger; // Create the logger
+
+ logger.Info("Colobot starting\n");
+
CApplication app; // single instance of the application
Error err = app.ParseArguments(argc, argv);
@@ -34,8 +39,18 @@ int main(int argc, char *argv[])
SystemDialog(SDT_ERROR, "COLOBOT", "Invalid commandline arguments!\n");
}
+ int code = 0;
+
if (! app.Create())
- return 0;
+ {
+ code = app.GetExitCode();
+ logger.Info("Didn't run main loop. Exiting with code %d\n", code);
+ return code;
+ }
+
+ code = app.Run();
- return app.Run();
+ logger.Info("Exiting with code %d\n", code);
+ return code;
}
+