diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-04 19:56:22 +0200 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-07-04 19:56:22 +0200 |
commit | af3057df7eb41973349b407539846f17d9094c21 (patch) | |
tree | 0940a188a0cfc43a99505f55513516866a57d145 /src/app/main.cpp | |
parent | f95df35dc58e01b99ffddfc4ad394feaa4460b09 (diff) | |
download | colobot-af3057df7eb41973349b407539846f17d9094c21.tar.gz colobot-af3057df7eb41973349b407539846f17d9094c21.tar.bz2 colobot-af3057df7eb41973349b407539846f17d9094c21.zip |
Merged changes from dev
Resolved conflicts & added fixes.
Diffstat (limited to 'src/app/main.cpp')
-rw-r--r-- | src/app/main.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/app/main.cpp b/src/app/main.cpp index 1e102d7..ece18d3 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,11 +39,19 @@ int main(int argc, char *argv[]) SystemDialog(SDT_ERROR, "COLOBOT", "Invalid commandline arguments!\n"); } + int code = 0; + if (! app.Create()) { app.Destroy(); // ensure a clean exit - return 1; + code = app.GetExitCode(); + logger.Info("Didn't run main loop. Exiting with code %d\n", code); + return code; } - return app.Run(); + code = app.Run(); + + logger.Info("Exiting with code %d\n", code); + return code; } + |