- Fixed: R_GetColumn() needs to clamp negative column indexes to be inside the texture if the

texture's width isn't a power of 2.

SVN r3881 (trunk)
This commit is contained in:
Randy Heit 2012-10-05 04:21:34 +00:00
parent 12e1901150
commit 934c27d34a

View file

@ -2153,6 +2153,14 @@ void tmvline4_revsubclamp ()
const BYTE *R_GetColumn (FTexture *tex, int col)
{
int width;
// If the texture's width isn't a power of 2, then we need to make it a
// positive offset for proper clamping.
if (col < 0 && (width = tex->GetWidth()) != (1 << tex->WidthBits))
{
col = width + (col % width);
}
return tex->GetColumn (col, NULL);
}