mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #13030 from ZehMatt/fix-4617-2
Fix #4617: Crash when rotating with invalid viewport open
This commit is contained in:
commit
30307ec42d
|
@ -322,10 +322,7 @@ static void window_sign_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||||
*/
|
*/
|
||||||
static void window_sign_viewport_rotate(rct_window* w)
|
static void window_sign_viewport_rotate(rct_window* w)
|
||||||
{
|
{
|
||||||
rct_viewport* view = w->viewport;
|
w->RemoveViewport();
|
||||||
w->viewport = nullptr;
|
|
||||||
|
|
||||||
view->width = 0;
|
|
||||||
|
|
||||||
auto banner = GetBanner(w->number);
|
auto banner = GetBanner(w->number);
|
||||||
|
|
||||||
|
|
|
@ -42,3 +42,12 @@ void rct_window::Invalidate()
|
||||||
{
|
{
|
||||||
gfx_set_dirty_blocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
|
gfx_set_dirty_blocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rct_window::RemoveViewport()
|
||||||
|
{
|
||||||
|
if (viewport == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
|
viewport->width = 0;
|
||||||
|
viewport = nullptr;
|
||||||
|
}
|
||||||
|
|
|
@ -94,6 +94,7 @@ struct rct_window
|
||||||
void SetLocation(const CoordsXYZ& coords);
|
void SetLocation(const CoordsXYZ& coords);
|
||||||
void ScrollToViewport();
|
void ScrollToViewport();
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
|
void RemoveViewport();
|
||||||
};
|
};
|
||||||
|
|
||||||
// rct2: 0x01420078
|
// rct2: 0x01420078
|
||||||
|
|
Loading…
Reference in New Issue