Fixed sandstorm shadow color.
This commit is contained in:
parent
7b59eabbcf
commit
c3fdaca8e2
1 changed files with 19 additions and 11 deletions
|
@ -1377,6 +1377,17 @@ static void DestroyFogHorizontalSprites(void);
|
||||||
// Within the weather palette, shadow sprites' color index
|
// Within the weather palette, shadow sprites' color index
|
||||||
#define SHADOW_COLOR_INDEX 9
|
#define SHADOW_COLOR_INDEX 9
|
||||||
|
|
||||||
|
// Updates just the color of shadows to match special weather blending
|
||||||
|
static u8 UpdateShadowColor(u16 color) {
|
||||||
|
u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START);
|
||||||
|
if (paletteNum != 0xFF) {
|
||||||
|
u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX;
|
||||||
|
gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = color;
|
||||||
|
UpdateSpritePaletteWithTime(paletteNum);
|
||||||
|
}
|
||||||
|
return paletteNum;
|
||||||
|
}
|
||||||
|
|
||||||
void FogHorizontal_InitVars(void)
|
void FogHorizontal_InitVars(void)
|
||||||
{
|
{
|
||||||
gWeatherPtr->initStep = 0;
|
gWeatherPtr->initStep = 0;
|
||||||
|
@ -1415,10 +1426,7 @@ void FogHorizontal_Main(void)
|
||||||
if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) {
|
if (gWeatherPtr->currWeather == WEATHER_FOG_HORIZONTAL) {
|
||||||
u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START);
|
u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START);
|
||||||
Weather_SetTargetBlendCoeffs(12, 8, 3);
|
Weather_SetTargetBlendCoeffs(12, 8, 3);
|
||||||
if (paletteNum != 0xFF) { // Lighten shadow color to match
|
UpdateShadowColor(0x3DEF); // Gray
|
||||||
u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX; // Shadow color index
|
|
||||||
gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = 0x3DEF; // Gray
|
|
||||||
}
|
|
||||||
} else
|
} else
|
||||||
Weather_SetTargetBlendCoeffs(4, 16, 0);
|
Weather_SetTargetBlendCoeffs(4, 16, 0);
|
||||||
gWeatherPtr->initStep++;
|
gWeatherPtr->initStep++;
|
||||||
|
@ -1435,7 +1443,6 @@ void FogHorizontal_Main(void)
|
||||||
|
|
||||||
bool8 FogHorizontal_Finish(void)
|
bool8 FogHorizontal_Finish(void)
|
||||||
{
|
{
|
||||||
u8 paletteNum = IndexOfSpritePaletteTag(TAG_WEATHER_START);
|
|
||||||
gWeatherPtr->fogHScrollPosX = (gSpriteCoordOffsetX - gWeatherPtr->fogHScrollOffset) & 0xFF;
|
gWeatherPtr->fogHScrollPosX = (gSpriteCoordOffsetX - gWeatherPtr->fogHScrollOffset) & 0xFF;
|
||||||
if (++gWeatherPtr->fogHScrollCounter > 3)
|
if (++gWeatherPtr->fogHScrollCounter > 3)
|
||||||
{
|
{
|
||||||
|
@ -1458,10 +1465,7 @@ bool8 FogHorizontal_Finish(void)
|
||||||
gWeatherPtr->finishStep++;
|
gWeatherPtr->finishStep++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (paletteNum != 0xFF) { // Change shadow color back to black
|
UpdateShadowColor(RGB_BLACK);
|
||||||
u16 index = (paletteNum+16)*16+SHADOW_COLOR_INDEX;
|
|
||||||
gPlttBufferUnfaded[index] = gPlttBufferFaded[index] = RGB_BLACK;
|
|
||||||
}
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1986,7 +1990,7 @@ void Sandstorm_InitVars(void)
|
||||||
|
|
||||||
Weather_SetBlendCoeffs(0, 16);
|
Weather_SetBlendCoeffs(0, 16);
|
||||||
}
|
}
|
||||||
gWeatherPtr->noShadows = TRUE; // TODO: Can sandstorm be compatible with shadows?
|
gWeatherPtr->noShadows = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sandstorm_InitAll(void)
|
void Sandstorm_InitAll(void)
|
||||||
|
@ -2011,7 +2015,8 @@ void Sandstorm_Main(void)
|
||||||
gWeatherPtr->initStep++;
|
gWeatherPtr->initStep++;
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Weather_SetTargetBlendCoeffs(16, 0, 0);
|
Weather_SetTargetBlendCoeffs(16, 2, 0);
|
||||||
|
UpdateShadowColor(0x3DEF);
|
||||||
gWeatherPtr->initStep++;
|
gWeatherPtr->initStep++;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -2037,9 +2042,12 @@ bool8 Sandstorm_Finish(void)
|
||||||
case 1:
|
case 1:
|
||||||
if (Weather_UpdateBlend())
|
if (Weather_UpdateBlend())
|
||||||
gWeatherPtr->finishStep++;
|
gWeatherPtr->finishStep++;
|
||||||
|
if (gWeatherPtr->currBlendEVB == 12)
|
||||||
|
UpdateShadowColor(RGB_BLACK);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
DestroySandstormSprites();
|
DestroySandstormSprites();
|
||||||
|
UpdateShadowColor(RGB_BLACK);
|
||||||
gWeatherPtr->finishStep++;
|
gWeatherPtr->finishStep++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in a new issue