1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#include <camera.h>
#include <racing/actors.h>
#include <defines.h>
#include <main.h>
#include "port/interpolation/FrameInterpolation.h"
/**
* @brief Renders the Yoshi egg actor.
* Actor used in Yoshi Valley.
*
* @param camera
* @param arg1
* @param egg
* @param arg3
*/
void render_actor_yoshi_egg(Camera* camera, Mat4 arg1, struct YoshiValleyEgg* egg, u16 arg3) {
Mat4 sp60;
Vec3s sp5C;
Vec3f sp54;
f32 temp_f0;
size_t actorIdx = CM_FindActorIndex((struct Actor*) egg);
if (-1 == actorIdx) {
printf("[render_actor_yoshi_egg] Could not find actor for FI, skipping\n");
return;
}
if (gGamestate != CREDITS_SEQUENCE) {
temp_f0 = is_within_render_distance(camera->pos, egg->pos, camera->rot[1], 200.0f, camera->fieldOfView,
16000000.0f);
if (CVarGetInteger("gNoCulling", 0) == 1) {
temp_f0 = MAX(temp_f0, 0.0f);
}
if (temp_f0 < 0.0f) {
return;
}
} else {
arg3 = 15;
temp_f0 = 0.0f;
}
if (CVarGetInteger("gDisableLod", 1) == 1) {
arg3 = 15;
temp_f0 = 0.0f;
}
gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH);
if ((arg3 > 12) && (arg3 < 20)) {
if (temp_f0 < 640000.0f) {
sp54[0] = egg->pos[0];
sp54[1] = 3.0f;
sp54[2] = egg->pos[2];
func_802976D8(sp5C);
func_8029794C(sp54, sp5C, 10.0f);
}
sp5C[0] = 0;
sp5C[1] = egg->eggRot;
sp5C[2] = 0;
FrameInterpolation_RecordOpenChild("yoshi_egg", TAG_OBJECT((actorIdx << 4) | camera->cameraId));
mtxf_pos_rotation_xyz(sp60, egg->pos, sp5C);
if (render_set_position(sp60, 0) == 0) {
return;
}
gSPSetGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_16D70);
FrameInterpolation_RecordCloseChild();
} else {
arg1[3][0] = egg->pos[0];
arg1[3][1] = egg->pos[1];
arg1[3][2] = egg->pos[2];
FrameInterpolation_RecordOpenChild("yoshi_egg2", TAG_OBJECT((actorIdx << 4) | camera->cameraId));
if (render_set_position(arg1, 0) != 0) {
gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING);
gSPDisplayList(gDisplayListHead++, d_course_yoshi_valley_dl_egg_lod0);
}
FrameInterpolation_RecordCloseChild();
}
}
|