Mario Kart 64
Loading...
Searching...
No Matches
render.inc.c
Go to the documentation of this file.
1#include <actors.h>
2#include <PR/gbi.h>
3#include <main.h>
6
14void render_actor_tree_mario_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
15 f32 temp_f0;
16 s16 temp_v0 = arg2->flags;
17
18 if ((temp_v0 & 0x800) != 0) { return; }
19
20 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 16000000.0f);
21
22 if (temp_f0 < 0.0f) { return; }
23
24 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
25 func_8029794C(arg2->pos, arg2->rot, 3.0f);
26 }
27 arg1[3][0] = arg2->pos[0];
28 arg1[3][1] = arg2->pos[1];
29 arg1[3][2] = arg2->pos[2];
30
31 if (render_set_position(arg1, 0) != 0) {
32 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
34 }
35}
36
44void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2) {
45 f32 temp_f0;
46 s16 temp_v0 = arg2->flags;
47
48 if ((temp_v0 & 0x800) != 0) { return; }
49
50 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
51
52 if (temp_f0 < 0.0f) { return; }
53
54 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
55 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
56 }
57 arg1[3][0] = arg2->pos[0];
58 arg1[3][1] = arg2->pos[1];
59 arg1[3][2] = arg2->pos[2];
60
61 if (render_set_position(arg1, 0) != 0) {
62 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
64 }
65}
66
74void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2) {
75 f32 temp_f0;
76 s16 temp_v0 = arg2->flags;
77
78 if ((temp_v0 & 0x800) != 0) { return; }
79
80 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
81
82 if (temp_f0 < 0.0f) { return; }
83
84 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
85 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
86 }
87 arg1[3][0] = arg2->pos[0];
88 arg1[3][1] = arg2->pos[1];
89 arg1[3][2] = arg2->pos[2];
90
91 if (render_set_position(arg1, 0) != 0) {
92 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
94 }
95}
96
104void render_actor_tree_moo_moo_farm(Camera *camera, Mat4 arg1, struct Actor *arg2) {
105 f32 temp_f0;
106 s16 temp_v0 = arg2->flags;
107
108 if ((temp_v0 & 0x800) != 0) { return; }
109
110 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
111
112 if (temp_f0 < 0.0f) { return; }
113
114 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) {
115 func_8029794C(arg2->pos, arg2->rot, 5.0f);
116 }
117 arg1[3][0] = arg2->pos[0];
118 arg1[3][1] = arg2->pos[1];
119 arg1[3][2] = arg2->pos[2];
120
121 if (render_set_position(arg1, 0) != 0) {
122 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
124 }
125}
126
127// have all the properties of the tree
128void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2) {
129 f32 temp_f0;
130 s16 temp_v0 = arg2->flags;
131
132 if ((temp_v0 & 0x800) != 0) { return; }
133
134 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
135
136 if (temp_f0 < 0.0f) { return; }
137
138 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
139 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
140 }
141 arg1[3][0] = arg2->pos[0];
142 arg1[3][1] = arg2->pos[1];
143 arg1[3][2] = arg2->pos[2];
144
145 if (render_set_position(arg1, 0) != 0) {
146 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
147 // Why is a TLUT being used a DL here? That makes no sense
148 // Based on the TLUT being loaded above, this ought to be be another
149 // tree related DL, presumably one found in a course other than Moo Moo farm
150 // 0x0600FC70
152 }
153}
154
162void render_actor_tree_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
163 f32 temp_f0;
164 s16 temp_v0 = arg2->flags;
165
166 if ((temp_v0 & 0x800) != 0) { return; }
167
168 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
169
170 if (temp_f0 < 0.0f) { return; }
171
172 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
173 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
174 }
175 arg1[3][0] = arg2->pos[0];
176 arg1[3][1] = arg2->pos[1];
177 arg1[3][2] = arg2->pos[2];
178
179 if (render_set_position(arg1, 0) != 0) {
180 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
182 }
183}
184
192void render_actor_bush_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2) {
193 f32 temp_f0;
194 s16 temp_v0 = arg2->flags;
195
196 if ((temp_v0 & 0x800) != 0) { return; }
197
198 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
199
200 if (temp_f0 < 0.0f) { return; }
201
202 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
203 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
204 }
205 arg1[3][0] = arg2->pos[0];
206 arg1[3][1] = arg2->pos[1];
207 arg1[3][2] = arg2->pos[2];
208
209 if (render_set_position(arg1, 0) != 0) {
210 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
212 }
213}
214
222void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2) {
223 f32 temp_f0;
224 s16 temp_v0 = arg2->flags;
225
226 if ((temp_v0 & 0x800) != 0) { return; }
227
228 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
229
230 if (temp_f0 < 0.0f) { return; }
231
232 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
233 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
234 }
235 arg1[3][0] = arg2->pos[0];
236 arg1[3][1] = arg2->pos[1];
237 arg1[3][2] = arg2->pos[2];
238
239 if (render_set_position(arg1, 0) != 0) {
241 }
242}
243
252 f32 temp_f0;
253 s16 temp_v0 = arg2->flags;
254
255 if ((temp_v0 & 0x800) != 0) { return; }
256
257 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
258
259 if (temp_f0 < 0.0f) { return; }
260
261 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
262 func_8029794C(arg2->pos, arg2->rot, 1.0f);
263 }
264 arg1[3][0] = arg2->pos[0];
265 arg1[3][1] = arg2->pos[1];
266 arg1[3][2] = arg2->pos[2];
267
268 if (render_set_position(arg1, 0) != 0) {
270 }
271}
272
281 f32 temp_f0;
282 s16 temp_v0 = arg2->flags;
283
284 if ((temp_v0 & 0x800) != 0) { return; }
285
286 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
287
288 if (temp_f0 < 0.0f) { return; }
289
290 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
291 func_8029794C(arg2->pos, arg2->rot, 1.0f);
292 }
293 arg1[3][0] = arg2->pos[0];
294 arg1[3][1] = arg2->pos[1];
295 arg1[3][2] = arg2->pos[2];
296
297 if (render_set_position(arg1, 0) != 0) {
299 }
300}
301
310 f32 temp_f0;
311 s16 temp_v0 = arg2->flags;
312
313 if ((temp_v0 & 0x800) != 0) { return; }
314
315 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
316
317 if (temp_f0 < 0.0f) { return; }
318
319 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
320 func_8029794C(arg2->pos, arg2->rot, 0.80000001f);
321 }
322 arg1[3][0] = arg2->pos[0];
323 arg1[3][1] = arg2->pos[1];
324 arg1[3][2] = arg2->pos[2];
325
326 if (render_set_position(arg1, 0) != 0) {
328 }
329}
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:417
Gfx d_course_bowsers_castle_dl_bush[]
Definition course_data.c:3957
Camera * camera1
Definition camera.c:23
u16 common_tlut_trees_import[]
f32 Mat4[4][4]
Definition common_structs.h:16
Gfx d_course_frappe_snowland_dl_tree[]
Definition course_data.c:2734
Gfx d_course_kalimari_desert_dl_cactus3[]
Definition course_data.c:4619
Gfx d_course_kalimari_desert_dl_cactus1[]
Definition course_data.c:4581
Gfx d_course_kalimari_desert_dl_cactus2[]
Definition course_data.c:4600
Gfx * gDisplayListHead
Definition main.c:133
f32 gCameraZoom[4]
Definition main.c:123
Gfx d_course_mario_raceway_dl_tree[]
Definition course_data.c:3638
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1092
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:49
u8 d_course_moo_moo_farm_mole_tlut[]
Definition course_data.c:8485
Gfx d_course_moo_moo_farm_dl_tree[]
Definition course_data.c:8683
Gfx d_course_royal_raceway_dl_tree[]
Definition course_data.c:7350
Gfx d_course_royal_raceway_dl_castle_tree[]
Definition course_data.c:7375
Definition actor_types.h:120
Vec3s rot
Definition actor_types.h:127
s16 flags
Definition actor_types.h:122
Vec3f pos
Definition actor_types.h:129
Definition camera.h:26
Vec3s rot
Definition camera.h:33
Vec3f pos
Definition camera.h:27
void func_80299864(Camera *camera, Mat4 arg1, struct Actor *arg2)
Definition render.inc.c:128
void render_actor_tree_cactus2_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the a second variant of cactus in Kalimari Desert.
Definition render.inc.c:280
void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Yoshi Valley.
Definition render.inc.c:44
void render_actor_tree_mario_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Mario rawceay.
Definition render.inc.c:14
void render_actor_tree_cactus1_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the a first variant of cactus in Kalimari Desert.
Definition render.inc.c:251
void render_actor_tree_cactus3_kalimari_desert(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the a third variant of cactus in Kalimari Desert.
Definition render.inc.c:309
void render_actor_tree_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Bowser's Castle.
Definition render.inc.c:162
void render_actor_tree_moo_moo_farm(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Moo Moo Farm.
Definition render.inc.c:104
void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Frappe Snowland.
Definition render.inc.c:222
void render_actor_bush_bowser_castle(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the bush actor in Bowser's Castle.
Definition render.inc.c:192
void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Royal Raceway.
Definition render.inc.c:74
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:33
Gfx d_course_yoshi_valley_dl_tree[]
Definition course_data.c:11012