mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- port texture upscaler code to truecolour
This commit is contained in:
parent
aaabefbfab
commit
2e927c7026
1 changed files with 18 additions and 2 deletions
|
@ -145,10 +145,26 @@ const uint8_t *FSoftwareTexture::GetPixels(int style)
|
||||||
const uint32_t *FSoftwareTexture::GetPixelsBgra()
|
const uint32_t *FSoftwareTexture::GetPixelsBgra()
|
||||||
{
|
{
|
||||||
if (PixelsBgra.Size() == 0 || CheckModified(2))
|
if (PixelsBgra.Size() == 0 || CheckModified(2))
|
||||||
|
{
|
||||||
|
if (mPhysicalScale == 1)
|
||||||
{
|
{
|
||||||
FBitmap bitmap = mTexture->GetBgraBitmap(nullptr);
|
FBitmap bitmap = mTexture->GetBgraBitmap(nullptr);
|
||||||
GenerateBgraFromBitmap(bitmap);
|
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();
|
return PixelsBgra.Data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue