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>
5
13void render_actor_railroad_crossing(Camera *arg0, struct RailroadCrossing *rr_crossing) {
14 UNUSED Vec3s sp80 = {0, 0, 0};
15 Mat4 sp40;
16 f32 unk = is_within_render_distance(arg0->pos, rr_crossing->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
17
18 if (!(unk < 0.0f)) {
19 mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot);
20
21 if (render_set_position(sp40, 0) != 0) {
22 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
23 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
24
25 if (isCrossingTriggeredByIndex[rr_crossing->crossingId]) {
26
27 if (rr_crossing->someTimer < 20) {
29 } else {
31 }
32 } else {
34 }
35 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
36 }
37 }
38}
Camera * camera1
Definition camera.c:23
u16 isCrossingTriggeredByIndex[2]
Definition code_80005FD0.c:140
s16 Vec3s[3]
Definition common_structs.h:11
f32 Mat4[4][4]
Definition common_structs.h:16
#define G_CULL_BACK
Definition gbi.h:355
#define G_LIGHTING
Definition gbi.h:359
Gfx d_course_kalimari_desert_dl_crossing_both_inactive[]
Definition course_data.c:4844
Gfx d_course_kalimari_desert_dl_crossing_left_active[]
Definition course_data.c:4803
Gfx d_course_kalimari_desert_dl_crossing_right_active[]
Definition course_data.c:4762
#define UNUSED
Definition macros.h:24
Gfx * gDisplayListHead
Definition main.c:133
f32 gCameraZoom[4]
Definition main.c:123
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1092
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:466
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:49
void render_actor_railroad_crossing(Camera *arg0, struct RailroadCrossing *rr_crossing)
Renders the railroad crossing actor. Actor used in Kalimari Desert.
Definition render.inc.c:13
Definition camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
Definition actor_types.h:158
s16 crossingId
Definition actor_types.h:162
Vec3s rot
Definition actor_types.h:165
Vec3f pos
Definition actor_types.h:167
s16 someTimer
Definition actor_types.h:161
float f32
Definition ultratypes.h:33