Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <PR/gbi.h>
3#include <main.h>
4#include <defines.h>
6
15void render_actor_box_truck(Camera* arg0, struct Actor* arg1) {
16 UNUSED s32 pad[6];
17 Mat4 spD8;
18 UNUSED s32 pad2[32];
19 f32 temp_f0 =
20 is_within_render_distance(arg0->pos, arg1->pos, arg0->rot[1], 2500.0f, gCameraZoom[arg0 - camera1], 9000000.0f);
21 if (temp_f0 < 0.0f) {
22 return;
23 }
24
25 gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON);
26 gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
27
28 mtxf_pos_rotation_xyz(spD8, arg1->pos, arg1->rot);
29 if (render_set_position(spD8, 0) != 0) {
30
31 switch (arg1->state) {
32 case 0:
34 break;
35 case 1:
37 break;
38 case 2:
40 break;
41 }
42
44 if (temp_f0 < 160000.0f) {
45 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_0);
46 } else if (temp_f0 < 640000.0f) {
47 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
48 } else {
49 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
50 }
51 } else if (temp_f0 < 160000.0f) {
52 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_1);
53 } else {
54 gSPDisplayList(gDisplayListHead++, &toads_turnpike_dl_2);
55 }
56 }
57}
Gfx toads_turnpike_dl_0[]
Definition course_offsets.c:50
Gfx toads_turnpike_dl_2[]
Definition course_offsets.c:70
Gfx toads_turnpike_dl_1[]
Definition course_offsets.c:60
void render_actor_box_truck(Camera *arg0, struct Actor *arg1)
Renders the box truck actor. Actor used in Toad's Turnpike. His update are made in vehicle.
Definition render.inc.c:15
Camera * camera1
Definition camera.c:23
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
#define G_ON
Definition mbi.h:51
Definition actor_types.h:120
s16 state
Definition actor_types.h:124
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
Gfx d_course_toads_turnpike_dl_23858[]
Definition course_data.c:7731
Gfx d_course_toads_turnpike_dl_238A0[]
Definition course_data.c:7745
Gfx d_course_toads_turnpike_dl_238E8[]
Definition course_data.c:7759
signed int s32
Definition ultratypes.h:15
float f32
Definition ultratypes.h:34