From 313f14ed63f52b6b4371cabe858c5cde5705cc0f Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 17 Jan 2022 17:00:18 -0500 Subject: [PATCH] Add Spinda spot color constants --- src/pokemon.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index bc83bc588..902d576f7 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5653,9 +5653,12 @@ u16 SpeciesToCryId(u16 species) return gSpeciesIdToCryId[species - (SPECIES_TREECKO - 1)]; } -// To draw the spot, add 4 to the color indexes -#define SPOT_COLOR_ADJUSTMENT 4 +// Spots can be drawn on Spinda's color indexes 1, 2, or 3 +#define FIRST_SPOT_COLOR 1 +#define LAST_SPOT_COLOR 3 +// To draw a spot pixel, add 4 to the color index +#define SPOT_COLOR_ADJUSTMENT 4 /* The macro below handles drawing the randomly-placed spots on Spinda's front sprite. Spinda has 4 spots, each with an entry in gSpindaSpotGraphics. Each entry contains @@ -5711,13 +5714,15 @@ u16 SpeciesToCryId(u16 species) if (column & 1) \ { \ /* Draw spot pixel if this is Spinda's body color */ \ - if ((u8)((*destPixels & 0xF0) - (1 << 4)) <= (2 << 4)) \ + if ((u8)((*destPixels & 0xF0) - (FIRST_SPOT_COLOR << 4))\ + <= ((LAST_SPOT_COLOR - FIRST_SPOT_COLOR) << 4))\ *destPixels += (SPOT_COLOR_ADJUSTMENT << 4); \ } \ else \ { \ /* Draw spot pixel if this is Spinda's body color */ \ - if ((u8)((*destPixels & 0xF) - 1) <= 2) \ + if ((u8)((*destPixels & 0xF) - FIRST_SPOT_COLOR) \ + <= (LAST_SPOT_COLOR - FIRST_SPOT_COLOR)) \ *destPixels += SPOT_COLOR_ADJUSTMENT; \ } \ } \