From 65bf7753a1eedb22e5e226f312fa9a01d223ff4f Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 1 Aug 2024 22:37:03 +0200 Subject: [PATCH] Revert "Fix renderer creation for HW display engine (#22445)" This reverts commit b1e14c676d0171d72df882305c255f211f369c7f. --- distribution/changelog.txt | 1 - .../drawing/engines/HardwareDisplayDrawingEngine.cpp | 9 --------- 2 files changed, 10 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b50007c2ac..233ec0cfdc 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -35,7 +35,6 @@ - Fix: [#22339] Printing ui.tool.cursor in console crashes the game. - Fix: [#22348] Progress bar screen doesn’t handle window resizing. - Fix: [#22389] Alpine coaster has wrong tunnel entrance type. -- Fix: [#22445] Crash due to incorrect renderer state. 0.4.12 (2024-07-07) ------------------------------------------------------------------------ diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 33258d3b5e..8732944473 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -67,16 +67,7 @@ public: void Initialise() override { -#if SDL_VERSION_ATLEAST(2, 28, 0) - // Before creating a new renderer, destroy any possible leftover state, as it will prevent the renderer from being - // created. - if (SDL_GetWindowSurface(_window) != nullptr) - { - SDL_DestroyWindowSurface(_window); - } -#endif _sdlRenderer = SDL_CreateRenderer(_window, -1, SDL_RENDERER_ACCELERATED | (_useVsync ? SDL_RENDERER_PRESENTVSYNC : 0)); - Guard::Assert(_sdlRenderer != nullptr, "Failed to create renderer: %s", SDL_GetError()); } void SetVSync(bool vsync) override