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],
17 4000000.0f);
18
19 if (!(unk < 0.0f)) {
20 mtxf_pos_rotation_xyz(sp40, rr_crossing->pos, rr_crossing->rot);
21
22 if (render_set_position(sp40, 0) != 0) {
23 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
24 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
25
26 if (isCrossingTriggeredByIndex[rr_crossing->crossingId]) {
27
28 if (rr_crossing->someTimer < 20) {
30 } else {
32 }
33 } else {
35 }
36 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
37 }
38 }
39}
Camera * camera1
Definition camera.c:23
u16 isCrossingTriggeredByIndex[NUM_CROSSINGS]
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:351
#define G_LIGHTING
Definition gbi.h:355
Gfx d_course_kalimari_desert_dl_crossing_both_inactive[]
Definition course_data.c:3499
Gfx d_course_kalimari_desert_dl_crossing_left_active[]
Definition course_data.c:3454
Gfx d_course_kalimari_desert_dl_crossing_right_active[]
Definition course_data.c:3409
#define UNUSED
Definition macros.h:23
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
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 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:34