Rename PALETTE_TOTAL_OFFSETS to kPaletteTotalOffsets

This commit is contained in:
Harry-Hopkinson 2024-04-26 16:03:53 +00:00 committed by Harry Hopkinson
parent 8ce6ba7606
commit ef7d7575de
3 changed files with 5 additions and 6 deletions

View File

@ -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<FilterPaletteID>(i));

View File

@ -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<uint32_t> GetPaletteG1Index(colour_t paletteId)
{
if (paletteId < PALETTE_TOTAL_OFFSETS)
if (paletteId < kPaletteTotalOffsets)
{
return palette_to_g1_offset[paletteId];
}

View File

@ -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)