coastline 0.0.4
Loading...
Searching...
No Matches
fade.h File Reference

The fades of the screen, the sound effects and the music, and the fog over the view. More...

#include <PR/ultratypes.h>
Include dependency graph for fade.h:

Go to the source code of this file.

Functions

void ResetHeadlightGlare (void)
 Clear the glare of the headlights over the view.
void RenderHeadlightGlare (void)
 Draw the glare of the headlights over the view as white of its opacity, when it is strong enough.
void SetFadeTarget (float target, float seconds)
 Fade the screen towards a level over a time in seconds.
void FadeSfxTo (float target, float seconds)
 Fade the volume of the sound effects towards a level over a time in seconds.
void FadeMusicTo (float target, float seconds)
 Fade the volume of the music towards a level over a time in seconds.
s32 HasSfxFadeFinished (void)
 Whether the fade of the sound effects has reached its target.
void SetSfxFadeLevelImmediate (float level)
 Set the volume of the sound effects and its target at once.
void SnapScreenFade (float level)
 Set the level of the screen and its target at once.
s32 IsFadingIn (void)
 Whether the screen fades in and does not turn back by itself.
s32 IsFadingOut (void)
 Whether the screen fades out, or will once it has faded in.
s32 IsFadeComplete (void)
 Whether the screen has reached its target and does not turn back by itself.
s32 IsFadedToBlack (void)
 Whether the screen has faded out to black.
s32 IsFadedToWhite (void)
 Whether the screen has faded in to the whole picture.
void UnusedScreenFadeStub (void)
 Preserve an empty entry point in the original fade sequence.
void ApplyScreenFade (void)
 Draw the wipe of the frame: black over the edges the fade has covered.
void DrawScreenFadeOverlay (float level)
 Draw black over the whole screen, more opaque the lower a level from 0 to 1.
void UpdateFadeTransitions (void)
 Step the fades of the screen, the sound effects and the music by the time of the frame, move the edges of the wipe, and set the volumes.

Variables

s32 g_dwFadeRectLeft
 The edges of the picture the wipe leaves, in pixels.
s32 g_dwFadeRectRight
 The right edge of the visible picture during a wipe, in pixels.
s32 g_dwFadeRectTop
 The top edge of the visible picture during a wipe, in pixels.
s32 g_dwFadeRectBottom
 The bottom edge of the visible picture during a wipe, in pixels.
f32 g_fHeadlightGlare
 How much the headlights shining at the camera whiten the view, from 0 to 1.
f32 g_fFadeTarget
 The level the screen fades to.
f32 g_fFadeRate
 The change of the level each second, below 0 when fading out.
f32 g_fFadeLevel
 The current screen fade level, from 0 for black to 1 for the full picture.
f32 g_fMusicFadeTarget
 The fade of the music: its target, its change each second and its level.
f32 g_fMusicFadeSpeed
 The change of music fade level per second.
f32 g_fMusicFadeCurrent
 The current music fade level, from 0 for silent to 1 for full volume.
f32 g_fSfxFadeTarget
 The fade of the sound effects: its target, its change each second and its level.
f32 g_fSfxFadeSpeed
 The change of sound-effect fade level per second.
f32 g_fSfxFadeCurrent
 The current sound-effect fade level, from 0 for silent to 1 for full volume.
s32 g_dwFadeSkipFrame
 Whether the next UpdateFadeTransitions() leaves the level of each fade as it is, set when a fade starts.
s32 g_dwMusicFadeSkipFrame
 Whether the next fade update skips changing the music level.
s32 g_dwSfxFadeSkipFrame
 Whether the next fade update skips changing the sound-effect level.
s32 g_dwFadeAutoReverse
 Whether the screen fades out as soon as it has faded in, because a fade out was asked for while it faded in.
s32 g_adwFadeRectLeftPerBuffer [2]
 The edges of the wipe when each framebuffer was last drawn.
s32 g_adwFadeRectRightPerBuffer [2]
 The right edge of the wipe last drawn in each frame buffer, in pixels.

Detailed Description

The fades of the screen, the sound effects and the music, and the fog over the view.

A fade level runs from 0, black or silent, to 1, the picture shown or the full volume. The screen fades in and out as a wipe: black covers the screen from the right as it fades in, and from the left as it fades out.

Function Documentation

