- changed return value of CreatePalettedPixels.

The new struct will allpw return of static pixel data without reallocation and copying.
This commit is contained in:
Christoph Oelckers 2023-01-07 17:55:55 +01:00
commit 1a0aa95ff4
24 changed files with 103 additions and 84 deletions

View file

@ -58,7 +58,7 @@ public:
FVoxelTexture(FVoxel *voxel);
int CopyPixels(FBitmap *bmp, int conversion) override;
TArray<uint8_t> CreatePalettedPixels(int conversion) override;
PalettedPixels CreatePalettedPixels(int conversion) override;
protected:
FVoxel *SourceVox;
@ -84,10 +84,10 @@ FVoxelTexture::FVoxelTexture(FVoxel *vox)
//
//===========================================================================
TArray<uint8_t> FVoxelTexture::CreatePalettedPixels(int conversion)
PalettedPixels FVoxelTexture::CreatePalettedPixels(int conversion)
{
// GetPixels gets called when a translated palette is used so we still need to implement it here.
TArray<uint8_t> Pixels(256, true);
PalettedPixels Pixels(256);
uint8_t *pp = SourceVox->Palette.Data();
if(pp != NULL)