- const-ified the palette pointers in the texture creation code.
- fixed includes.
This commit is contained in:
parent
65f15e1147
commit
d586ffa79c
32 changed files with 37 additions and 37 deletions
|
|
@ -573,7 +573,7 @@ class FPNGFileTexture : public FTexture
|
|||
{
|
||||
public:
|
||||
FPNGFileTexture (FileReader &lump, int width, int height, uint8_t colortype);
|
||||
virtual FBitmap GetBgraBitmap(PalEntry *remap, int *trans);
|
||||
virtual FBitmap GetBgraBitmap(const PalEntry *remap, int *trans);
|
||||
|
||||
protected:
|
||||
|
||||
|
|
@ -631,7 +631,7 @@ FPNGFileTexture::FPNGFileTexture (FileReader &lump, int width, int height, uint8
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
FBitmap FPNGFileTexture::GetBgraBitmap(PalEntry *remap, int *trans)
|
||||
FBitmap FPNGFileTexture::GetBgraBitmap(const PalEntry *remap, int *trans)
|
||||
{
|
||||
FBitmap bmp;
|
||||
// Parse pre-IDAT chunks. I skip the CRCs. Is that bad?
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ int FImageSource::CopyPixels(FBitmap *bmp, int conversion)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int FImageSource::CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap)
|
||||
int FImageSource::CopyTranslatedPixels(FBitmap *bmp, const PalEntry *remap)
|
||||
{
|
||||
auto ppix = CreatePalettedPixels(false);
|
||||
bmp->CopyPixelData(0, 0, ppix.Data(), Width, Height, Height, 1, 0, remap, nullptr);
|
||||
|
|
@ -195,7 +195,7 @@ int FImageSource::CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FBitmap FImageSource::GetCachedBitmap(PalEntry *remap, int conversion, int *ptrans)
|
||||
FBitmap FImageSource::GetCachedBitmap(const PalEntry *remap, int conversion, int *ptrans)
|
||||
{
|
||||
FBitmap ret;
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ protected:
|
|||
|
||||
virtual TArray<uint8_t> CreatePalettedPixels(int conversion);
|
||||
virtual int CopyPixels(FBitmap *bmp, int conversion); // This will always ignore 'luminance'.
|
||||
int CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap);
|
||||
int CopyTranslatedPixels(FBitmap *bmp, const PalEntry *remap);
|
||||
|
||||
|
||||
public:
|
||||
|
|
@ -86,7 +86,7 @@ public:
|
|||
|
||||
|
||||
// Unlile for paletted images there is no variant here that returns a persistent bitmap, because all users have to process the returned image into another format.
|
||||
FBitmap GetCachedBitmap(PalEntry *remap, int conversion, int *trans = nullptr);
|
||||
FBitmap GetCachedBitmap(const PalEntry *remap, int conversion, int *trans = nullptr);
|
||||
|
||||
static void ClearImages() { ImageArena.FreeAll(); ImageForLump.Clear(); NextID = 0; }
|
||||
static FImageSource * GetImage(int lumpnum, bool checkflat);
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ FImageTexture::FImageTexture(FImageSource *img, const char *name) noexcept
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
FBitmap FImageTexture::GetBgraBitmap(PalEntry *p, int *trans)
|
||||
FBitmap FImageTexture::GetBgraBitmap(const PalEntry *p, int *trans)
|
||||
{
|
||||
return mImage->GetCachedBitmap(p, bNoRemap0? FImageSource::noremap0 : FImageSource::normal, trans);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ TArray<uint8_t> FSkyBox::Get8BitPixels(bool alphatex)
|
|||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
FBitmap FSkyBox::GetBgraBitmap(PalEntry *p, int *trans)
|
||||
FBitmap FSkyBox::GetBgraBitmap(const PalEntry *p, int *trans)
|
||||
{
|
||||
return previous->GetBgraBitmap(p, trans);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ public:
|
|||
|
||||
FSkyBox(const char *name);
|
||||
TArray<uint8_t> Get8BitPixels(bool alphatex);
|
||||
FBitmap GetBgraBitmap(PalEntry *, int *trans) override;
|
||||
FBitmap GetBgraBitmap(const PalEntry *, int *trans) override;
|
||||
FImageSource *GetImage() const override;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ FTexture::~FTexture ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
FBitmap FTexture::GetBgraBitmap(PalEntry *remap, int *ptrans)
|
||||
FBitmap FTexture::GetBgraBitmap(const PalEntry *remap, int *ptrans)
|
||||
{
|
||||
FBitmap bmp;
|
||||
bmp.Create(Width, Height);
|
||||
|
|
|
|||
|
|
@ -312,7 +312,7 @@ public:
|
|||
|
||||
// Returns the whole texture, stored in column-major order
|
||||
virtual TArray<uint8_t> Get8BitPixels(bool alphatex);
|
||||
virtual FBitmap GetBgraBitmap(PalEntry *remap, int *trans = nullptr);
|
||||
virtual FBitmap GetBgraBitmap(const PalEntry *remap, int *trans = nullptr);
|
||||
|
||||
static bool SmoothEdges(unsigned char * buffer,int w, int h);
|
||||
static PalEntry averageColor(const uint32_t *data, int size, int maxout);
|
||||
|
|
@ -514,7 +514,7 @@ public:
|
|||
}
|
||||
|
||||
FImageSource* GetImage() const override { return mImage; }
|
||||
FBitmap GetBgraBitmap(PalEntry* p, int* trans) override;
|
||||
FBitmap GetBgraBitmap(const PalEntry* p, int* trans) override;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue