coastline 0.0.4
Loading...
Searching...
No Matches
racerslot.h
Go to the documentation of this file.
1#ifndef COASTLINE_RACERSLOT_H
2#define COASTLINE_RACERSLOT_H
3
4#include "common/types.h"
5#include "common/vecmath.h"
6#include "common/vehiclefwd.h"
7
8struct TrackSection;
9
11#define RACER_SLOTS 20
12
14#define RACER_CLOCK_STOPPED 0x3
16#define RACER_HELD 0x1
18#define RACER_FINISHED 0x2
19
24#if TGR_BOSS_RALLY && defined(__cplusplus)
25class RacerSlot {
26private:
27#else
28typedef struct RacerSlot {
29#endif
46 u8 unreconstructed58[0x5C - 0x58];
47 u8 color[3];
52 u8 unreconstructed6C[0x74 - 0x6C];
56#if TGR_BOSS_RALLY
57 u8 **colorPanels;
58 s32 colorPanelCount;
59
60#ifdef __cplusplus
61
68 void UpdateRaceProgress(void);
69
70public:
77 void UpdateRacerSlotMotion(void);
78
85 void UpdateRemoteVehicleFrame(void);
86
93 void UpdateRacerSlotRaceState(void);
95 Vec3f &GetPosition() {
96 return position;
97 }
99 Vec3f &GetPreviousPosition() {
100 return previousPosition;
101 }
103 Vec3f &GetVelocity() {
104 return velocity;
105 }
107 u8 *GetColor() {
108 return color;
109 }
111 f32 GetSpeedKph() const {
112 return speedKph;
113 }
118 f32 SetSpeedKph(f32 value) {
119 return speedKph = value;
120 }
122 TrackSection *GetSection() const {
123 return section;
124 }
129 TrackSection *SetSection(TrackSection *value) {
130 return section = value;
131 }
133 s32 GetPointIndex() const {
134 return pointIndex;
135 }
140 s32 SetPointIndex(s32 value) {
141 return pointIndex = value;
142 }
144 f32 GetLapTime() const {
145 return lapTime;
146 }
151 f32 SetLapTime(f32 value) {
152 return lapTime = value;
153 }
155 f32 GetBestLapTime() const {
156 return bestLapTime;
157 }
162 f32 SetBestLapTime(f32 value) {
163 return bestLapTime = value;
164 }
166 f32 GetTotalTime() const {
167 return totalTime;
168 }
173 f32 SetTotalTime(f32 value) {
174 return totalTime = value;
175 }
177 f32 GetTimeLeft() const {
178 return timeLeft;
179 }
184 f32 SetTimeLeft(f32 value) {
185 return timeLeft = value;
186 }
188 s32 GetLap() const {
189 return lap;
190 }
195 s32 SetLap(s32 value) {
196 return lap = value;
197 }
199 s32 GetDistanceLaps() const {
200 return distanceLaps;
201 }
206 s32 SetDistanceLaps(s32 value) {
207 return distanceLaps = value;
208 }
210 s32 GetMaxGate() const {
211 return maxGate;
212 }
217 s32 SetMaxGate(s32 value) {
218 return maxGate = value;
219 }
221 s32 GetGate() const {
222 return gate;
223 }
228 s32 SetGate(s32 value) {
229 return gate = value;
230 }
232 f32 GetDistance() const {
233 return distance;
234 }
239 f32 SetDistance(f32 value) {
240 return distance = value;
241 }
243 s32 GetRacePosition() const {
244 return racePosition;
245 }
250 s32 SetRacePosition(s32 value) {
251 return racePosition = value;
252 }
254 Vehicle *GetVehicle() const {
255 return vehicle;
256 }
261 Vehicle *SetVehicle(Vehicle *value) {
262 return vehicle = value;
263 }
265 s32 GetIndex() const {
266 return index;
267 }
272 s32 SetIndex(s32 value) {
273 return index = value;
274 }
276 u32 GetStatus() const {
277 return status;
278 }
283 u32 SetStatus(u32 value) {
284 return status = value;
285 }
287 s32 GetStraggler() const {
288 return straggler;
289 }
294 s32 SetStraggler(s32 value) {
295 return straggler = value;
296 }
298 u8 **GetColorPanels() const {
299 return colorPanels;
300 }
305 u8 **SetColorPanels(u8 **value) {
306 return colorPanels = value;
307 }
309 s32 GetColorPanelCount() const {
310 return colorPanelCount;
311 }
316 s32 SetColorPanelCount(s32 value) {
317 return colorPanelCount = value;
318 }
319
326 void FreeEnemyCarColorPanels(void);
327
334 void InitRacerSlot(void);
335
336#endif /* __cplusplus */
337#endif /* TGR_BOSS_RALLY */
338#if TGR_BOSS_RALLY && defined(__cplusplus)
339};
340#else
342#endif
343
344#ifdef __cplusplus
345extern "C" {
346#endif
347
359
371
383
384#if TGR_PLATFORM == TGR_PLATFORM_N64
395#endif /* TGR_PLATFORM == TGR_PLATFORM_N64 */
396
397#if TGR_BOSS_RALLY
405void MakeEnemyCarColorPanels(RacerSlot *slot);
406
415void ApplyEnemyCarColorPanels(Vehicle *vehicle, RacerSlot *slot);
416#endif /* TGR_BOSS_RALLY */
417
418#ifdef __cplusplus
419}
420#endif
421
422#endif /* COASTLINE_RACERSLOT_H */
void UpdateRacerSlotMotion(RacerSlot *slot)
Drive an assigned vehicle or advance an unassigned racer along the route.
void UpdateRaceProgress(RacerSlot *slot)
Count the gates and laps a racer crossed this frame, with its lap records and messages,...
void UpdateRacerSlotRaceState(RacerSlot *slot)
Update the assigned vehicle timers, messages, progress, and velocity for a frame.
void SortRacersByPosition(void)
Give each racer its place by distance, or read assigned vehicle positions from the network.
void InitRacerSlot(RacerSlot *slot)
Set up a racer slot for the start of the race: attach its vehicle, or place it on the route of the tr...
RacerSlot g_aRacerSlots[RACER_SLOTS]
The racers of the race.
#define RACER_SLOTS
The racers of a race.
Definition racerslot.h:11
A racer of a race.
Definition racerslot.h:28
Vec3f previousPosition
Definition racerslot.h:31
s32 racePosition
Definition racerslot.h:45
s32 lap
Definition racerslot.h:40
s32 straggler
Definition racerslot.h:53
s32 index
Definition racerslot.h:49
f32 lapTime
Definition racerslot.h:36
f32 distance
Definition racerslot.h:44
struct TrackSection * section
Definition racerslot.h:34
Vehicle * vehicle
Definition racerslot.h:48
f32 speedKph
Definition racerslot.h:33
u8 color[3]
Definition racerslot.h:47
s32 pointIndex
Definition racerslot.h:35
u8 unreconstructed6C[0x74 - 0x6C]
Definition racerslot.h:52
u32 status
Definition racerslot.h:50
u8 unreconstructed58[0x5C - 0x58]
Definition racerslot.h:46
s32 gate
Definition racerslot.h:43
s32 distanceLaps
Definition racerslot.h:41
f32 bestLapTime
Definition racerslot.h:37
Vec3f position
Definition racerslot.h:30
f32 totalTime
Definition racerslot.h:38
f32 timeLeft
Definition racerslot.h:39
Vec3f velocity
Definition racerslot.h:32
s32 maxGate
Definition racerslot.h:42
A section of the route.
Definition track.h:38
A point or direction in space.
Definition vecmath.h:17
A vehicle.
Definition vehicle.h:143
struct TrackSection TrackSection
A section of the route.
The integer and floating-point types of the console, for headers shared with Windows.
unsigned int u32
Definition ultratypes.h:20
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...
struct Vehicle Vehicle
A vehicle in the race simulation.
Definition vehiclefwd.h:9