wrap invalid texture sizes, seems to fix bad textures in srally2 (skid marks)

This commit is contained in:
Ian Curtis 2016-05-01 19:52:02 +00:00
parent 7ec7906c0f
commit c459772f8e

View file

@ -168,11 +168,24 @@ bool PolyHeader::TexVMirror()
int PolyHeader::TexWidth() 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() int PolyHeader::TexHeight()
{ {
return 32 << ((header[3] >> 0) & 7); UINT32 h = (header[3] >> 0) & 7;
if (h >= 6) {
h = 0;
}
return 32 << h;
} }
// //