Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <main.h>
3#include <defines.h>
4
13void render_actor_car(Camera* arg0, struct Actor* arg1) {
14 UNUSED s32 pad[6];
15 Mat4 spC8;
16 UNUSED s32 pad2[32];
17 f32 temp_f0 =
18 is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
19
20 if (!(temp_f0 < 0.0f)) {
21
22 gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
23 gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
24
25 mtxf_pos_rotation_xyz(spC8, arg1->pos, arg1->rot);
26 mtxf_scale(spC8, 0.1f);
27 if (render_set_position(spC8, 0) != 0) {
28
30 if (temp_f0 < 160000.0f) {
31 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_9);
32 } else if (temp_f0 < 640000.0f) {
33 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
34 } else {
35 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
36 }
37 } else if (temp_f0 < 160000.0f) {
38 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_10);
39 } else {
40 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_11);
41 }
42 }
43 }
44}
Gfx toads_turnpike_dl_11[]
Definition course_offsets.c:163
Gfx toads_turnpike_dl_10[]
Definition course_offsets.c:153
Gfx toads_turnpike_dl_9[]
Definition course_offsets.c:143
Camera * camera1
Definition camera.c:23
void render_actor_car(Camera *arg0, struct Actor *arg1)
Renders the car actor. Actor used in Toad's Turnpike. His update are made in vehicle.
Definition render.inc.c:13
f32 Mat4[4][4]
Definition common_structs.h:16
#define SCREEN_MODE_1P
Options for gScreenModeSelection and gActiveScreenMode.
Definition defines.h:198
#define G_LIGHTING
Definition gbi.h:355
#define UNUSED
Definition macros.h:23
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
s32 gActiveScreenMode
Definition main.c:176
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1114
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:468
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:47
void mtxf_scale(Mat4 mat, f32 coef)
Definition math_util.c:455
#define G_ON
Definition mbi.h:51
Definition actor_types.h:120
Vec3s rot
Definition actor_types.h:127
Vec3f pos
Definition actor_types.h:129
Definition camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
signed int s32
Definition ultratypes.h:15
float f32
Definition ultratypes.h:34