Precache, Unload and FillSimplePoly bug fix
This commit is contained in:
parent
3ce2d8365d
commit
8ba6a4f175
22 changed files with 33 additions and 52 deletions
|
|
@ -176,6 +176,11 @@ FTexture::~FTexture ()
|
|||
KillNative();
|
||||
}
|
||||
|
||||
void FTexture::Unload()
|
||||
{
|
||||
PixelsBgra = std::vector<uint32_t>();
|
||||
}
|
||||
|
||||
const uint32_t *FTexture::GetColumnBgra(unsigned int column, const Span **spans_out)
|
||||
{
|
||||
const uint32_t *pixels = GetPixelsBgra();
|
||||
|
|
@ -189,16 +194,19 @@ const uint32_t *FTexture::GetColumnBgra(unsigned int column, const Span **spans_
|
|||
|
||||
const uint32_t *FTexture::GetPixelsBgra()
|
||||
{
|
||||
if (BgraPixels.empty())
|
||||
if (PixelsBgra.empty())
|
||||
{
|
||||
GetColumn(0, nullptr);
|
||||
const BYTE *indices = GetPixels();
|
||||
BgraPixels.resize(Width * Height);
|
||||
if (indices == nullptr)
|
||||
return nullptr;
|
||||
PixelsBgra.resize(Width * Height);
|
||||
for (int i = 0; i < Width * Height; i++)
|
||||
{
|
||||
BgraPixels[i] = GPalette.BaseColors[indices[i]].d;
|
||||
PixelsBgra[i] = GPalette.BaseColors[indices[i]].d;
|
||||
}
|
||||
}
|
||||
return BgraPixels.data();
|
||||
return PixelsBgra.data();
|
||||
}
|
||||
|
||||
bool FTexture::CheckModified ()
|
||||
|
|
@ -642,10 +650,6 @@ FDummyTexture::FDummyTexture ()
|
|||
UseType = TEX_Null;
|
||||
}
|
||||
|
||||
void FDummyTexture::Unload ()
|
||||
{
|
||||
}
|
||||
|
||||
void FDummyTexture::SetSize (int width, int height)
|
||||
{
|
||||
Width = width;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue