Add config for shadow intensity

This commit is contained in:
Eduardo Quezada 2024-10-08 12:21:06 -03:00
parent d1056f887b
commit f913f2884b
4 changed files with 17 additions and 8 deletions

View File

@ -72,11 +72,14 @@
// These generational defines only make a distinction for OW_ALTERED_TIME_RATIO
#define GEN_8_PLA GEN_LATEST + 2
//Time
// Time
#define OW_TIMES_OF_DAY GEN_LATEST // Different generations have the times of day change at different times.
#define OW_USE_FAKE_RTC FALSE // When TRUE, seconds on the in-game clock will only advance once every 60 playTimeVBlanks (every 60 frames).
#define OW_ALTERED_TIME_RATIO GEN_LATEST // In GEN_8_PLA, the time in game moves forward 60 seconds for every second in the RTC. In GEN_9, it is 20 seconds. This has no effect if OW_USE_FAKE_RTC is FALSE.
// Lighting
#define OW_SHADOW_INTENSITY 4 // Ranges from 0 to 16, where 0 is fully transparent and 16 is black.
// Overworld flags
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.

View File

@ -1,6 +1,8 @@
#ifndef GUARD_CONSTANTS_FIELD_WEATHER_H
#define GUARD_CONSTANTS_FIELD_WEATHER_H
#include "config/overworld.h"
#define MAX_RAIN_SPRITES 24
#define NUM_CLOUD_SPRITES 3
#define NUM_FOG_HORIZONTAL_SPRITES 20
@ -22,4 +24,6 @@
#define FADE_FROM_WHITE 2
#define FADE_TO_WHITE 3
#define BASE_SHADOW_INTENSITY (16 - OW_SHADOW_INTENSITY)
#endif // GUARD_CONSTANTS_FIELD_WEATHER_H

View File

@ -301,7 +301,7 @@ static void Task_WeatherMain(u8 taskId)
static void None_Init(void)
{
Weather_SetBlendCoeffs(8, 12); // Indoor shadows
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // Indoor shadows
gWeatherPtr->noShadows = FALSE;
gWeatherPtr->targetColorMapIndex = 0;
gWeatherPtr->colorMapStepDelay = 0;

View File

@ -153,11 +153,13 @@ bool8 Clouds_Finish(void)
return FALSE;
}
STATIC_ASSERT(OW_SHADOW_INTENSITY >= 0 && OW_SHADOW_INTENSITY <= 16, ObjEventShadowTransparencyNotInRange)
void Sunny_InitVars(void)
{
gWeatherPtr->targetColorMapIndex = 0;
gWeatherPtr->colorMapStepDelay = 20;
Weather_SetBlendCoeffs(8, 12);
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}
@ -485,7 +487,7 @@ void Rain_InitVars(void)
gWeatherPtr->targetColorMapIndex = 3;
gWeatherPtr->colorMapStepDelay = 20;
SetRainStrengthFromSoundEffect(SE_RAIN);
Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}
@ -780,7 +782,7 @@ void Snow_InitVars(void)
gWeatherPtr->colorMapStepDelay = 20;
gWeatherPtr->targetSnowflakeSpriteCount = NUM_SNOWFLAKE_SPRITES;
gWeatherPtr->snowflakeVisibleCounter = 0;
Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}
@ -1029,7 +1031,7 @@ void Thunderstorm_InitVars(void)
gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment
gWeatherPtr->thunderEnqueued = FALSE;
SetRainStrengthFromSoundEffect(SE_THUNDERSTORM);
Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}
@ -1059,7 +1061,7 @@ void Downpour_InitVars(void)
gWeatherPtr->colorMapStepDelay = 20;
gWeatherPtr->weatherGfxLoaded = FALSE; // duplicate assignment
SetRainStrengthFromSoundEffect(SE_DOWNPOUR);
Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}
@ -2272,7 +2274,7 @@ void Shade_InitVars(void)
gWeatherPtr->initStep = 0;
gWeatherPtr->targetColorMapIndex = 3;
gWeatherPtr->colorMapStepDelay = 20;
Weather_SetBlendCoeffs(8, 12); // preserve shadow darkness
Weather_SetBlendCoeffs(8, BASE_SHADOW_INTENSITY); // preserve shadow darkness
gWeatherPtr->noShadows = FALSE;
}