mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-07-16 04:35:17 +02:00
Move Windows console init to the beginning of main
This is done to capture all potential messages to the debug console.
This commit is contained in:
parent
8348f06d17
commit
f44d2bea1b
1 changed files with 14 additions and 12 deletions
26
src/main.cpp
26
src/main.cpp
|
@ -228,6 +228,20 @@ int main(int argc, char *argv[]) {
|
|||
}
|
||||
}
|
||||
|
||||
#if defined(__WIN32__)
|
||||
// Create a debug console in debug mode
|
||||
if (conf.editor.debug) {
|
||||
if (setupWindowsConsole()) {
|
||||
reopenWindowsStreams();
|
||||
} else {
|
||||
char buf[200];
|
||||
snprintf(buf, sizeof(buf), "Error allocating console: %lu",
|
||||
GetLastError());
|
||||
showInitError(std::string(buf));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
conf.readGameINI();
|
||||
|
||||
#ifdef MKXPZ_STEAM
|
||||
|
@ -293,18 +307,6 @@ int main(int argc, char *argv[]) {
|
|||
showInitError(
|
||||
std::string(buf)); // Not an error worth ending the program over
|
||||
}
|
||||
|
||||
// Create a debug console in debug mode
|
||||
if (conf.editor.debug) {
|
||||
if (setupWindowsConsole()) {
|
||||
reopenWindowsStreams();
|
||||
} else {
|
||||
char buf[200];
|
||||
snprintf(buf, sizeof(buf), "Error allocating console: %lu",
|
||||
GetLastError());
|
||||
showInitError(std::string(buf));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
SDL_Window *win;
|
||||
|
|
Loading…
Add table
Reference in a new issue