Mario Kart 64
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* arg0, 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(arg0->pos, egg->pos, arg0->rot[1], 200.0f, gCameraZoom[arg0 - camera1],
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_RecordMatrixPop(Mat4 *matrix)
Definition FrameInterpolation.cpp:705
void FrameInterpolation_RecordMatrixPush(Mat4 *matrix)
Definition FrameInterpolation.cpp:689
void gSPDisplayList(Gfx *pkt, Gfx *dl)
Definition GBIMiddleware.cpp:11
void func_802976D8(Vec3s arg0)
Definition actors.c:382
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:450
Camera * camera1
Definition camera.c:29
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:196
#define MAX(a, b)
Definition macros.h:130
Gfx * gDisplayListHead
Definition main.c:144
f32 gCameraZoom[4]
Definition main.c:134
s32 gGamestate
Definition main.c:180
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
Definition camera.h:27
Vec3s rot
Definition camera.h:34
Vec3f pos
Definition camera.h:28
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 *arg0, Mat4 arg1, struct YoshiValleyEgg *egg, u16 arg3)
Renders the Yoshi egg actor. Actor used in Yoshi Valley.
Definition render.inc.c:16