summaryrefslogtreecommitdiff
path: root/src/field_screen_effect.c
diff options
context:
space:
mode:
authorGriffinR <griffin.g.richards@gmail.com>2021-11-16 17:12:16 -0500
committerGriffinR <griffin.g.richards@gmail.com>2021-11-16 17:46:34 -0500
commit61aa9c3ba983462ab3420920ce8b5de5601f54f8 (patch)
tree6ff3ddca2523fbf8255a9e3954c2b2f012bc72f5 /src/field_screen_effect.c
parentd4147879320c563254059a92eb7a07b5cfcc2143 (diff)
More updating event macro comments
Diffstat (limited to 'src/field_screen_effect.c')
-rw-r--r--src/field_screen_effect.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/field_screen_effect.c b/src/field_screen_effect.c
index b17617eff..5a7351bf2 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 =
{
@@ -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 = 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);
}
}