- moved the decision whether to upscale textures up one level in the function chain. Still not the perfect place, this should be decided before creating the texture, not in the middle of the process.

- disabled the selective texture cleaning in the precacher. The logic here turned out to be a serious blocker and needs to be rethought.
This commit is contained in:
Christoph Oelckers 2020-04-16 21:36:14 +02:00
commit 0b990f0dcb
8 changed files with 32 additions and 32 deletions

View file

@ -49,6 +49,8 @@
#include "texturemanager.h"
#include "c_cvars.h"
EXTERN_CVAR(Int, gl_texture_hqresize_targets)
// Wrappers to keep the definitions of these classes out of here.
void DeleteMaterial(FMaterial* mat);
IHardwareTexture* CreateHardwareTexture();
@ -686,10 +688,27 @@ FTextureBuffer FTexture::CreateTexBuffer(int translation, int flags)
result.mWidth = W;
result.mHeight = H;
bool upscale = true;
switch (UseType)
{
case ETextureType::Sprite:
case ETextureType::SkinSprite:
if (!(gl_texture_hqresize_targets & 2)) upscale = false;
break;
case ETextureType::FontChar:
if (!(gl_texture_hqresize_targets & 4)) upscale = false;
break;
default:
if (!(gl_texture_hqresize_targets & 1)) upscale = false;
break;
}
// Only do postprocessing for image-backed textures. (i.e. not for the burn texture which can also pass through here.)
if (GetImage() && flags & CTF_ProcessData)
{
CreateUpsampledTextureBuffer(result, !!isTransparent, checkonly);
if (upscale) CreateUpsampledTextureBuffer(result, !!isTransparent, checkonly);
if (!checkonly) ProcessData(result.mBuffer, result.mWidth, result.mHeight, false);
}
@ -717,9 +736,9 @@ bool FTexture::DetermineTranslucency()
}
void FTexture::CleanHardwareTextures(bool cleannormal, bool cleanexpanded)
void FTexture::CleanHardwareTextures(bool reallyclean)
{
SystemTextures.Clean(cleannormal, cleanexpanded);
SystemTextures.Clean(reallyclean, reallyclean);
}
//===========================================================================