◆ ResetHeadlightGlare()

void ResetHeadlightGlare ( void )

Clear the glare of the headlights over the view.

Ghidra address:
USA: 0x80223470
Ghidra address:
Asia: 0x80222FC0
Ghidra address:
EUR: 0x802247b0
Ghidra address:
JPN: 0x80223fa0
Ghidra address:
BRD3D: 0x1002aef0
Ghidra address:
BRGlide: 0x10017f60

◆ RenderHeadlightGlare()

void RenderHeadlightGlare ( void )

Draw the glare of the headlights over the view as white of its opacity, when it is strong enough.

Ghidra address:
USA: 0x80223480
Ghidra address:
Asia: 0x80222FD0
Ghidra address:
EUR: 0x802247c0
Ghidra address:
JPN: 0x80223fb0

◆ SetFadeTarget()

void SetFadeTarget ( float target,
float seconds )

Fade the screen towards a level over a time in seconds.

A fade out asked for while the screen fades in waits until it has faded in.

Parameters
targetThe level to fade to, from 0 for black to 1 for the whole picture.
secondsThe time a fade across the whole range takes, in seconds.
Ghidra address:
USA: 0x80223688
Ghidra address:
Asia: 0x802231D8
Ghidra address:
EUR: 0x802249c8
Ghidra address:
JPN: 0x802241b8
Ghidra address:
BRD3D: 0x1002b130
Ghidra address:
BRGlide: 0x100181a0

◆ FadeSfxTo()

void FadeSfxTo ( float target,
float seconds )

Fade the volume of the sound effects towards a level over a time in seconds.

Parameters
targetThe volume to fade to, from 0 for silence to 1 for full volume.
secondsThe time a fade across the whole range takes, in seconds.
Ghidra address:
USA: 0x80223750
Ghidra address:
Asia: 0x802232A0
Ghidra address:
EUR: 0x80224a90
Ghidra address:
JPN: 0x80224280
Ghidra address:
BRD3D: 0x1002b1c0
Ghidra address:
BRGlide: 0x10018230

◆ FadeMusicTo()

void FadeMusicTo ( float target,
float seconds )

Fade the volume of the music towards a level over a time in seconds.

Parameters
targetThe volume to fade to, from 0 for silence to 1 for full volume.
secondsThe time a fade across the whole range takes, in seconds.
Ghidra address:
USA: 0x802237d0
Ghidra address:
Asia: 0x80223320
Ghidra address:
EUR: 0x80224b10
Ghidra address:
JPN: 0x80224300
Ghidra address:
BRD3D: 0x1002b220
Ghidra address:
BRGlide: 0x10018290

◆ HasSfxFadeFinished()

s32 HasSfxFadeFinished ( void )

Whether the fade of the sound effects has reached its target.

Returns
1 if the volume equals its target, 0 otherwise.
Ghidra address:
USA: 0x80223850
Ghidra address:
Asia: 0x802233A0
Ghidra address:
EUR: 0x80224b90
Ghidra address:
JPN: 0x80224380

◆ SetSfxFadeLevelImmediate()

void SetSfxFadeLevelImmediate ( float level)

Set the volume of the sound effects and its target at once.

Parameters
levelThe volume, from 0 for silence to 1 for full volume.
Ghidra address:
USA: 0x80223880
Ghidra address:
Asia: 0x802233D0
Ghidra address:
EUR: 0x80224bc0
Ghidra address:
JPN: 0x802243b0

◆ SnapScreenFade()

void SnapScreenFade ( float level)

Set the level of the screen and its target at once.

Parameters
levelThe level, from 0 for black to 1 for the whole picture.
Ghidra address:
USA: 0x8022389c
Ghidra address:
Asia: 0x802233EC
Ghidra address:
EUR: 0x80224bdc
Ghidra address:
JPN: 0x802243cc
Ghidra address:
BRD3D: 0x1002b280
Ghidra address:
BRGlide: 0x100182f0

◆ IsFadingIn()

s32 IsFadingIn ( void )

Whether the screen fades in and does not turn back by itself.

Returns
1 if the screen fades in, 0 otherwise.
Ghidra address:
USA: 0x802238b8
Ghidra address:
Asia: 0x80223408
Ghidra address:
EUR: 0x80224bf8
Ghidra address:
JPN: 0x802243e8

