- make sure that warping textures never create a warped true color image.
This replaces the old redirection hackery that had to work differently for the legacy render path. Overriding CopyTrueColorTranslated is far more robust and ensures that no edge cases can reach the GetPixels function, which wasn't the case before.
This commit is contained in:
parent
c37ff22a05
commit
5e8a4b96fe
6 changed files with 23 additions and 27 deletions
|
|
@ -158,7 +158,7 @@ public:
|
|||
|
||||
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf = NULL) override;
|
||||
int GetSourceLump() override { return DefinitionLump; }
|
||||
FTexture *GetRedirect(bool wantwarped) override;
|
||||
FTexture *GetRedirect() override;
|
||||
FTexture *GetRawTexture() override;
|
||||
void ResolvePatches();
|
||||
|
||||
|
|
@ -692,7 +692,7 @@ void FMultiPatchTexture::CheckForHacks ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *FMultiPatchTexture::GetRedirect(bool wantwarped)
|
||||
FTexture *FMultiPatchTexture::GetRedirect()
|
||||
{
|
||||
return bRedirect ? Parts->Texture : this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,24 +120,13 @@ int FWarpTexture::NextPo2 (int v)
|
|||
return ++v;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: TexPart :: TexPart
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
FTexture *FWarpTexture::GetRedirect(bool wantwarped)
|
||||
{
|
||||
if (!wantwarped) return SourcePic->GetRedirect(false);
|
||||
else return this;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// FMultiPatchTexture :: CopyTrueColorPixels
|
||||
//
|
||||
// This doesn't warp. It's just here in case someone tries to use a warp
|
||||
// texture for compositing a multipatch texture
|
||||
// True color texture generation must never hit the paletted path which
|
||||
// always warps the buffer.
|
||||
// As a result even CopyTrueColorTranslated must be overrideen here.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
|
|
@ -146,3 +135,8 @@ int FWarpTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FC
|
|||
return SourcePic->CopyTrueColorPixels(bmp, x, y, rotate, inf);
|
||||
}
|
||||
|
||||
int FWarpTexture::CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, PalEntry *remap, FCopyInfo *inf)
|
||||
{
|
||||
return SourcePic->CopyTrueColorTranslated(bmp, x, y, rotate, remap, inf);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ bool FTexture::UseBasePalette()
|
|||
return true;
|
||||
}
|
||||
|
||||
FTexture *FTexture::GetRedirect(bool wantwarped)
|
||||
FTexture *FTexture::GetRedirect()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,10 +302,10 @@ public:
|
|||
virtual bool Mipmapped() { return true; }
|
||||
|
||||
virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL);
|
||||
int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, PalEntry *remap, FCopyInfo *inf = NULL);
|
||||
virtual int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, PalEntry *remap, FCopyInfo *inf = NULL);
|
||||
virtual bool UseBasePalette();
|
||||
virtual int GetSourceLump() { return SourceLump; }
|
||||
virtual FTexture *GetRedirect(bool wantwarped);
|
||||
virtual FTexture *GetRedirect();
|
||||
virtual FTexture *GetRawTexture(); // for FMultiPatchTexture to override
|
||||
|
||||
virtual void Unload ();
|
||||
|
|
@ -725,13 +725,13 @@ public:
|
|||
void Unload() override;
|
||||
|
||||
virtual int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate=0, FCopyInfo *inf = NULL) override;
|
||||
virtual int CopyTrueColorTranslated(FBitmap *bmp, int x, int y, int rotate, PalEntry *remap, FCopyInfo *inf = NULL) override;
|
||||
const uint32_t *GetPixelsBgra() override;
|
||||
bool CheckModified (FRenderStyle) override;
|
||||
|
||||
float GetSpeed() const { return Speed; }
|
||||
int GetSourceLump() { return SourcePic->GetSourceLump(); }
|
||||
void SetSpeed(float fac) { Speed = fac; }
|
||||
FTexture *GetRedirect(bool wantwarped);
|
||||
|
||||
uint64_t GenTime[2] = { 0, 0 };
|
||||
uint64_t GenTimeBgra = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue