From 7225dbd6a43e5c0d6a52da2bf01dd51e96e67ec9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 24 May 2020 23:08:45 +0200 Subject: [PATCH] - disabled the 0<->255 color swap because no support code to handle this exists yet. --- source/core/menu/menu.cpp | 1 - source/core/textures/buildtiles.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/core/menu/menu.cpp b/source/core/menu/menu.cpp index 284999171..c589fcc9b 100644 --- a/source/core/menu/menu.cpp +++ b/source/core/menu/menu.cpp @@ -325,7 +325,6 @@ void DMenu::Drawer () { auto texid = TexMan.CheckForTexture("engine/graphics/m_back.png", ETextureType::Any); if (texid.isValid()) - if (tex) { auto tex = TexMan.GetTexture(texid); int w = tex->GetDisplayWidth() * CleanXfac; diff --git a/source/core/textures/buildtiles.cpp b/source/core/textures/buildtiles.cpp index e9f4c40c0..8d22cef9a 100644 --- a/source/core/textures/buildtiles.cpp +++ b/source/core/textures/buildtiles.cpp @@ -113,12 +113,14 @@ static FTexture* GetTileTexture(const char* name, const TArray& backing auto tex = new FArtTile(backingstore, offset, width, height); auto p = &backingstore[offset]; auto siz = width * height; +#if 0 for (int i = 0; i < siz; i++, p++) { // move transparent color to index 0 to get in line with the rest of the texture management. if (*p == 0) *p = 255; else if (*p == 255) *p = 0; } +#endif if (tex) { @@ -544,6 +546,7 @@ int32_t tileGetCRC32(int tileNum) auto size = tile->GetWidth() * tile->GetHeight(); if (size == 0) return 0; +#if 0 // Temporarily revert the data to its original form with 255 being transparent. Otherwise the CRC won't match. auto p = pixels; for (int i = 0; i < size; i++, p++) @@ -552,9 +555,11 @@ int32_t tileGetCRC32(int tileNum) if (*p == 0) *p = 255; else if (*p == 255) *p = 0; } +#endif auto crc = crc32(0, (const Bytef*)pixels, size); +#if 0 // ... and back again. p = pixels; for (int i = 0; i < size; i++, p++) @@ -563,6 +568,7 @@ int32_t tileGetCRC32(int tileNum) if (*p == 0) *p = 255; else if (*p == 255) *p = 0; } +#endif return crc; }