◆ IsFadingOut()

s32 IsFadingOut ( void )

Whether the screen fades out, or will once it has faded in.

Returns
1 if the screen fades out or will, 0 otherwise.
Ghidra address:
USA: 0x802238fc
Ghidra address:
Asia: 0x8022344C
Ghidra address:
EUR: 0x80224c3c
Ghidra address:
JPN: 0x8022442c
Ghidra address:
BRD3D: 0x1002b2a0
Ghidra address:
BRGlide: 0x10018310

◆ IsFadeComplete()

s32 IsFadeComplete ( void )

Whether the screen has reached its target and does not turn back by itself.

Returns
1 if the fade is complete, 0 otherwise.
Ghidra address:
USA: 0x80223940
Ghidra address:
Asia: 0x80223490
Ghidra address:
EUR: 0x80224c80
Ghidra address:
JPN: 0x80224470
Ghidra address:
BRD3D: 0x1002b2d0
Ghidra address:
BRGlide: 0x10018340

◆ IsFadedToBlack()

s32 IsFadedToBlack ( void )

Whether the screen has faded out to black.

Returns
1 if the screen is black, 0 otherwise.
Ghidra address:
USA: 0x80223988
Ghidra address:
Asia: 0x802234D8
Ghidra address:
EUR: 0x80224cc8
Ghidra address:
JPN: 0x802244b8
Ghidra address:
BRD3D: 0x1002b300
Ghidra address:
BRGlide: 0x10018370

◆ IsFadedToWhite()

s32 IsFadedToWhite ( void )

Whether the screen has faded in to the whole picture.

Returns
1 if the whole picture shows, 0 otherwise.
Ghidra address:
USA: 0x802239f4
Ghidra address:
Asia: 0x80223544
Ghidra address:
EUR: 0x80224d34
Ghidra address:
JPN: 0x80224524

◆ UnusedScreenFadeStub()

void UnusedScreenFadeStub ( void )

Preserve an empty entry point in the original fade sequence.

Ghidra address:
USA: 0x80223a68
Ghidra address:
Asia: 0x802235B8
Ghidra address:
EUR: 0x80224da8
Ghidra address:
JPN: 0x80224598

◆ ApplyScreenFade()

void ApplyScreenFade ( void )

Draw the wipe of the frame: black over the edges the fade has covered.

Ghidra address:
USA: 0x80223a70
Ghidra address:
Asia: 0x802235C0
Ghidra address:
EUR: 0x80224db0
Ghidra address:
JPN: 0x802245a0
Ghidra address:
BRD3D: 0x1002b340
Ghidra address:
BRGlide: 0x100183b0

◆ DrawScreenFadeOverlay()

void DrawScreenFadeOverlay ( float level)

Draw black over the whole screen, more opaque the lower a level from 0 to 1.

Parameters
levelThe level, from 0 for opaque black to 1 for no overlay.
Ghidra address:
USA: 0x80223de0
Ghidra address:
Asia: 0x80223930
Ghidra address:
EUR: 0x80225120
Ghidra address:
JPN: 0x80224910

◆ UpdateFadeTransitions()

void UpdateFadeTransitions ( void )

Step the fades of the screen, the sound effects and the music by the time of the frame, move the edges of the wipe, and set the volumes.

Ghidra address:
USA: 0x80223f54
Ghidra address:
Asia: 0x80223AA4
Ghidra address:
EUR: 0x80225294
Ghidra address:
JPN: 0x80224a84
Ghidra address:
BRD3D: 0x1002b670
Ghidra address:
BRGlide: 0x100186e0

Variable Documentation

◆ g_dwFadeRectLeft

s32 g_dwFadeRectLeft
extern

The edges of the picture the wipe leaves, in pixels.

Ghidra address:
USA: 0x8028b740
Ghidra address:
Asia: 0x8028B290
Ghidra address:
EUR: 0x8028d9f0
Ghidra address:
JPN: 0x8028d420
Ghidra address:
BRD3D: 0x10575508
Ghidra address:
BRGlide: 0x104b16b0

◆ g_dwFadeRectRight

s32 g_dwFadeRectRight
extern

The right edge of the visible picture during a wipe, in pixels.

