Skip to content

Commit

Permalink
- port texture upscaler code to truecolour
Browse files Browse the repository at this point in the history
  • Loading branch information
Rachael Alexanderson committed Dec 15, 2018
1 parent aaabefb commit 2e927c7
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions src/swrenderer/textures/r_swtexture.cpp
Expand Up @@ -146,8 +146,24 @@ const uint32_t *FSoftwareTexture::GetPixelsBgra()
{
if (PixelsBgra.Size() == 0 || CheckModified(2))
{
FBitmap bitmap = mTexture->GetBgraBitmap(nullptr);
GenerateBgraFromBitmap(bitmap);
if (mPhysicalScale == 1)
{
FBitmap bitmap = mTexture->GetBgraBitmap(nullptr);
GenerateBgraFromBitmap(bitmap);
}
else
{
auto tempbuffer = mTexture->CreateTexBuffer(0, mBufferFlags);
PixelsBgra.Resize(GetWidth()*GetHeight());
PalEntry *pe = (PalEntry*)tempbuffer.mBuffer;
for (int y = 0; y < GetHeight(); y++)
{
for (int x = 0; x < GetWidth(); x++)
{
PixelsBgra[y + x * GetHeight()] = pe[x + y * GetWidth()];
}
}
}
}
return PixelsBgra.Data();
}
Expand Down

0 comments on commit 2e927c7

Please sign in to comment.