1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-21 22:13:07 +01:00

Fix #6681: Tons of visual glitches when zooming out

Regression from #6574. Restoring the backup of SPR_TEMP was removed which was necessary as it is the sprite for grass tile zoomed out. Instead make SPR_TEMP a special sprite ID which is not used for anything else apart from temporary sprite drawing.
This commit is contained in:
Ted John
2017-11-20 13:47:44 +00:00
parent dd8464f907
commit 8c53b6a70b
5 changed files with 18 additions and 7 deletions

View File

@@ -234,7 +234,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
g1temp.height = 217;
g1temp.flags = G1_FLAG_BMP;
gfx_set_g1_element(SPR_TEMP, &g1temp);
gfx_draw_sprite(dpi, 0, x, y, 0);
gfx_draw_sprite(dpi, SPR_TEMP, x, y, 0);
x = w->x + (widget->left + widget->right) / 2;
y = w->y + widget->bottom - 12;

View File

@@ -472,7 +472,7 @@ static void window_track_place_paint(rct_window *w, rct_drawpixelinfo *dpi)
g1temp.width = TRACK_MINI_PREVIEW_WIDTH;
g1temp.height = TRACK_MINI_PREVIEW_HEIGHT;
gfx_set_g1_element(SPR_TEMP, &g1temp);
gfx_draw_sprite(&clippedDpi, SPRITE_ID_PALETTE_COLOUR_1(NOT_TRANSLUCENT(w->colours[0])), 0, 0, 0);
gfx_draw_sprite(&clippedDpi, SPR_TEMP | SPRITE_ID_PALETTE_COLOUR_1(NOT_TRANSLUCENT(w->colours[0])), 0, 0, 0);
}
// Price

View File

@@ -429,7 +429,7 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
g1temp.height = 217;
g1temp.flags = G1_FLAG_BMP;
gfx_set_g1_element(SPR_TEMP, &g1temp);
gfx_draw_sprite(dpi, 0, x, y, 0);
gfx_draw_sprite(dpi, SPR_TEMP, x, y, 0);
x = w->x + (widget->left + widget->right) / 2;
y = w->y + widget->bottom - 12;

View File

@@ -167,6 +167,7 @@ extern "C"
#else
static rct_g1_element * _g1Elements = RCT2_ADDRESS(RCT2_ADDRESS_G1_ELEMENTS, rct_g1_element);
#endif
static rct_g1_element _g1Temp = { 0 };
bool gTinyFontAntiAliased = false;
/**
@@ -754,7 +755,11 @@ extern "C"
return nullptr;
}
if (image_id < SPR_G2_BEGIN)
if (image_id == SPR_TEMP)
{
return &_g1Temp;
}
else if (image_id < SPR_G2_BEGIN)
{
if (image_id >= (sint32)_g1ElementsCount)
{
@@ -791,11 +796,15 @@ extern "C"
{
openrct2_assert(!gOpenRCT2NoGraphics, "gfx_set_g1_element called on headless instance");
#ifdef DEBUG
openrct2_assert(imageId >= 0 && imageId < SPR_G2_BEGIN, "gfx_set_g1_element called with unexpected image id");
openrct2_assert((imageId >= 0 && imageId < SPR_G2_BEGIN) || imageId == SPR_TEMP, "gfx_set_g1_element called with unexpected image id");
openrct2_assert(g1 != nullptr, "g1 was nullptr");
#endif
if (imageId >= 0 || imageId < SPR_G2_BEGIN)
if (imageId == SPR_TEMP)
{
_g1Temp = *g1;
}
else if (imageId >= 0 || imageId < SPR_G2_BEGIN)
{
if (imageId < (sint32)_g1ElementsCount)
{

View File

@@ -19,7 +19,9 @@
enum {
SPR_NONE = -1,
SPR_TEMP = 0,
// Used for on-demand drawing of dynamic memory
SPR_TEMP = 0x70000,
SPR_SCROLLING_TEXT_START = 1542,
SPR_SCROLLING_TEXT_DEFAULT = 1574,