Add Spinda spot color constants

This commit is contained in:
GriffinR 2022-01-17 17:00:18 -05:00
parent 177863da47
commit 313f14ed63

View File

@ -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; \
} \
} \