diff --git a/scripts/build b/scripts/build index dba55386ba..076909ecee 100755 --- a/scripts/build +++ b/scripts/build @@ -26,7 +26,7 @@ if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then # Build everything echo -e "\033[0;36mBuilding OpenRCT2 for Windows $CONFIGURATION|$PLATFORM...\033[0m" - vstool msbuild openrct2.proj //t:build + vstool msbuild openrct2.proj -t:build -p:Breakpad=true # Create openrct2.exe and openrct2.com with correct subsystem cp bin/openrct2.exe bin/openrct2.com diff --git a/src/openrct2/cmdline/RootCommands.cpp b/src/openrct2/cmdline/RootCommands.cpp index 3e7fd44adb..0a417e8573 100644 --- a/src/openrct2/cmdline/RootCommands.cpp +++ b/src/openrct2/cmdline/RootCommands.cpp @@ -459,6 +459,13 @@ static void PrintVersion() Console::WriteLine(); Console::WriteFormat("Minimum park file version: %d", OpenRCT2::PARK_FILE_MIN_VERSION); Console::WriteLine(); +#ifdef USE_BREAKPAD + Console::WriteFormat("With breakpad support enabled"); + Console::WriteLine(); +#else + Console::WriteFormat("Breakpad support disabled"); + Console::WriteLine(); +#endif } static void PrintLaunchInformation() diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index fc6a3f0507..130a6e2349 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -34,6 +34,7 @@ # include "../core/Guard.hpp" # include "../core/Path.hpp" # include "../core/String.hpp" +# include "../drawing/IDrawingEngine.h" # include "../interface/Screenshot.h" # include "../localisation/Language.h" # include "../object/ObjectManager.h" @@ -186,8 +187,9 @@ static bool OnCrash( exporter->Export(saveFilePathUTF8.c_str()); savedGameDumped = true; } - catch (const std::exception&) + catch (const std::exception& e) { + printf("Failed to export save. Error: %s\n", e.what()); } // Compress the save @@ -202,11 +204,23 @@ static bool OnCrash( uploadFiles[L"attachment_config.ini"] = configFilePath; } - std::string screenshotPath = screenshot_dump(); - if (!screenshotPath.empty()) + // janisozaur: https://github.com/OpenRCT2/OpenRCT2/pull/17634 + // By the time we reach this point, OpenGL context is already lost causing *any* call to gl* to stall or fail in unexpected + // way. Implementing a proof of concept with glGetGraphicsResetStatus in + // https://github.com/OpenRCT2/OpenRCT2/commit/3974594fc36e24d14549921d378251242e3a23e2 yielded no additional information, + // while potentially significantly raising the required OpenGL version. + // There are (at least) two ways out of this: + // 1. Create the screenshot with software renderer - requires allocations + // 2. Not create screenshot at all. + // Discovering which of the approaches got implemented is left as an excercise for the reader. + if (OpenRCT2::GetContext()->GetDrawingEngineType() != DrawingEngine::OpenGL) { - auto screenshotPathW = String::ToWideChar(screenshotPath.c_str()); - uploadFiles[L"attachment_screenshot.png"] = screenshotPathW; + std::string screenshotPath = screenshot_dump(); + if (!screenshotPath.empty()) + { + auto screenshotPathW = String::ToWideChar(screenshotPath.c_str()); + uploadFiles[L"attachment_screenshot.png"] = screenshotPathW; + } } if (with_record) @@ -225,6 +239,7 @@ static bool OnCrash( if (gOpenRCT2SilentBreakpad) { + printf("Uploading minidump in silent mode...\n"); int error; std::wstring response; UploadMinidump(uploadFiles, error, response);