- made some changes to the FImageSource interface that allows forwarding the bRemap0 flag, but do it so that it doesn't permanently alter how the image looks.
In ZDoom this would affect everything using a patch that got used in a front sky layer, even if the texture was totally unrelated. It is only owed to the low usability of such patches for other purposes that this hasn't caused problems.
This commit is contained in:
parent
583a740441
commit
91f7121452
18 changed files with 90 additions and 105 deletions
|
|
@ -85,7 +85,7 @@ class FPCXTexture : public FImageSource
|
|||
public:
|
||||
FPCXTexture (int lumpnum, PCXHeader &);
|
||||
|
||||
int CopyPixels(FBitmap *bmp) override;
|
||||
int CopyPixels(FBitmap *bmp, int conversion) override;
|
||||
|
||||
protected:
|
||||
void ReadPCX1bit (uint8_t *dst, FileReader & lump, PCXHeader *hdr);
|
||||
|
|
@ -93,7 +93,7 @@ protected:
|
|||
void ReadPCX8bits (uint8_t *dst, FileReader & lump, PCXHeader *hdr);
|
||||
void ReadPCX24bits (uint8_t *dst, FileReader & lump, PCXHeader *hdr, int planes);
|
||||
|
||||
TArray<uint8_t> Get8BitPixels(bool alphatex) override;
|
||||
TArray<uint8_t> GetPalettedPixels(int conversion) override;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -358,7 +358,7 @@ void FPCXTexture::ReadPCX24bits (uint8_t *dst, FileReader & lump, PCXHeader *hdr
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
TArray<uint8_t> FPCXTexture::Get8BitPixels(bool alphatex)
|
||||
TArray<uint8_t> FPCXTexture::GetPalettedPixels(int conversion)
|
||||
{
|
||||
uint8_t PaletteMap[256];
|
||||
PCXHeader header;
|
||||
|
|
@ -371,6 +371,7 @@ TArray<uint8_t> FPCXTexture::Get8BitPixels(bool alphatex)
|
|||
bitcount = header.bitsPerPixel * header.numColorPlanes;
|
||||
TArray<uint8_t> Pixels(Width*Height, true);
|
||||
|
||||
bool alphatex = conversion == luminance;
|
||||
if (bitcount < 24)
|
||||
{
|
||||
if (bitcount < 8)
|
||||
|
|
@ -446,7 +447,7 @@ TArray<uint8_t> FPCXTexture::Get8BitPixels(bool alphatex)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int FPCXTexture::CopyPixels(FBitmap *bmp)
|
||||
int FPCXTexture::CopyPixels(FBitmap *bmp, int conversion)
|
||||
{
|
||||
PalEntry pe[256];
|
||||
PCXHeader header;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue