Fix animated textures not updating in swtruecolor mode

This commit is contained in:
Magnus Norddahl 2016-06-17 10:47:30 +02:00
parent 5963f29afd
commit 12a50c140c
4 changed files with 35 additions and 0 deletions

View file

@ -34,6 +34,7 @@ public:
const BYTE *GetColumn (unsigned int column, const Span **spans_out); const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels (); const BYTE *GetPixels ();
const uint32_t *GetPixelsBgra() override;
bool CheckModified (); bool CheckModified ();
void SetVial (int level); void SetVial (int level);
@ -115,6 +116,16 @@ const BYTE *FHealthBar::GetPixels ()
return Pixels; return Pixels;
} }
const uint32_t *FHealthBar::GetPixelsBgra()
{
if (NeedRefresh)
{
MakeTexture();
PixelsBgra.clear();
}
return FTexture::GetPixelsBgra();
}
void FHealthBar::SetVial (int level) void FHealthBar::SetVial (int level)
{ {
if (level < 0) if (level < 0)

View file

@ -78,6 +78,7 @@ public:
const BYTE *GetColumn(unsigned int column, const Span **spans_out); const BYTE *GetColumn(unsigned int column, const Span **spans_out);
const BYTE *GetPixels(); const BYTE *GetPixels();
const uint32_t *GetPixelsBgra() override;
bool CheckModified(); bool CheckModified();
protected: protected:
@ -246,6 +247,16 @@ const BYTE *FBackdropTexture::GetPixels()
return Pixels; return Pixels;
} }
const uint32_t *FBackdropTexture::GetPixelsBgra()
{
if (LastRenderTic != gametic)
{
Render();
PixelsBgra.clear();
}
return FTexture::GetPixelsBgra();
}
//============================================================================= //=============================================================================
// //
// This is one plasma and two rotozoomers. I think it turned out quite awesome. // This is one plasma and two rotozoomers. I think it turned out quite awesome.

View file

@ -484,6 +484,7 @@ public:
virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL); virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL);
const BYTE *GetColumn (unsigned int column, const Span **spans_out); const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels (); const BYTE *GetPixels ();
const uint32_t *GetPixelsBgra() override;
void Unload (); void Unload ();
bool CheckModified (); bool CheckModified ();

View file

@ -93,6 +93,18 @@ const BYTE *FWarpTexture::GetPixels ()
return Pixels; return Pixels;
} }
const uint32_t *FWarpTexture::GetPixelsBgra()
{
DWORD time = r_FrameTime;
if (Pixels == NULL || time != GenTime)
{
MakeTexture(time);
PixelsBgra.clear();
}
return FTexture::GetPixelsBgra();
}
const BYTE *FWarpTexture::GetColumn (unsigned int column, const Span **spans_out) const BYTE *FWarpTexture::GetColumn (unsigned int column, const Span **spans_out)
{ {
DWORD time = r_FrameTime; DWORD time = r_FrameTime;