mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
Fix warp texture crash in software renderer true color mode
This commit is contained in:
parent
a408ea312f
commit
22d3599ea1
2 changed files with 6 additions and 2 deletions
|
@ -570,6 +570,7 @@ public:
|
||||||
FTexture *GetRedirect(bool wantwarped);
|
FTexture *GetRedirect(bool wantwarped);
|
||||||
|
|
||||||
uint32_t GenTime;
|
uint32_t GenTime;
|
||||||
|
uint32_t GenTimeBgra;
|
||||||
float Speed;
|
float Speed;
|
||||||
int WidthOffsetMultiplier, HeightOffsetMultiplier; // [mxd]
|
int WidthOffsetMultiplier, HeightOffsetMultiplier; // [mxd]
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
|
|
||||||
|
|
||||||
FWarpTexture::FWarpTexture (FTexture *source, int warptype)
|
FWarpTexture::FWarpTexture (FTexture *source, int warptype)
|
||||||
: GenTime (0), Speed (1.f), SourcePic (source), Pixels (0), Spans (0)
|
: GenTime (0), GenTimeBgra(0), Speed (1.f), SourcePic (source), Pixels (0), Spans (0)
|
||||||
{
|
{
|
||||||
CopyInfo(source);
|
CopyInfo(source);
|
||||||
if (warptype == 2) SetupMultipliers(256, 128);
|
if (warptype == 2) SetupMultipliers(256, 128);
|
||||||
|
@ -98,8 +98,10 @@ const uint32_t *FWarpTexture::GetPixelsBgra()
|
||||||
{
|
{
|
||||||
uint32_t time = r_viewpoint.FrameTime;
|
uint32_t time = r_viewpoint.FrameTime;
|
||||||
if (Pixels == NULL || time != GenTime)
|
if (Pixels == NULL || time != GenTime)
|
||||||
{
|
|
||||||
MakeTexture(time);
|
MakeTexture(time);
|
||||||
|
|
||||||
|
if (PixelsBgra.empty() || time != GenTimeBgra)
|
||||||
|
{
|
||||||
CreatePixelsBgraWithMipmaps();
|
CreatePixelsBgraWithMipmaps();
|
||||||
for (int i = 0; i < Width * Height; i++)
|
for (int i = 0; i < Width * Height; i++)
|
||||||
{
|
{
|
||||||
|
@ -109,6 +111,7 @@ const uint32_t *FWarpTexture::GetPixelsBgra()
|
||||||
PixelsBgra[i] = 0;
|
PixelsBgra[i] = 0;
|
||||||
}
|
}
|
||||||
GenerateBgraMipmapsFast();
|
GenerateBgraMipmapsFast();
|
||||||
|
GenTimeBgra = time;
|
||||||
}
|
}
|
||||||
return PixelsBgra.data();
|
return PixelsBgra.data();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue