resonance 1.0.1
Loading...
Searching...
No Matches
MetFade Class Reference

Driver of the full-screen metagame fade. More...

#include <metfade.h>

Public Types

enum  State { kStateIdle = 0 , kStateOut = 1 , kStateIn = 2 }
 The fade in progress. More...

Public Member Functions

 MetFade (MetRenderer *pRenderer)
 Resolve the fade rectangle and prime the two timers.
void FadeOut (float duration, float start, FadeUser *pUser, int nRetainView)
 Start the fade out, the one a screen runs as it departs.
void FadeIn (float duration, float start, FadeUser *pUser, int nRetainView)
 Start the fade in, the one a screen runs as it enters.
void Update (float frame)
 Advance whichever fade is running.

Detailed Description

Driver of the full-screen metagame fade.

The class emits no RTTI descriptor and no __FILE__ path survives for its translation unit, because its constructor writes no virtual function table pointer and it declares no destructor. The name here is inferred from the two literals its constructor and its fade routines use, metfade.rect at 0x007d8dd0 and met_fade.view at 0x007d8de0.

The global operator new(0x2c) at its allocation sites fixes the object size at 0x2c bytes. MetLoadGameScreen and MetMemDetectStartup each build one and each release it through the scalar deallocator with no null test. A delete expression compiles to the same call for a class with no destructor. The European release also builds one in MetLogoScreen.

A fade runs from a start frame to an end frame. While one runs, the fade view is attached to the renderer's screen scene and the rectangle's vertex alpha follows a linear ramp over the span. When it finishes, the receiver passed to FadeOut() or FadeIn() is notified. No member name is attested anywhere in the image, so every identifier below is inferred.

The European release detaches the view before it attaches it at the start of a fade. A finished fade sets the final alpha before it hides the rectangle, and the rectangle stays hidden.

Member Enumeration Documentation

◆ State

The fade in progress.

Enumerator
kStateIdle 

No fade is running.

kStateOut 

FadeOut() is running.

kStateIn 

FadeIn() is running.

Constructor & Destructor Documentation

◆ MetFade()

MetFade::MetFade ( MetRenderer * pRenderer)

Resolve the fade rectangle and prime the two timers.

Both start frames begin at 1.0e9, which is the sentinel for a fade that is not running. The rectangle is the object named metfade.rect, cast to Rnd::Mesh, and a null result is stored as such. The constructor then hides the rectangle without testing it for null.

Parameters
pRendererThe front-end renderer the fade draws through.
Ghidra address:
NTSC-U/C: 0x0016a1c8
Ghidra address:
PAL: 0x0016c3c8

Member Function Documentation

◆ FadeOut()

void MetFade::FadeOut ( float duration,
float start,
FadeUser * pUser,
int nRetainView )

Start the fade out, the one a screen runs as it departs.

Shows the rectangle, records the span and the ramp, and attaches met_fade.view to the renderer's screen scene. The ramp runs the rectangle's alpha from 1 at the start frame down to 0 at the end frame.

Parameters
durationThe length of the fade in frames.
startThe frame the fade starts on.
pUserThe receiver whose slot 2 runs when the fade finishes, or null for none.
nRetainViewStored for UpdateIn(). The fade out itself never reads it.
Ghidra address:
NTSC-U/C: 0x0016a608
Ghidra address:
PAL: 0x0016ce48

◆ FadeIn()

void MetFade::FadeIn ( float duration,
float start,
FadeUser * pUser,
int nRetainView )

Start the fade in, the one a screen runs as it enters.

The same as FadeOut() against the second timer, except that the rectangle is not shown and the ramp runs the alpha from 0 at the start frame up to 1 at the end frame.

Parameters
durationThe length of the fade in frames.
startThe frame the fade starts on.
pUserThe receiver whose slot 3 runs when the fade finishes, or null for none.
nRetainViewNon-zero to leave the view attached and the rectangle shown when the fade finishes.
Ghidra address:
NTSC-U/C: 0x0016d750
Ghidra address:
PAL: 0x0016cc30

◆ Update()

void MetFade::Update ( float frame)

Advance whichever fade is running.

Any state other than kStateIdle and kStateOut advances the fade in.

Parameters
frameThe current frame.
Ghidra address:
NTSC-U/C: 0x0016d710
Ghidra address:
PAL: 0x001700e8

The documentation for this class was generated from the following file: