- implemented a proper texture composition cache.

This will mostly ensure that each patch used for composition is only loaded once and automatically unloaded once no longer needed.
So far only for paletted rendering, but the same logic can be used for true color as well.
This commit is contained in:
Christoph Oelckers 2018-12-10 01:17:39 +01:00
commit 2e7bcf9e41
32 changed files with 367 additions and 60 deletions

View file

@ -64,7 +64,7 @@ class FPatchTexture : public FImageSource
bool isalpha = false;
public:
FPatchTexture (int lumpnum, patch_t *header, bool isalphatex);
TArray<uint8_t> GetPalettedPixels(int conversion) override;
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
int CopyPixels(FBitmap *bmp, int conversion) override;
void DetectBadPatches();
};
@ -163,7 +163,7 @@ FPatchTexture::FPatchTexture (int lumpnum, patch_t * header, bool isalphatex)
//
//==========================================================================
TArray<uint8_t> FPatchTexture::GetPalettedPixels(int conversion)
TArray<uint8_t> FPatchTexture::CreatePalettedPixels(int conversion)
{
uint8_t *remap, remaptable[256];
int numspans;