pioneerspacesim/pioneer — pull request #2694 by robn (2014-01-28 10:16:50+00:00)
Title: Improve error reporting and general output

This does a few things to try and improve game output and error reporting. Almost certainly not the last word, but its surely a step in the right direction.

* `OS::Warning` and `OS::Error` moved to `utils.cpp`, renamed `Warning` and `Error`, and reimplemented to use [SDL_ShowSimpleMessageBox](http://wiki.libsdl.org/SDL_ShowSimpleMessageBox). It looks like this:

Win32 (via Wine):

![screenshot - 280114 - 21 06 43](https://f.cloud.github.com/assets/130670/2017927/8b8e98ae-8804-11e3-9d8a-e47ec7c76610.png)

Linux:

![screenshot - 280114 - 21 07 21](https://f.cloud.github.com/assets/130670/2017928/8b957e9e-8804-11e3-9013-42d63948cc48.png)

Output also goes to the output channel for easy copying. The nice thing about this is that it doesn't require that we have any screen stuff, GL context, anything set up. So we always have a way to tell the user what happened.

* Always exit gracefully on `Error()`, since `abort()` causes an ugly runtime exception on Windows.

* All `printf(...)` and `fprintf(stderr, ...)` replaced by a function `Output()`. Currently it just throws stuff on stderr (or to the logfile if enabled). This way there's no odd mix of output to `stdout` or `stderr`, and we can do other things later (like all output to in-game console)

* If `RedirectStdio` is enabled (as it is by default on Window), output now goes to a single `output.txt` instead of the old `stdout.txt` and `stderr.txt`. Again, easier for problem reporting.

* Since nothing now uses them, `Gui::Screen::ShowBadError` and `Gui::MainLoopIteration` are gone. No more redscreen!