coastline 0.0.4
Loading...
Searching...
No Matches
vehiclemodel.h
Go to the documentation of this file.
1#ifndef COASTLINE_VEHICLEMODEL_H
2#define COASTLINE_VEHICLEMODEL_H
3
4#include "common/carphysics.h"
6#include "common/ptr32.h"
7#include "common/render.h"
8
9#if TGR_BOSS_RALLY
10#include "common/assetnames.h"
11#endif
12
14#define VEHICLE_WHEELS 4
15
17enum {
21};
22
23/* The detail of the model of a car. */
24#define VEHICLE_LODS 3
25#define VEHICLE_DISPLAY_LISTS 10
26
28enum {
33};
34
35/* The textures whose palettes give the colours of a car. */
36#define VEHICLE_MATERIALS 12
37#define VEHICLE_MATERIAL_PAINT 2
38#define VEHICLE_MATERIAL_HEADLIGHTS 10
39#define VEHICLE_MATERIAL_REAR_LIGHTS 11
40
42enum {
49};
50
55typedef struct VehicleModel {
56#if TGR_BOSS_RALLY
57 u8 abUnknown0[4]; /* +0x00 */
58 s32 textureEntries[30];
59 s32 textureEntryCount;
60 s32 rearLightTextureEntry;
61 s32 lightTextureEntries[4];
62 u8 abUnknown94[2]; /* +0x94 */
63 s8 rearWheelDrive;
64 s8 tableIndex;
65 f32 gearRatios[CAR_GEAR_RATIOS];
66 f32 torqueCurve[4];
67 f32 finalDrive;
68 Vec3f boxSize;
69 f32 boxCenterZ;
70 s8 gearCount;
71 s8 driveMode;
72 u8 abUnknownDa; /* +0xda */
73 u8 tachometer;
74 u8 abUnknownDc[8]; /* +0xdc */
75 s8 dashboardWidth;
76 s8 dashboardHeight;
77 s8 gearX;
78 s8 gearY;
79 s8 gearWidth;
80 s8 gearHeight;
82 union {
83 s8 needleX;
84 s8 barSegments;
85 };
86 s8 needleY;
87 f32 needleFullAngle;
88 f32 needleRestAngle;
89 u8 abUnknownF4[8]; /* +0xf4 */
90 s32 gearImageBytes;
91 u16 dashboardPalettes[2][256];
92 u8 dashboardImages[0x7b00];
93#endif /* TGR_BOSS_RALLY */
94
96#if TGR_BOSS_RALLY
97 TGR_PTR(void) unreconstructed4; /* +0x8004 */
98 u32 unreconstructed8; /* +0x8008 */
99 TGR_PTR(void) unreconstructedC; /* +0x800c */
100#else
101 u8 unreconstructed4[0x10 - 0x4];
102#endif
109 TGR_PTR(void)
112 TGR_PTR(void)
115 u8 unreconstructed98[0xB0 - 0x98];
135 u8 unreconstructed120[0xDF88 - 0x120];
138
139#ifdef __cplusplus
140extern "C" {
141#endif
142
154
166
181void LoadCar(s32 slot, s32 car, void *source);
182
196
211void SetMaterialColor(VehicleModel *model, s32 red, s32 green, s32 blue);
212
225
226#if TGR_BOSS_RALLY
227
235void ByteSwapAndRelocateCarModel(VehicleModel *model);
236
245
252extern VehicleModel *g_pTextureCaptureVehicleModel;
253
259extern s32 g_dwTextureCaptureOverflowCount;
260
268void AppendVehicleModelTextureEntry(s32 entry);
269
278s32 IsVehicleMaterialPalette(const void *palette);
279#endif /* TGR_BOSS_RALLY */
280
281#ifdef __cplusplus
282}
283#endif
284
285#endif /* COASTLINE_VEHICLEMODEL_H */
#define CAR_GEAR_RATIOS
The gears of a gearbox, neutral first.
Definition carphysics.h:11
The state the renderer shares between the parts of a frame.
Gfx DisplayListCommand
A display-list command in the Nintendo 64 renderer.
Definition displaylistops.h:21
Pointers of 32 bits in the data the game reads from files and in its display lists.
#define TGR_PTR(T)
A pointer of 32 bits to T.
Definition ptr32.h:152
A texture of a model and its palette.
Definition render.h:63
A point or direction in space.
Definition vecmath.h:17
The model of a car as it is loaded from the cartridge.
Definition vehiclemodel.h:55
s32 textureCount
Definition vehiclemodel.h:103
void * unreconstructed90
Definition vehiclemodel.h:110
f32 cockpitUp
Definition vehiclemodel.h:118
void * unreconstructed94
Definition vehiclemodel.h:113
u8 unreconstructed4[0x10 - 0x4]
Definition vehiclemodel.h:101
u8 unreconstructed98[0xB0 - 0x98]
Definition vehiclemodel.h:115
u32 triangleCount
Definition vehiclemodel.h:95
Vec3f wheels[VEHICLE_WHEELS]
Definition vehiclemodel.h:125
DisplayListCommand * displayLists[VEHICLE_LODS][VEHICLE_DISPLAY_LISTS]
Definition vehiclemodel.h:106
u8 ** decalMasks
Definition vehiclemodel.h:132
f32 mirrorForward
Definition vehiclemodel.h:117
u8 materialTextures[VEHICLE_MATERIALS]
Definition vehiclemodel.h:129
DisplayListCommand * wheelDisplayLists[VEHICLE_LODS][VEHICLE_WHEEL_DISPLAY_LISTS]
Definition vehiclemodel.h:120
u8 unreconstructed120[0xDF88 - 0x120]
Definition vehiclemodel.h:135
f32 cockpitForward
Definition vehiclemodel.h:116
ModelTexture * textures
Definition vehiclemodel.h:104
unsigned int u32
Definition ultratypes.h:20
signed char s8
Definition ultratypes.h:23
float f32
Definition ultratypes.h:38
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18
s32 IsVehicleModelValid(s32 car)
Whether the model of a car is on the cartridge.
@ TACHOMETER_BAR_DIMMED
Definition vehiclemodel.h:19
@ TACHOMETER_BAR_HIDDEN
Definition vehiclemodel.h:20
@ TACHOMETER_NEEDLE
Definition vehiclemodel.h:18
#define VEHICLE_LODS
Definition vehiclemodel.h:24
#define VEHICLE_WHEELS
The wheels of a vehicle.
Definition vehiclemodel.h:14
#define VEHICLE_DISPLAY_LISTS
Definition vehiclemodel.h:25
void FixupVehicleModelPointers(VehicleModel *model)
Relocate loaded model pointers on N64.
s32 g_adwVehicleModelSlotCars[]
The car whose model each slot holds.
void LoadCar(s32 slot, s32 car, void *source)
Load a car model into a slot, fix up its pointers, and record the car.
void SetMaterialColor(VehicleModel *model, s32 red, s32 green, s32 blue)
Paint the materials of a model a colour of 5 bits a channel.
@ VEHICLE_WHEEL_DL_NORMAL
Definition vehiclemodel.h:29
@ VEHICLE_WHEEL_DL_1
Definition vehiclemodel.h:30
@ VEHICLE_WHEEL_DISPLAY_LISTS
Definition vehiclemodel.h:32
@ VEHICLE_WHEEL_DL_SNOW
Definition vehiclemodel.h:31
VehicleModel g_aVehicleModels[]
The models of the cars the vehicles drive, in slots.
void LoadVehicleModelFromRom(VehicleModel *model, s32 car)
Load a car model from platform asset storage.
@ VEHICLE_DL_UNDERSIDE
Definition vehiclemodel.h:46
@ VEHICLE_DL_HEADLIGHT_BEAMS
Definition vehiclemodel.h:45
@ VEHICLE_DL_NEAR_DETAIL
Definition vehiclemodel.h:43
@ VEHICLE_DL_BODY
Definition vehiclemodel.h:44
@ VEHICLE_DL_HIGHLIGHTED
Definition vehiclemodel.h:48
@ VEHICLE_DL_TEXTURED
Definition vehiclemodel.h:47
#define VEHICLE_MATERIALS
Definition vehiclemodel.h:36