- alternative configuration using GLEW to get extension functions. This requires GL 2.0, though so it won't be promoted to the mainline for the time being.

- removed all pre GL 2.0 support.
This commit is contained in:
Christoph Oelckers 2014-04-06 14:35:44 +02:00
commit 69af73d9b9
14 changed files with 138 additions and 329 deletions

View file

@ -705,22 +705,19 @@ FMaterial::FMaterial(FTexture * tx, bool forceexpand)
mBaseLayer = ValidateSysTexture(tx, true);
if (gl.flags & RFL_NPOT_TEXTURE) // trimming only works if non-power-of-2 textures are supported
int trim[4];
if (TrimBorders(trim))
{
int trim[4];
Width[GLUSE_SPRITE] = trim[2] + 2;
Height[GLUSE_SPRITE] = trim[3] + 2;
LeftOffset[GLUSE_SPRITE] -= trim[0];
TopOffset[GLUSE_SPRITE] -= trim[1];
if (TrimBorders(trim))
{
Width[GLUSE_SPRITE] = trim[2] + 2;
Height[GLUSE_SPRITE] = trim[3] + 2;
LeftOffset[GLUSE_SPRITE] -= trim[0];
TopOffset[GLUSE_SPRITE] -= trim[1];
SpriteU[0] = SpriteU[1] * (trim[0] / (float)Width[GLUSE_PATCH]);
SpriteV[0] = SpriteV[1] * (trim[1] / (float)Height[GLUSE_PATCH]);
SpriteU[1] *= (trim[0]+trim[2]+2) / (float)Width[GLUSE_PATCH];
SpriteV[1] *= (trim[1]+trim[3]+2) / (float)Height[GLUSE_PATCH];
}
SpriteU[0] = SpriteU[1] * (trim[0] / (float)Width[GLUSE_PATCH]);
SpriteV[0] = SpriteV[1] * (trim[1] / (float)Height[GLUSE_PATCH]);
SpriteU[1] *= (trim[0]+trim[2]+2) / (float)Width[GLUSE_PATCH];
SpriteV[1] *= (trim[1]+trim[3]+2) / (float)Height[GLUSE_PATCH];
}
}
}