SpaghettiKart
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <camera.h>
2#include <actors.h>
3#include <defines.h>
4#include <main.h>
6
16void render_actor_yoshi_egg(Camera* camera, Mat4 arg1, struct YoshiValleyEgg* egg, u16 arg3) {
17 Mat4 sp60;
18 Vec3s sp5C;
19 Vec3f sp54;
20 f32 temp_f0;
21
23 temp_f0 = is_within_render_distance(camera->pos, egg->pos, camera->rot[1], 200.0f, camera->fieldOfView,
24 16000000.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 return;
32 }
33 } else {
34 arg3 = 15;
35 temp_f0 = 0.0f;
36 }
37
38 if (CVarGetInteger("gDisableLod", 1) == 1) {
39 arg3 = 15;
40 temp_f0 = 0.0f;
41 }
42
43 gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
44 if ((arg3 > 12) && (arg3 < 20)) {
45 if (temp_f0 < 640000.0f) {
46 sp54[0] = egg->pos[0];
47 sp54[1] = 3.0f;
48 sp54[2] = egg->pos[2];
49 func_802976D8(sp5C);
50 func_8029794C(sp54, sp5C, 10.0f);
51 }
52 sp5C[0] = 0;
53 sp5C[1] = egg->eggRot;
54 sp5C[2] = 0;
55
57
58 mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
59 if (render_set_position(sp60, 0) == 0) {
60 return;
61 }
62
63 gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
64 gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
66 } else {
67 arg1[3][0] = egg->pos[0];
68 arg1[3][1] = egg->pos[1];
69 arg1[3][2] = egg->pos[2];
70
72
73 if (render_set_position(arg1, 0) != 0) {
74 gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
75 gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
76 }
78 }
79}
void FrameInterpolation_RecordOpenChild(const void *a, uintptr_t b)
Definition FrameInterpolation.cpp:640
void FrameInterpolation_RecordCloseChild(void)
Definition FrameInterpolation.cpp:650
#define TAG_OBJECT(x)
Definition FrameInterpolation.h:24
void gSPDisplayList(Gfx *pkt, Gfx *dl)
Definition GBIMiddleware.cpp:12
void func_802976D8(Vec3s arg0)
Definition actors.c:402
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:470
f32 Vec3f[3]
Definition common_structs.h:10
s16 Vec3s[3]
Definition common_structs.h:15
f32 Mat4[4][4]
Definition common_structs.h:20
#define CREDITS_SEQUENCE
Definition defines.h:229
#define MAX(a, b)
Definition macros.h:144
Gfx * gDisplayListHead
Definition main.c:129
s32 gGamestate
Definition main.c:164
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
Definition camera.h:35
Vec3s rot
Definition camera.h:42
f32 fieldOfView
Definition camera.h:43
Vec3f pos
Definition camera.h:36
Definition actor_types.h:222
s16 eggRot
Definition actor_types.h:230
Vec3f pos
Definition actor_types.h:233
void render_actor_yoshi_egg(Camera *camera, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3)
Renders the Yoshi egg actor. Actor used in Yoshi Valley.
Definition render.inc.c:16