Ghidra address:
USA: 0x8028b744
Ghidra address:
Asia: 0x8028B294
Ghidra address:
EUR: 0x8028d9f4
Ghidra address:
JPN: 0x8028d424
Ghidra address:
BRD3D: 0x10575500
Ghidra address:
BRGlide: 0x104b16a8

◆ g_dwFadeRectTop

s32 g_dwFadeRectTop
extern

The top edge of the visible picture during a wipe, in pixels.

Ghidra address:
USA: 0x8028b748
Ghidra address:
Asia: 0x8028B298
Ghidra address:
EUR: 0x8028d9f8
Ghidra address:
JPN: 0x8028d428
Ghidra address:
BRD3D: 0x1057550c
Ghidra address:
BRGlide: 0x104b16b4

◆ g_dwFadeRectBottom

s32 g_dwFadeRectBottom
extern

The bottom edge of the visible picture during a wipe, in pixels.

Ghidra address:
USA: 0x8028b74c
Ghidra address:
Asia: 0x8028B29C
Ghidra address:
EUR: 0x8028d9fc
Ghidra address:
JPN: 0x8028d42c
Ghidra address:
BRD3D: 0x105754fc
Ghidra address:
BRGlide: 0x104b16a4

◆ g_fHeadlightGlare

f32 g_fHeadlightGlare
extern

How much the headlights shining at the camera whiten the view, from 0 to 1.

Ghidra address:
USA: 0x8028b750
Ghidra address:
Asia: 0x8028B2A0
Ghidra address:
EUR: 0x8028da00
Ghidra address:
JPN: 0x8028d430
Ghidra address:
BRD3D: 0x10575504
Ghidra address:
BRGlide: 0x104b16ac

◆ g_fFadeTarget

f32 g_fFadeTarget
extern

The level the screen fades to.

Ghidra address:
USA: 0x8028b754
Ghidra address:
Asia: 0x8028B2A4
Ghidra address:
EUR: 0x8028da04
Ghidra address:
JPN: 0x8028d434
Ghidra address:
BRD3D: 0x10575510
Ghidra address:
BRGlide: 0x104b16b8

◆ g_fFadeRate

f32 g_fFadeRate
extern

The change of the level each second, below 0 when fading out.

Ghidra address:
USA: 0x8028b758
Ghidra address:
Asia: 0x8028B2A8
Ghidra address:
EUR: 0x8028da08
Ghidra address:
JPN: 0x8028d438
Ghidra address:
BRD3D: 0x10575514
Ghidra address:
BRGlide: 0x104b16bc

◆ g_fFadeLevel

f32 g_fFadeLevel
extern

The current screen fade level, from 0 for black to 1 for the full picture.

Ghidra address:
USA: 0x8028b75c
Ghidra address:
Asia: 0x8028B2AC
Ghidra address:
EUR: 0x8028da0c
Ghidra address:
JPN: 0x8028d43c
Ghidra address:
BRD3D: 0x10575518
Ghidra address:
BRGlide: 0x104b16c0

◆ g_fMusicFadeTarget

f32 g_fMusicFadeTarget
extern

The fade of the music: its target, its change each second and its level.

Ghidra address:
USA: 0x8028b760
Ghidra address:
Asia: 0x8028B2B0
Ghidra address:
EUR: 0x8028da10
Ghidra address:
JPN: 0x8028d440
Ghidra address:
BRD3D: 0x100a81ac
Ghidra address:
BRGlide: 0x100a7500

◆ g_fMusicFadeSpeed

f32 g_fMusicFadeSpeed
extern

The change of music fade level per second.

Ghidra address:
USA: 0x8028b764
Ghidra address:
Asia: 0x8028B2B4
Ghidra address:
EUR: 0x8028da14
Ghidra address:
JPN: 0x8028d444
Ghidra address:
BRD3D: 0x1057551c
Ghidra address:
BRGlide: 0x104b16c4

◆ g_fMusicFadeCurrent

f32 g_fMusicFadeCurrent
extern

The current music fade level, from 0 for silent to 1 for full volume.

Ghidra address:
USA: 0x8028b768
Ghidra address:
Asia: 0x8028B2B8
Ghidra address:
EUR: 0x8028da18
Ghidra address:
JPN: 0x8028d448
Ghidra address:
BRD3D: 0x100a81b0
Ghidra address:
BRGlide: 0x100a7504

◆ g_fSfxFadeTarget

