diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2022-01-17 17:00:18 -0500 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2022-01-17 17:00:18 -0500 |
commit | 313f14ed63f52b6b4371cabe858c5cde5705cc0f (patch) | |
tree | e0345a7285a8662dd3d903c7d408ebfbf0c7627c /src | |
parent | 177863da4728237c8fef4e6b69417d91d1b003cd (diff) |
Add Spinda spot color constants
Diffstat (limited to 'src')
-rw-r--r-- | src/pokemon.c | 13 |
1 files 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; \ } \ } \ |