diff --git a/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md b/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md index a1cc519..1cf8746 100644 --- a/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md +++ b/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md @@ -120,7 +120,7 @@ void StartWeather(void) } ``` -If using dynamic palettes, you will need to make the above changes but with an added for loop like so: +**If using dynamic palettes**, you will need to make the above changes but with an added for loop like so: ``` diff void StartWeather(void) { @@ -134,27 +134,24 @@ void StartWeather(void) + sPaletteColorMapTypes = sBasePaletteColorMapTypes; gWeatherPtr->contrastColorMapSpritePalIndex = index; gWeatherPtr->rainSpriteCount = 0; - gWeatherPtr->curRainSpriteIndex = 0; - gWeatherPtr->cloudSpritesCreated = 0; - gWeatherPtr->snowflakeSpriteCount = 0; - gWeatherPtr->ashSpritesCreated = 0; - gWeatherPtr->fogHSpritesCreated = 0; - gWeatherPtr->fogDSpritesCreated = 0; - gWeatherPtr->sandstormSpritesCreated = 0; - gWeatherPtr->sandstormSwirlSpritesCreated = 0; - gWeatherPtr->bubblesSpritesCreated = 0; - gWeatherPtr->lightenedFogSpritePalsCount = 0; - Weather_SetBlendCoeffs(16, 0); - gWeatherPtr->currWeather = 0; - gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_IDLE; - gWeatherPtr->readyForInit = FALSE; - gWeatherPtr->weatherChangeComplete = TRUE; - gWeatherPtr->taskId = CreateTask(Task_WeatherInit, 80); +//... } } ``` -And remove the `BuildColorMaps()` function itself: +Also **if you have dynamic palettes**, make sure you change the definition of `sBasePaletteColorMapTypes`: +``` diff +-static const u8 ALIGNED(2) sBasePaletteColorMapTypes[32] = ++EWRAM_DATA u8 ALIGNED(2) sBasePaletteGammaTypes[32] = { +{ + // background palettes + COLOR_MAP_DARK_CONTRAST, + COLOR_MAP_DARK_CONTRAST, + COLOR_MAP_DARK_CONTRAST, +//... +``` + +And (from now on for both dynamic palettes and vanilla) remove the `BuildColorMaps()` function itself: ``` diff //...