OpenGL2: Fix bug in generating normal maps for non-square textures.

This commit is contained in:
SmileTheory 2016-12-12 15:33:54 -08:00
parent 06b47ad2a9
commit 294109628d

View file

@ -502,11 +502,11 @@ static void RGBAtoNormal(const byte *in, byte *out, int width, int height, qbool
if (clampToEdge)
{
src_x = CLAMP(src_x, 0, height - 1);
src_x = CLAMP(src_x, 0, width - 1);
}
else
{
src_x = (src_x + height) % height;
src_x = (src_x + width) % width;
}
s[i++] = *(out + (src_y * width + src_x) * 4 + 3);