VOXELFORMAT: return the given index if it's in the default palette range

master
Martin Gerhardy 2020-06-14 22:15:34 +02:00
parent 1108506c1d
commit 49a607779e
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ const glm::vec4& VoxFileFormat::getColor(const Voxel& voxel) const {
uint8_t VoxFileFormat::convertPaletteIndex(uint32_t paletteIndex) const {
if (paletteIndex >= _paletteSize) {
return 1;
return paletteIndex % 255;
}
return _palette[paletteIndex];
}