1#ifndef COASTLINE_RACE_H
2#define COASTLINE_RACE_H
42#define START_LIGHT_STEPS 5
52#define CAPTION_LINES 6
54#define CAPTION_LINES 5
77#define SAVED_RESULTS 2
90extern u8 _startLightsSegmentRomStart[];
91extern u8 _startLightsSegmentRomEnd[];
337#if TGR_PLATFORM == TGR_PLATFORM_N64
346#if defined(__mips__) || defined(__sgi)
349#define g_pFirstCreditLineText (g_aCreditScrollLines[0].text)
881 void RunRaceGameScreen(
void);
The state the renderer shares between the parts of a frame.
The models of the menus and splash screens: loading, animating and drawing them.
Whether the race is paused, and the items of the pause menu.
s32 g_adwSavedResultLaps[SAVED_RESULTS]
The number of completed laps in each saved local result.
Vec3f * g_pAirplanePathRight
The right edge of the aeroplane flight path.
f32 g_fAirplaneDistance
How far the airplane flew along the leg of the path to the current node, and its length.
void SaveRaceResultsToSlots(void)
Keep the results of the local players for the results screen.
s32 g_bStartLightsVisible
Whether the start lights are drawn.
s32 g_dwRacePhase
The phase of the race, by the RACE_PHASE_ values.
Model * g_pStartLightsModel
The model of the start lights.
s32 g_dwStartLightsAnimation
How the start lights animate: 0 not at all, -1 held in their first pose, and 1 running.
void AnimateStartLights(void)
Advance the animations of the start lights, holding them in place while they hold their first pose.
s32 g_dwRaceExitState
Whether the screen is leaving the race.
s32 g_dwSeasonResultMsgLineCount
The number of lines in the season result message.
Vec3f g_vAirplaneDirNext
The direction of the next aeroplane flight segment.
CreditLine g_aCreditScrollLines[]
The scrolling credits, ending with a NULL text.
f32 g_afSavedResultBestLapTimes[SAVED_RESULTS]
The best lap time of each saved local result, in seconds.
s32 g_dwSaveAvailable
Whether a time attack left something to save, so that its results open the save menu.
s32 g_adwWaterfallInstances[16]
The scene instance index of each waterfall in the loaded track.
#define START_LIGHT_STEPS
The steps of the countdown of the start lights.
Definition race.h:42
void UpdateRaceAnimations(void)
Move the animations of the race between frames, while the race is not paused.
#define RACE_PHASES
The phases of g_aRacePhaseTable.
Definition race.h:39
s32 g_dwRaceInitialized
Whether the race is set up.
u8 g_abRacePositionPoints[]
The points of each place of a race of the championship.
f32 g_fRacePhaseTimer
The time left in the phase of the race, in seconds.
s32 g_dwPrevViewportCount
The views of the last frame.
u32 g_adwTrackMusicRom[12]
The cartridge offsets of the music of each track, the mirrored ones after the others,...
RaceCaption g_aCreditCaptions[]
The captions of the credits, ending with a NULL title.
s32 g_dwScreenClearFrames
The frames the screen is still cleared, after the views changed or the pause ended.
s32 g_dwAirplaneNodeCount
The number of nodes in the aeroplane flight path.
s32 g_adwSavedResultBestLaps[SAVED_RESULTS]
The best lap number of each saved local result, counted from 0.
Vec3f g_vAirplaneDir
The direction of the current aeroplane flight segment.
f32 g_fAirplaneScale
The scale of the model of the airplane.
f32 g_afSavedResultTimes[SAVED_RESULTS]
The race time of each saved local result, in seconds.
f32 g_fStartLightsDrop
How far the start lights rise out of view once the race starts.
s32 g_dwRaceFinishOrderCounter
The vehicles that finished the race so far.
RacePhaseStep g_aRacePhaseTable[RACE_PHASES]
The phases of a race in their order.
void RestoreRaceResultsFromSlots(void)
Give the kept results back to the vehicles, scoring them in the championship first.
s32 g_adwSavedResultPositions[SAVED_RESULTS]
The results of the local players the results screen shows: the place, the time, the best lap and its ...
Vec3f g_vAirplaneDirPrev
The directions of the legs of the path before, along and after the one the airplane flies,...
s16 g_wRaceScreenLoopExited
Set once the loop of the race screen ends, and cleared when a race starts.
s32 g_dwAirplaneTriggerLap
The lap on which the aeroplane trigger starts the flight.
void ScrollTextUp(void)
Move the scrolling credits up a pixel.
f32 g_fAirplaneSegmentLength
The length of the current aeroplane flight segment.
s32 g_bDemoInterrupted
Whether a button ended the race the computer drives, which then returns to the main menu rather than ...
@ RACE_PHASE_COUNTDOWN
Definition race.h:30
@ RACE_PHASE_FINISHED
Definition race.h:33
@ RACE_PHASE_WAIT
Definition race.h:29
@ RACE_PHASE_AFTER
Definition race.h:34
@ RACE_PHASE_HOLD
Definition race.h:28
@ RACE_PHASE_RACING
Definition race.h:32
@ RACE_PHASE_LEAVE
Definition race.h:35
@ RACE_PHASE_GO
Definition race.h:31
s32 g_dwAirplaneNode
The node of the path the airplane flies towards, and the nodes of the path.
s32 g_dwSavedResultsValid
Whether the results of the last race are kept.
s32 g_dwStartLightsStep
The step of the countdown of the start lights.
void RenderStartLights(void)
Draw the start lights over the start of the track.
f32 g_fRaceCaptionTimer
The time of the caption shown and its index.
s32 g_dwWaterfallCount
The waterfalls of the track, as placed models.
s32 g_bReplayAfterRace
Whether leaving the race starts its instant replay.
f32 g_afStartLightThresholds[START_LIGHT_STEPS]
The times left in the countdown at which the start lights change, in seconds.
s32 g_dwAirplaneTrigger
The scene instance whose contact starts the aeroplane flight.
#define SAVED_RESULTS
The players whose results are kept for the results screen.
Definition race.h:77
const char * g_apszSeasonResultMsgLines[]
The lines of the message of the result of a season.
#define g_pFirstCreditLineText
The first scrolling credit line's text pointer.
Definition race.h:349
void SetTrackFromSeason(void)
Choose the track of the next race of the championship.
void DrawScrollingText(void)
Draw the lines of the scrolling credits that are on the screen.
void ProcessRacingScreen(void)
Process the racing screen.
s32 g_dwRacePhaseIndex
The index of the phase in g_aRacePhaseTable.
void ProcessSeasonResults(void)
Score championship progress and unlock bonuses when the season's points qualify.
f32 g_aafSavedResultLapTimes[SAVED_RESULTS][5]
The time of each completed lap in each saved local result, in seconds.
void CalculateScrollPositions(void)
Place the lines of the scrolling credits below the screen.
char g_szFormatBuffer[0x20]
The text of a line of the pause menu.
s32 g_dwAirplaneInstance
The placed model of the airplane, or 0 when the track has none or it landed, and the model a vehicle ...
#define CAPTION_LINES
The lines of a caption of the credits.
Definition race.h:54
void LoadAndPlayTrackBgm(void)
Decompress the music of the selected track and start it.
const char * g_apszPlaceNames[]
The names of the places in a race: "1st" and on.
s32 g_dwRaceCaptionIndex
The credit caption currently shown during the attract race.
s32 g_bAirplaneFlying
Whether the airplane flies.
Vec3f * g_pAirplanePathLeft
The left and right edges of the path of the airplane.
A line of the credits that scroll up at the end of the championship.
Definition race.h:69
s32 size
Definition race.h:71
s32 y
Definition race.h:70
const char * text
Definition race.h:73
s32 gap
Definition race.h:72
A model loaded from the cartridge, with its display lists and the animations of its parts.
Definition model.h:91
A caption the credits show over a race.
Definition race.h:58
f32 duration
Definition race.h:60
const char * lines[CAPTION_LINES]
Definition race.h:61
u8 unreconstructed1C[0x20 - 0x1C]
Definition race.h:64
const char * title
Definition race.h:59
A phase of a race and how long it lasts.
Definition race.h:45
f32 seconds
Definition race.h:47
s32 phase
Definition race.h:46
A point or direction in space.
Definition vecmath.h:17
The rectangle of the screen a view fills.
Definition render.h:134
Integer and floating-point types of libultra.
unsigned int u32
Definition ultratypes.h:20
short s16
Definition ultratypes.h:24
float f32
Definition ultratypes.h:38
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...