summaryrefslogtreecommitdiff
path: root/src/field_screen_effect.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/field_screen_effect.c')
-rw-r--r--src/field_screen_effect.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c
index 0cf5e4145..eda146725 100644
--- a/src/field_screen_effect.c
+++ b/src/field_screen_effect.c
@@ -35,7 +35,6 @@
#include "trainer_hill.h"
#include "fldeff.h"
-// This file's functions.
static void Task_ExitNonAnimDoor(u8);
static void Task_ExitNonDoor(u8);
static void Task_DoContestHallWarp(u8);
@@ -50,9 +49,9 @@ static void Task_EnableScriptAfterMusicFade(u8 taskId);
// data[0] is used universally by tasks in this file as a state for switches
#define tState data[0]
-// const
-static const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
-const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelPixelRadii) - 1;
+// Smaller flash level -> larger flash radius
+static const u16 sFlashLevelToRadius[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
+const s32 gMaxFlashLevel = ARRAY_COUNT(sFlashLevelToRadius) - 1;
const struct ScanlineEffectParams sFlashEffectParams =
{
@@ -503,7 +502,7 @@ void DoDiveWarp(void)
CreateTask(Task_WarpAndLoadMap, 10);
}
-void DoSootopolisLegendWarp(void)
+void DoWhiteFadeWarp(void)
{
ScriptContext2_Enable();
TryFadeOutOldMapMusic();
@@ -971,14 +970,14 @@ static u8 StartUpdateOrbFlashEffect(s32 centerX, s32 centerY, s32 initialFlashRa
#undef tFlashRadiusDelta
#undef tClearScanlineEffect
-// A higher flashLevel value is a smaller flash radius (more darkness). 0 is full brightness
-void AnimateFlash(u8 flashLevel)
+// A higher flash level is a smaller flash radius (more darkness). 0 is full brightness
+void AnimateFlash(u8 newFlashLevel)
{
- u8 curFlashLevel = Overworld_GetFlashLevel();
+ u8 curFlashLevel = GetFlashLevel();
bool8 fullBrightness = FALSE;
- if (!flashLevel)
+ if (newFlashLevel == 0)
fullBrightness = TRUE;
- StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[curFlashLevel], sFlashLevelPixelRadii[flashLevel], fullBrightness, 1);
+ StartUpdateFlashLevelEffect(DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[curFlashLevel], sFlashLevelToRadius[newFlashLevel], fullBrightness, 1);
StartWaitForFlashUpdate();
ScriptContext2_Enable();
}
@@ -987,7 +986,7 @@ void WriteFlashScanlineEffectBuffer(u8 flashLevel)
{
if (flashLevel)
{
- SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelPixelRadii[flashLevel]);
+ SetFlashScanlineEffectWindowBoundaries(&gScanlineEffectRegBuffers[0][0], DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2, sFlashLevelToRadius[flashLevel]);
CpuFastSet(&gScanlineEffectRegBuffers[0], &gScanlineEffectRegBuffers[1], 480);
}
}