f32 g_fSfxFadeTarget
extern

The fade of the sound effects: its target, its change each second and its level.

Ghidra address:
USA: 0x8028b76c
Ghidra address:
Asia: 0x8028B2BC
Ghidra address:
EUR: 0x8028da1c
Ghidra address:
JPN: 0x8028d44c
Ghidra address:
BRD3D: 0x100a81b4
Ghidra address:
BRGlide: 0x100a7508

◆ g_fSfxFadeSpeed

f32 g_fSfxFadeSpeed
extern

The change of sound-effect fade level per second.

Ghidra address:
USA: 0x8028b770
Ghidra address:
Asia: 0x8028B2C0
Ghidra address:
EUR: 0x8028da20
Ghidra address:
JPN: 0x8028d450
Ghidra address:
BRD3D: 0x10575520
Ghidra address:
BRGlide: 0x104b16c8

◆ g_fSfxFadeCurrent

f32 g_fSfxFadeCurrent
extern

The current sound-effect fade level, from 0 for silent to 1 for full volume.

Ghidra address:
USA: 0x8028b774
Ghidra address:
Asia: 0x8028B2C4
Ghidra address:
EUR: 0x8028da24
Ghidra address:
JPN: 0x8028d454
Ghidra address:
BRD3D: 0x100a81b8
Ghidra address:
BRGlide: 0x100a750c

◆ g_dwFadeSkipFrame

s32 g_dwFadeSkipFrame
extern

Whether the next UpdateFadeTransitions() leaves the level of each fade as it is, set when a fade starts.

Ghidra address:
USA: 0x8028b778
Ghidra address:
Asia: 0x8028B2C8
Ghidra address:
EUR: 0x8028da28
Ghidra address:
JPN: 0x8028d458
Ghidra address:
BRD3D: 0x10575524
Ghidra address:
BRGlide: 0x104b16cc

◆ g_dwMusicFadeSkipFrame

s32 g_dwMusicFadeSkipFrame
extern

Whether the next fade update skips changing the music level.

Ghidra address:
USA: 0x8028b77c
Ghidra address:
Asia: 0x8028B2CC
Ghidra address:
EUR: 0x8028da2c
Ghidra address:
JPN: 0x8028d45c
Ghidra address:
BRD3D: 0x10575528
Ghidra address:
BRGlide: 0x104b16d0

◆ g_dwSfxFadeSkipFrame

s32 g_dwSfxFadeSkipFrame
extern

Whether the next fade update skips changing the sound-effect level.

Ghidra address:
USA: 0x8028b780
Ghidra address:
Asia: 0x8028B2D0
Ghidra address:
EUR: 0x8028da30
Ghidra address:
JPN: 0x8028d460
Ghidra address:
BRD3D: 0x1057552c
Ghidra address:
BRGlide: 0x104b16d4

◆ g_dwFadeAutoReverse

s32 g_dwFadeAutoReverse
extern

Whether the screen fades out as soon as it has faded in, because a fade out was asked for while it faded in.

Ghidra address:
USA: 0x8028b784
Ghidra address:
Asia: 0x8028B2D4
Ghidra address:
EUR: 0x8028da34
Ghidra address:
JPN: 0x8028d464
Ghidra address:
BRD3D: 0x10575530
Ghidra address:
BRGlide: 0x104b16d8

◆ g_adwFadeRectLeftPerBuffer

s32 g_adwFadeRectLeftPerBuffer[2]
extern

The edges of the wipe when each framebuffer was last drawn.

Ghidra address:
USA: 0x8031b410
Ghidra address:
Asia: 0x8031AEC0
Ghidra address:
EUR: 0x8031d910
Ghidra address:
JPN: 0x8031c540
Ghidra address:
BRD3D: 0x105754f0
Ghidra address:
BRGlide: 0x104b1698

◆ g_adwFadeRectRightPerBuffer

s32 g_adwFadeRectRightPerBuffer[2]
extern

The right edge of the wipe last drawn in each frame buffer, in pixels.

Ghidra address:
USA: 0x8031b418
Ghidra address:
Asia: 0x8031AEC8
Ghidra address:
EUR: 0x8031d918
Ghidra address:
JPN: 0x8031c548
Ghidra address:
BRD3D: 0x105754e8
Ghidra address:
BRGlide: 0x104b1690