Keep stadium pixels intact with the Direct3D TGA loader (by Codex)

This commit is contained in:
Codex committed 2026-10-23 10:01:44 +02:00
1 parent 678fce47f6
commit 06e846416a
4 files changed
+10 -3

No files matched your search

+2 -1
View File
@@ -36,7 +36,8 @@ struct Renderer : Rml::RenderInterface {
unsigned char header[18]{};
const auto read = files->Read(header, sizeof(header), input);
files->Close(input);
if (read != sizeof(header) || header[2] != 2 || header[16] != 24)
// The pinned DX11 loader requires bottom-origin rows for 24-bit input.
if (read != sizeof(header) || header[2] != 2 || header[16] != 24 || (header[17] & 32))
throw std::runtime_error("Invalid stadium asset: " + name);
dimensions = {header[12] + 256 * header[13], header[14] + 256 * header[15]};
return 1;