- moved the hires texture replacement logic into a backend callback.

This way it can be handled transparently to the calling code.
Fonts do not work yet, though.
This commit is contained in:
Christoph Oelckers 2020-11-10 16:22:02 +01:00
parent 8c241afc40
commit ed599d0f05
12 changed files with 85 additions and 94 deletions

View file

@ -586,11 +586,13 @@ private:
public:
void SetMaterial(FGameTexture* tex, EUpscaleFlags upscalemask, int scaleflags, int clampmode, int translation, int overrideshader)
{
if (sysCallbacks.PreBindTexture && !sysCallbacks.PreBindTexture(this, tex, upscalemask, clampmode, translation, overrideshader))
if (!sysCallbacks.PreBindTexture || !sysCallbacks.PreBindTexture(this, tex, upscalemask, scaleflags, clampmode, translation, overrideshader))
{
if (shouldUpscale(tex, upscalemask)) scaleflags |= CTF_Upscale;
}
SetMaterial(FMaterial::ValidateTexture(tex, scaleflags), clampmode, translation, overrideshader);
auto mat = FMaterial::ValidateTexture(tex, scaleflags);
assert(mat);
SetMaterial(mat, clampmode, translation, overrideshader);
}
void SetClipSplit(float bottom, float top)