Crash log: Include game mode in config info
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "debug_desync.h"
|
||||
#include "event_logs.h"
|
||||
#include "scope.h"
|
||||
#include "progress.h"
|
||||
|
||||
#include "ai/ai_info.hpp"
|
||||
#include "game/game.hpp"
|
||||
@@ -226,6 +227,15 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
|
||||
default: return "-";
|
||||
};
|
||||
};
|
||||
auto mode_name = []() -> const char * {
|
||||
switch (_game_mode) {
|
||||
case GM_MENU: return "MENU";
|
||||
case GM_NORMAL: return "NORMAL";
|
||||
case GM_EDITOR: return "EDITOR";
|
||||
case GM_BOOTSTRAP: return "BOOTSTRAP";
|
||||
default: return "-";
|
||||
};
|
||||
};
|
||||
buffer += seprintf(buffer, last,
|
||||
"Configuration:\n"
|
||||
" Blitter: %s\n"
|
||||
@@ -237,7 +247,7 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
|
||||
" Sound driver: %s\n"
|
||||
" Sound set: %s (%u)\n"
|
||||
" Video driver: %s\n"
|
||||
" Pathfinder: %s %s %s\n\n",
|
||||
" Pathfinder: %s %s %s\n",
|
||||
BlitterFactory::GetCurrentBlitter() == nullptr ? "none" : BlitterFactory::GetCurrentBlitter()->GetName(),
|
||||
BaseGraphics::GetUsedSet() == nullptr ? "none" : BaseGraphics::GetUsedSet()->name.c_str(),
|
||||
BaseGraphics::GetUsedSet() == nullptr ? UINT32_MAX : BaseGraphics::GetUsedSet()->version,
|
||||
@@ -252,6 +262,10 @@ char *CrashLog::LogConfiguration(char *buffer, const char *last) const
|
||||
VideoDriver::GetInstance() == nullptr ? "none" : VideoDriver::GetInstance()->GetInfoString(),
|
||||
pathfinder_name(_settings_game.pf.pathfinder_for_trains), pathfinder_name(_settings_game.pf.pathfinder_for_roadvehs), pathfinder_name(_settings_game.pf.pathfinder_for_ships)
|
||||
);
|
||||
buffer += seprintf(buffer, last, " Game mode: %s", mode_name());
|
||||
if (_switch_mode != SM_NONE) buffer += seprintf(buffer, last, ", SM: %u", _switch_mode);
|
||||
if (HasModalProgress()) buffer += seprintf(buffer, last, ", HMP");
|
||||
buffer += seprintf(buffer, last, "\n\n");
|
||||
|
||||
this->CrashLogFaultSectionCheckpoint(buffer);
|
||||
|
||||
|
Reference in New Issue
Block a user