From af3057df7eb41973349b407539846f17d9094c21 Mon Sep 17 00:00:00 2001 From: Piotr Dziwinski Date: Wed, 4 Jul 2012 19:56:22 +0200 Subject: Merged changes from dev Resolved conflicts & added fixes. --- src/app/main.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/app/main.cpp') 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; } + -- cgit v1.2.3-1-g7c22