mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- made 'supportRemap0' an image property so that later the handling for this can be taken out of the actual texture class by just providing a replacement texture for the skies.
This commit is contained in:
parent
9593cb56ae
commit
5d8adb90c4
4 changed files with 24 additions and 5 deletions
|
@ -67,6 +67,27 @@ FMultiPatchTexture::FMultiPatchTexture(int w, int h, const TArray<TexPart> &part
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//==========================================================================
|
||||||
|
//
|
||||||
|
// sky remapping will only happen if
|
||||||
|
// - the texture was defined through a TEXTUREx lump (this implies only trivial copies)
|
||||||
|
// - all patches use the base palette.
|
||||||
|
// - all patches are in a format that allows the remap.
|
||||||
|
// All other cases would not be able to properly deal with this special case.
|
||||||
|
// For textual definitions this hack isn't necessary.
|
||||||
|
//
|
||||||
|
//==========================================================================
|
||||||
|
|
||||||
|
bool FMultiPatchTexture::SupportRemap0()
|
||||||
|
{
|
||||||
|
if (bTextual || UseGamePalette()) return false;
|
||||||
|
for (int i = 0; i < NumParts; i++)
|
||||||
|
{
|
||||||
|
if (!Parts[i].Image->SupportRemap0()) return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// GetBlendMap
|
// GetBlendMap
|
||||||
|
@ -203,11 +224,6 @@ TArray<uint8_t> FMultiPatchTexture::CreatePalettedPixels(int conversion)
|
||||||
}
|
}
|
||||||
if (conversion == noremap0)
|
if (conversion == noremap0)
|
||||||
{
|
{
|
||||||
// sky remapping will only happen if
|
|
||||||
// - the texture was defined through a TEXTUREx lump (this implies only trivial copies)
|
|
||||||
// - all patches use the base palette.
|
|
||||||
// All other cases would not be able to properly deal with this special case.
|
|
||||||
// For textual definitions this hack isn't necessary.
|
|
||||||
if (bTextual || !UseGamePalette()) conversion = normal;
|
if (bTextual || !UseGamePalette()) conversion = normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,7 @@ class FMultiPatchTexture : public FImageSource
|
||||||
friend class FTexture;
|
friend class FTexture;
|
||||||
public:
|
public:
|
||||||
FMultiPatchTexture(int w, int h, const TArray<TexPart> &parts, bool complex, bool textual);
|
FMultiPatchTexture(int w, int h, const TArray<TexPart> &parts, bool complex, bool textual);
|
||||||
|
bool SupportRemap0() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int NumParts;
|
int NumParts;
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
FPatchTexture (int lumpnum, int w, int h, int lo, int to, bool isalphatex);
|
FPatchTexture (int lumpnum, int w, int h, int lo, int to, bool isalphatex);
|
||||||
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
|
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
|
||||||
int CopyPixels(FBitmap *bmp, int conversion) override;
|
int CopyPixels(FBitmap *bmp, int conversion) override;
|
||||||
|
bool SupportRemap0() override { return !badflag; }
|
||||||
void DetectBadPatches();
|
void DetectBadPatches();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ protected:
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
virtual bool SupportRemap0() { return false; } // Unfortunate hackery that's needed for Hexen's skies.
|
||||||
|
|
||||||
void CopySize(FImageSource &other)
|
void CopySize(FImageSource &other)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue