- fixed code that deternines when to upscale a texture.

This was very much non-functional.
This commit is contained in:
Christoph Oelckers 2020-06-10 00:21:19 +02:00
commit 60a20af8ff
5 changed files with 14 additions and 21 deletions

View file

@ -68,11 +68,10 @@ FSoftwareTexture::FSoftwareTexture(FGameTexture *tex)
mSource = tex->GetTexture();
mBufferFlags = CTF_ProcessData;
auto f = mBufferFlags;
if (shouldUpscale(tex, scaleFlagFromUseType(tex->GetUseType()))) f |= CTF_Upscale;
if (shouldUpscale(tex, scaleFlagFromUseType(tex->GetUseType()))) mBufferFlags |= CTF_Upscale;
// calculate the real size after running the scaler.
auto info = mSource->CreateTexBuffer(0, CTF_CheckOnly| f);
auto info = mSource->CreateTexBuffer(0, CTF_CheckOnly| mBufferFlags);
mPhysicalWidth = info.mWidth;
mPhysicalHeight = info.mHeight;
mPhysicalScale = tex->GetTexelWidth() > 0 ? mPhysicalWidth / tex->GetTexelWidth() : mPhysicalWidth;
@ -130,7 +129,7 @@ const uint8_t *FSoftwareTexture::GetPixels(int style)
}
else
{
auto f = mBufferFlags | CTF_Upscale;
auto f = mBufferFlags;
auto tempbuffer = mSource->CreateTexBuffer(0, f);
Pixels.Resize(GetPhysicalWidth()*GetPhysicalHeight());
PalEntry *pe = (PalEntry*)tempbuffer.mBuffer;
@ -176,7 +175,7 @@ const uint32_t *FSoftwareTexture::GetPixelsBgra()
}
else
{
auto tempbuffer = mSource->CreateTexBuffer(0, mBufferFlags | CTF_Upscale);
auto tempbuffer = mSource->CreateTexBuffer(0, mBufferFlags);
CreatePixelsBgraWithMipmaps();
PalEntry *pe = (PalEntry*)tempbuffer.mBuffer;
for (int y = 0; y < GetPhysicalHeight(); y++)