From c459772f8ec8ee29537865fba6e33e320b6009ee Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Sun, 1 May 2016 19:52:02 +0000 Subject: [PATCH] wrap invalid texture sizes, seems to fix bad textures in srally2 (skid marks) --- Src/Graphics/New3D/PolyHeader.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Src/Graphics/New3D/PolyHeader.cpp b/Src/Graphics/New3D/PolyHeader.cpp index f29dfe9..ab422f0 100644 --- a/Src/Graphics/New3D/PolyHeader.cpp +++ b/Src/Graphics/New3D/PolyHeader.cpp @@ -168,11 +168,24 @@ bool PolyHeader::TexVMirror() int PolyHeader::TexWidth() { - return 32 << ((header[3] >> 3) & 7); + UINT32 w = (header[3] >> 3) & 7; + + if (w >= 6) { + w = 0; + } + + return 32 << w; } + int PolyHeader::TexHeight() { - return 32 << ((header[3] >> 0) & 7); + UINT32 h = (header[3] >> 0) & 7; + + if (h >= 6) { + h = 0; + } + + return 32 << h; } //