- fixed clamp mode setup.

This commit is contained in:
Christoph Oelckers 2020-05-31 23:08:56 +02:00
parent ab2686db34
commit 783dff41b6
2 changed files with 10 additions and 13 deletions

View file

@ -67,15 +67,11 @@ bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int me
if (!PickTexture(picnum, tex, paletteid, texpick)) return false;
int TextureType = (texpick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR;
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
if (TextureType == TT_INDEXED)
{
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
}
else if (tex->isHardwareCanvas())
{
sampler = CLAMP_CAMTEX;
}
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
if (TextureType == TT_INDEXED)
{
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
}
// This is intentionally the same value for both parameters. The shader does not use the same uniform for modulation and overlay colors.