1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix broken zoomed textures and palettes

Zoomed textures were failing to pass the image flags to the zoomed version of the texture. This would cause corrupted data to be passed as a tertiary colour to the palette function.
Also due to not recording the image flags in the palette hash map a tertiary colour of zero would be ignored and unremaped pink colour would be shown
This commit is contained in:
duncanspumpkin
2016-09-19 19:00:26 +01:00
parent 5f7a6fb369
commit 56fddac199
2 changed files with 2 additions and 2 deletions

View File

@@ -662,7 +662,7 @@ void OpenGLDrawingContext::DrawSprite(uint32 image, sint32 x, sint32 y, uint32 t
zoomedDPI.pitch = _dpi->pitch;
zoomedDPI.zoom_level = _dpi->zoom_level - 1;
SetDPI(&zoomedDPI);
DrawSprite((image << 28) | (g1Id - g1Element->zoomed_offset), x >> 1, y >> 1, tertiaryColour);
DrawSprite((image & 0xE0000000) | (g1Id - g1Element->zoomed_offset), x >> 1, y >> 1, tertiaryColour);
return;
}
if (g1Element->flags & (1 << 5))

View File

@@ -70,7 +70,7 @@ CachedTextureInfo TextureCache::GetOrLoadPaletteTexture(uint32 image, uint32 ter
if ((image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT)) == 0)
return CachedTextureInfo{ 0 };
uint32 uniquePaletteId = 0;
uint32 uniquePaletteId = image & (IMAGE_TYPE_REMAP | IMAGE_TYPE_REMAP_2_PLUS | IMAGE_TYPE_TRANSPARENT);
if (!(image & IMAGE_TYPE_REMAP_2_PLUS)) {
uniquePaletteId = (image >> 19) & 0xFF;
if (!(image & IMAGE_TYPE_TRANSPARENT)) {