Fix default palette for voxel BGRA slab data and support translated 8-bit slab data in true color mode
This commit is contained in:
parent
756e6432c0
commit
77a388e908
3 changed files with 9 additions and 6 deletions
|
|
@ -401,7 +401,9 @@ FVoxel::~FVoxel()
|
|||
|
||||
void FVoxel::CreateBgraSlabData()
|
||||
{
|
||||
assert(Palette != NULL);
|
||||
uint8_t *palette = Palette;
|
||||
if (palette == nullptr)
|
||||
palette = (uint8_t *)GPalette.BaseColors;
|
||||
|
||||
for (int i = 0; i < NumMips; ++i)
|
||||
{
|
||||
|
|
@ -424,9 +426,9 @@ void FVoxel::CreateBgraSlabData()
|
|||
{
|
||||
int colorIndex = src->col[j];
|
||||
|
||||
uint32_t red = (Palette[colorIndex * 3 + 0] << 2) | (Palette[colorIndex * 3 + 0] >> 4);
|
||||
uint32_t green = (Palette[colorIndex * 3 + 1] << 2) | (Palette[colorIndex * 3 + 1] >> 4);
|
||||
uint32_t blue = (Palette[colorIndex * 3 + 2] << 2) | (Palette[colorIndex * 3 + 2] >> 4);
|
||||
uint32_t red = (palette[colorIndex * 3 + 0] << 2) | (palette[colorIndex * 3 + 0] >> 4);
|
||||
uint32_t green = (palette[colorIndex * 3 + 1] << 2) | (palette[colorIndex * 3 + 1] >> 4);
|
||||
uint32_t blue = (palette[colorIndex * 3 + 2] << 2) | (palette[colorIndex * 3 + 2] >> 4);
|
||||
|
||||
dest->col[j] = 0xff000000 | (red << 16) | (green << 8) | blue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue