diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index bbfad0be1e..45e98a437b 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -216,7 +216,7 @@ void TextureCache::CreateTextures() void TextureCache::GeneratePaletteTexture() { - static_assert(PALETTE_TOTAL_OFFSETS + 5 < 256, "Height of palette too large!"); + static_assert(kPaletteTotalOffsets + 5 < 256, "Height of palette too large!"); constexpr int32_t height = 256; constexpr int32_t width = height; DrawPixelInfo dpi = CreateDPI(width, height); @@ -227,7 +227,7 @@ void TextureCache::GeneratePaletteTexture() dpi.bits[i] = i; } - for (int i = 0; i < PALETTE_TOTAL_OFFSETS; ++i) + for (int i = 0; i < kPaletteTotalOffsets; ++i) { GLint y = PaletteToY(static_cast(i)); diff --git a/src/openrct2/drawing/Drawing.cpp b/src/openrct2/drawing/Drawing.cpp index 655e4748fe..9f73daa40c 100644 --- a/src/openrct2/drawing/Drawing.cpp +++ b/src/openrct2/drawing/Drawing.cpp @@ -405,7 +405,7 @@ const FilterPaletteID GlassPaletteIds[COLOUR_COUNT] = { }; // Previously 0x97FCBC use it to get the correct palette from g1_elements -static constexpr uint16_t palette_to_g1_offset[PALETTE_TOTAL_OFFSETS] = { +static constexpr uint16_t palette_to_g1_offset[kPaletteTotalOffsets] = { SPR_PALETTE_BLACK, SPR_PALETTE_GREY, SPR_PALETTE_WHITE, @@ -904,7 +904,7 @@ void GfxDrawPickedUpPeep(DrawPixelInfo& dpi) std::optional GetPaletteG1Index(colour_t paletteId) { - if (paletteId < PALETTE_TOTAL_OFFSETS) + if (paletteId < kPaletteTotalOffsets) { return palette_to_g1_offset[paletteId]; } diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index a4225bd0f0..b787dbcaf8 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -504,8 +504,7 @@ void FASTCALL BlitPixels(const uint8_t* src, uint8_t* dst, const PaletteMap& pal } } -#define PALETTE_TO_G1_OFFSET_COUNT 144 -constexpr uint8_t PALETTE_TOTAL_OFFSETS = 192; +constexpr uint8_t kPaletteTotalOffsets = 192; #define INSET_RECT_F_30 (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_NONE) #define INSET_RECT_F_60 (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_DONT_LIGHTEN)