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) {
19 return;
20 }
21
22 temp_f0 = is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1],
23 16000000.0f);
24
25 if (temp_f0 < 0.0f) {
26 return;
27 }
28
29 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
30 func_8029794C(arg2->pos, arg2->rot, 3.0f);
31 }
32 arg1[3][0] = arg2->pos[0];
33 arg1[3][1] = arg2->pos[1];
34 arg1[3][2] = arg2->pos[2];
35
36 if (render_set_position(arg1, 0) != 0) {
37 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
39 }
40}
41
49void render_actor_tree_yoshi_valley(Camera* camera, Mat4 arg1, struct Actor* arg2) {
50 f32 temp_f0;
51 s16 temp_v0 = arg2->flags;
52
53 if ((temp_v0 & 0x800) != 0) {
54 return;
55 }
56
57 temp_f0 =
58 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
59
60 if (temp_f0 < 0.0f) {
61 return;
62 }
63
64 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
65 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
66 }
67 arg1[3][0] = arg2->pos[0];
68 arg1[3][1] = arg2->pos[1];
69 arg1[3][2] = arg2->pos[2];
70
71 if (render_set_position(arg1, 0) != 0) {
72 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
74 }
75}
76
84void render_actor_tree_royal_raceway(Camera* camera, Mat4 arg1, struct Actor* arg2) {
85 f32 temp_f0;
86 s16 temp_v0 = arg2->flags;
87
88 if ((temp_v0 & 0x800) != 0) {
89 return;
90 }
91
92 temp_f0 =
93 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
94
95 if (temp_f0 < 0.0f) {
96 return;
97 }
98
99 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
100 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
101 }
102 arg1[3][0] = arg2->pos[0];
103 arg1[3][1] = arg2->pos[1];
104 arg1[3][2] = arg2->pos[2];
105
106 if (render_set_position(arg1, 0) != 0) {
107 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
109 }
110}
111
119void render_actor_tree_moo_moo_farm(Camera* camera, Mat4 arg1, struct Actor* arg2) {
120 f32 temp_f0;
121 s16 temp_v0 = arg2->flags;
122
123 if ((temp_v0 & 0x800) != 0) {
124 return;
125 }
126
127 temp_f0 =
128 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 6250000.0f);
129
130 if (temp_f0 < 0.0f) {
131 return;
132 }
133
134 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 600.0f)) {
135 func_8029794C(arg2->pos, arg2->rot, 5.0f);
136 }
137 arg1[3][0] = arg2->pos[0];
138 arg1[3][1] = arg2->pos[1];
139 arg1[3][2] = arg2->pos[2];
140
141 if (render_set_position(arg1, 0) != 0) {
142 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
144 }
145}
146
147// have all the properties of the tree
148void func_80299864(Camera* camera, Mat4 arg1, struct Actor* arg2) {
149 f32 temp_f0;
150 s16 temp_v0 = arg2->flags;
151
152 if ((temp_v0 & 0x800) != 0) {
153 return;
154 }
155
156 temp_f0 =
157 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
158
159 if (temp_f0 < 0.0f) {
160 return;
161 }
162
163 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
164 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
165 }
166 arg1[3][0] = arg2->pos[0];
167 arg1[3][1] = arg2->pos[1];
168 arg1[3][2] = arg2->pos[2];
169
170 if (render_set_position(arg1, 0) != 0) {
171 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
172 // Why is a TLUT being used a DL here? That makes no sense
173 // Based on the TLUT being loaded above, this ought to be be another
174 // tree related DL, presumably one found in a course other than Moo Moo farm
175 // 0x0600FC70
177 }
178}
179
187void render_actor_tree_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* arg2) {
188 f32 temp_f0;
189 s16 temp_v0 = arg2->flags;
190
191 if ((temp_v0 & 0x800) != 0) {
192 return;
193 }
194
195 temp_f0 =
196 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
197
198 if (temp_f0 < 0.0f) {
199 return;
200 }
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_bush_bowser_castle(Camera* camera, Mat4 arg1, struct Actor* arg2) {
223 f32 temp_f0;
224 s16 temp_v0 = arg2->flags;
225
226 if ((temp_v0 & 0x800) != 0) {
227 return;
228 }
229
230 temp_f0 =
231 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 640000.0f);
232
233 if (temp_f0 < 0.0f) {
234 return;
235 }
236
237 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
238 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
239 }
240 arg1[3][0] = arg2->pos[0];
241 arg1[3][1] = arg2->pos[1];
242 arg1[3][2] = arg2->pos[2];
243
244 if (render_set_position(arg1, 0) != 0) {
245 gDPLoadTLUT_pal256(gDisplayListHead++, common_tlut_trees_import);
247 }
248}
249
257void render_actor_tree_frappe_snowland(Camera* camera, Mat4 arg1, struct Actor* arg2) {
258 f32 temp_f0;
259 s16 temp_v0 = arg2->flags;
260
261 if ((temp_v0 & 0x800) != 0) {
262 return;
263 }
264
265 temp_f0 =
266 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
267
268 if (temp_f0 < 0.0f) {
269 return;
270 }
271
272 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 250000.0f)) {
273 func_8029794C(arg2->pos, arg2->rot, 2.79999995f);
274 }
275 arg1[3][0] = arg2->pos[0];
276 arg1[3][1] = arg2->pos[1];
277 arg1[3][2] = arg2->pos[2];
278
279 if (render_set_position(arg1, 0) != 0) {
281 }
282}
283
292 f32 temp_f0;
293 s16 temp_v0 = arg2->flags;
294
295 if ((temp_v0 & 0x800) != 0) {
296 return;
297 }
298
299 temp_f0 =
300 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
301
302 if (temp_f0 < 0.0f) {
303 return;
304 }
305
306 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
307 func_8029794C(arg2->pos, arg2->rot, 1.0f);
308 }
309 arg1[3][0] = arg2->pos[0];
310 arg1[3][1] = arg2->pos[1];
311 arg1[3][2] = arg2->pos[2];
312
313 if (render_set_position(arg1, 0) != 0) {
315 }
316}
317
326 f32 temp_f0;
327 s16 temp_v0 = arg2->flags;
328
329 if ((temp_v0 & 0x800) != 0) {
330 return;
331 }
332
333 temp_f0 =
334 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
335
336 if (temp_f0 < 0.0f) {
337 return;
338 }
339
340 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
341 func_8029794C(arg2->pos, arg2->rot, 1.0f);
342 }
343 arg1[3][0] = arg2->pos[0];
344 arg1[3][1] = arg2->pos[1];
345 arg1[3][2] = arg2->pos[2];
346
347 if (render_set_position(arg1, 0) != 0) {
349 }
350}
351
360 f32 temp_f0;
361 s16 temp_v0 = arg2->flags;
362
363 if ((temp_v0 & 0x800) != 0) {
364 return;
365 }
366
367 temp_f0 =
368 is_within_render_distance(camera->pos, arg2->pos, camera->rot[1], 0, gCameraZoom[camera - camera1], 4000000.0f);
369
370 if (temp_f0 < 0.0f) {
371 return;
372 }
373
374 if (((temp_v0 & 0x400) == 0) && (temp_f0 < 40000.0f)) {
375 func_8029794C(arg2->pos, arg2->rot, 0.80000001f);
376 }
377 arg1[3][0] = arg2->pos[0];
378 arg1[3][1] = arg2->pos[1];
379 arg1[3][2] = arg2->pos[2];
380
381 if (render_set_position(arg1, 0) != 0) {
383 }
384}
void func_8029794C(Vec3f pos, Vec3s rot, f32 scale)
Definition actors.c:423
Gfx d_course_bowsers_castle_dl_bush[]
Definition course_data.c:3194
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:2140
Gfx d_course_kalimari_desert_dl_cactus3[]
Definition course_data.c:3265
Gfx d_course_kalimari_desert_dl_cactus1[]
Definition course_data.c:3223
Gfx d_course_kalimari_desert_dl_cactus2[]
Definition course_data.c:3244
Gfx * gDisplayListHead
Definition main.c:132
f32 gCameraZoom[4]
Definition main.c:122
Gfx d_course_mario_raceway_dl_tree[]
Definition course_data.c:3281
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance)
Definition math_util.c:1114
s32 render_set_position(Mat4 arg0, s32 arg1)
Definition math_util.c:47
u8 d_course_moo_moo_farm_mole_tlut[]
Definition course_data.c:8598
Gfx d_course_moo_moo_farm_dl_tree[]
Definition course_data.c:8800
Gfx d_course_royal_raceway_dl_tree[]
Definition course_data.c:5240
Gfx d_course_royal_raceway_dl_castle_tree[]
Definition course_data.c:5266
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:148
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:325
void render_actor_tree_yoshi_valley(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Yoshi Valley.
Definition render.inc.c:49
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:291
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:359
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:187
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:119
void render_actor_tree_frappe_snowland(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Frappe Snowland.
Definition render.inc.c:257
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:222
void render_actor_tree_royal_raceway(Camera *camera, Mat4 arg1, struct Actor *arg2)
Renders the tree actor in Royal Raceway.
Definition render.inc.c:84
signed short int s16
Definition ultratypes.h:13
float f32
Definition ultratypes.h:34
Gfx d_course_yoshi_valley_dl_tree[]
Definition course_data.c:8426