- fixed replacement of hires textures.

Fixes #107
This commit is contained in:
Christoph Oelckers 2020-09-10 20:52:40 +02:00
parent 41a2a63efd
commit 59eb923c11
2 changed files with 2 additions and 2 deletions

View file

@ -1006,7 +1006,6 @@ bool PickTexture(int picnum, FGameTexture* tex, int paletteid, TexturePick& pick
if (picnum == -1) picnum = TileFiles.GetTileIndex(tex); // Allow getting replacements also when the texture is not passed by its tile number.
if (!tex->isValid() || tex->GetTexelWidth() <= 0 || tex->GetTexelHeight() <= 0) return false;
pick.texture = tex;
int usepalette = GetTranslationType(paletteid) - Translation_Remap;
int usepalswap = GetTranslationIndex(paletteid);
int TextureType = hw_int_useindexedcolortextures && picnum >= 0 ? TT_INDEXED : TT_TRUECOLOR;
@ -1061,6 +1060,7 @@ bool PickTexture(int picnum, FGameTexture* tex, int paletteid, TexturePick& pick
pick.tintFlags = -1;
pick.tintColor = 0xffffff;
}
pick.texture = tex;
return true;
}

View file

@ -84,7 +84,7 @@ bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int sa
SetBasepalTint(texpick.basepalTint);
auto &mat = renderState.mMaterial;
int flags = hw_useindexedcolortextures ? CTF_Indexed : 0;
mat.mMaterial = FMaterial::ValidateTexture(tex, flags); // todo allow scaling
mat.mMaterial = FMaterial::ValidateTexture(texpick.texture, flags); // todo allow scaling
mat.mClampMode = sampler;
mat.mTranslation = texpick.translation;
mat.mOverrideShader = 0;