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>
4
13void render_actor_palm_tree(Camera* arg0, UNUSED Mat4 arg1, struct PalmTree* arg2) {
14 Vec3s spA8 = { 0, 0, 0 };
15 Mat4 sp68;
16 f32 temp_f0;
17 s16 temp_v0 = arg2->flags;
18
19 if ((temp_v0 & 0x800)) {
20 return;
21 }
22
23 temp_f0 =
24 is_within_render_distance(arg0->pos, arg2->pos, arg0->rot[1], 0.0f, gCameraZoom[arg0 - camera1], 4000000.0f);
25
26 if (CVarGetInteger("gNoCulling", 0) == 1) {
27 temp_f0 = MAX(temp_f0, 0.0f);
28 }
29
30 if (!(temp_f0 < 0.0f)) {
31 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
32 func_8029794C(arg2->pos, arg2->rot, 2.0f);
33 }
34 mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8);
35 if (render_set_position(sp68, 0) != 0) {
36
37 gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
38 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
39
40 switch (arg2->variant) {
41 case 0:
42 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk1);
43 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
44 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top1);
45 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
46 break;
47
48 case 1:
49 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk2);
50 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
51 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top2);
52 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
53 break;
54
55 case 2:
56 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk3);
57 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
58 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top3);
59 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
60 break;
61 }
62 }
63 }
64}
void gSPDisplayList(Gfx *pkt, Gfx *dl)
Definition GBIMiddleware.cpp:11
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:460
Camera * camera1
Definition camera.c:29
s16 Vec3s[3]
Definition common_structs.h:15
f32 Mat4[4][4]
Definition common_structs.h:20
#define UNUSED
Definition macros.h:26
#define MAX(a, b)
Definition macros.h:130
Gfx * gDisplayListHead
Definition main.c:136
f32 gCameraZoom[4]
Definition main.c:126
s32 render_set_position(Mat4 mtx, s32 arg1)
Definition math_util.c:54
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1100
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:450
void render_actor_palm_tree(Camera *arg0, UNUSED Mat4 arg1, struct PalmTree *arg2)
Renders the palm tree actor. Actor used in Koopa Troopa Beach.
Definition render.inc.c:13
Definition camera.h:27
Vec3s rot
Definition camera.h:34
Vec3f pos
Definition camera.h:28
Definition actor_types.h:288
Vec3s rot
Definition actor_types.h:295
s16 variant
Definition actor_types.h:291
s16 flags
Definition actor_types.h:290
Vec3f pos
Definition actor_types.h:297