SpaghettiKart
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <main.h>
5
14void render_actor_palm_tree(Camera* camera, UNUSED Mat4 arg1, struct PalmTree* arg2) {
15 Vec3s spA8 = { 0, 0, 0 };
16 Mat4 sp68;
17 f32 temp_f0;
18 s16 temp_v0 = arg2->flags;
19
20 if ((temp_v0 & 0x800)) {
21 return;
22 }
23
24 temp_f0 =
25 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0.0f, camera->fieldOfView, 4000000.0f);
26
27 if (CVarGetInteger("gNoCulling", 0) == 1) {
28 temp_f0 = MAX(temp_f0, 0.0f);
29 }
30
31 if (!(temp_f0 < 0.0f)) {
32 FrameInterpolation_RecordOpenChild("palm_tree", TAG_ITEM_ADDR( ( (uintptr_t)arg2 << 5 ) | camera->cameraId ));
33 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
34 func_8029794C(arg2->pos, arg2->rot, 2.0f);
35 }
36 mtxf_pos_rotation_xyz(sp68, arg2->pos, spA8);
37 if (render_set_position(sp68, 0) != 0) {
38
39 gDPSetTextureLUT(gDisplayListHead++, G_TT_NONE);
40 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
41
42 switch (arg2->variant) {
43 case 0:
44 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk1);
45 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
46 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top1);
47 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
48 break;
49
50 case 1:
51 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk2);
52 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
53 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top2);
54 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
55 break;
56
57 case 2:
58 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_trunk3);
59 gSPClearGeometryMode(gDisplayListHead++, G_CULL_BACK);
60 gSPDisplayList(gDisplayListHead++, d_course_koopa_troopa_beach_dl_tree_top3);
61 gSPSetGeometryMode(gDisplayListHead++, G_CULL_BACK);
62 break;
63 }
64 }
66 }
67}
void FrameInterpolation_RecordOpenChild(const void *a, uintptr_t b)
Definition FrameInterpolation.cpp:640
void FrameInterpolation_RecordCloseChild(void)
Definition FrameInterpolation.cpp:650
#define TAG_ITEM_ADDR(x)
Definition FrameInterpolation.h:21
void gSPDisplayList(Gfx *pkt, Gfx *dl)
Definition GBIMiddleware.cpp:12
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:470
s16 Vec3s[3]
Definition common_structs.h:15
f32 Mat4[4][4]
Definition common_structs.h:20
#define UNUSED
Definition macros.h:40
#define MAX(a, b)
Definition macros.h:144
Gfx * gDisplayListHead
Definition main.c:129
s32 render_set_position(Mat4 mtx, s32 arg1)
Definition math_util.c:53
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1099
void mtxf_pos_rotation_xyz(Mat4 out, Vec3f pos, Vec3s orientation)
Definition math_util.c:449
void render_actor_palm_tree(Camera *camera, UNUSED Mat4 arg1, struct PalmTree *arg2)
Renders the palm tree actor. Actor used in Koopa Troopa Beach.
Definition render.inc.c:14
Definition camera.h:35
Vec3s rot
Definition camera.h:42
size_t cameraId
Definition camera.h:67
f32 fieldOfView
Definition camera.h:43
Vec3f pos
Definition camera.h:36
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