102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference | GitLab repository
Loading...
Searching...
No Matches
rendering.c
Go to the documentation of this file.
1/* Recovered game implementation; original addresses identify provenance. */
15#include "pcdogs/camera/types.h"
17#include "pcdogs/game/globals.h"
24#include "pcdogs/math/globals.h"
25#include "pcdogs/math/types.h"
29#include "pcdogs/scene/types.h"
31#include "pcdogs/trail/types.h"
32#include "pcdogs/types/common.h"
33#include <math.h>
34#include <stdarg.h>
35#include <string.h>
36
37// Original pcdogs.exe: 0x4011e0
38// Traverses children before siblings, updating visibility, transforms, animation, sound, and render submissions by node type. Actor trail sampling and far-distance callbacks follow the traversal flags.
39void Scene_TraverseNodeTree(struct Scene_Node *node, struct Actor_State *actor, uint32_t traversal_flags)
40{
41 uint32_t behavior_flags = traversal_flags & ~((SCENE_NODE_CULL_SENSITIVE_UPDATE | SCENE_NODE_LOCAL_UPDATE) | SCENE_NODE_RENDER_REQUESTED);
42
43 traversal_flags = behavior_flags;
44
45 struct Scene_Node *child_node = node->first_child;
46 struct Scene_Type1RenderOwnerView *render_owner = (struct Scene_Type1RenderOwnerView *)(actor);
47
48 if (!child_node)
49 return;
50
51 int32_t child_flags_or_world_component = 0;
52 int32_t initial_visibility_mode = behavior_flags & (SCENE_NODE_DISABLED | SCENE_NODE_FORCE_REINITIALIZE);
53 int32_t saved_visibility_mode = initial_visibility_mode;
54
55 while (true)
56 {
57 int32_t child_node_type = (uint8_t)(child_node->node_type);
58 uint32_t traversal_flags_2 = behavior_flags;
59
60 if (initial_visibility_mode == SCENE_NODE_DISABLED)
61 {
62 child_node->traversal_flags |= (uint8_t)initial_visibility_mode;
63
64 if (child_node_type != SCENE_NODE_STATIC)
65 {
68 &child_node->world_pos, 1);
69
70 if (traversal_flags_2 && child_node->first_child)
71 Scene_TraverseNodeTree(child_node, (struct Actor_State *)(render_owner), traversal_flags_2);
72
73 if ((void *)render_owner != (void *)actor)
74 {
75 if (render_owner->behavior_flags & SCENE_OWNER_TRAILS_ACTIVE)
76 Trail_UpdateAndRenderActorTrails((struct Actor_State *)(render_owner));
77
78 int32_t z_1 = render_owner->render_offset.z;
79 int32_t y = render_owner->render_offset.y;
80
81 child_flags_or_world_component = render_owner->transform.world_position.y;
82 render_owner->world_render_position.x = render_owner->render_offset.x + render_owner->transform.world_position.x;
83
84 int32_t render_world_z = z_1 + render_owner->transform.world_position.z;
85 struct Mesh_CmdList *command_list_1 = render_owner->command_list;
86
87 render_owner->world_render_position.y = y + child_flags_or_world_component;
88 render_owner->world_render_position.z = render_world_z;
89 Graphics_UpdateMeshCommandState(command_list_1);
90 render_owner = (struct Scene_Type1RenderOwnerView *)(actor);
91 }
92 }
93
94 child_node = child_node->next_sibling; // node = node->next (offset +4) -- walk sibling list
95
96 if (!child_node)
97 break;
98
99 initial_visibility_mode = saved_visibility_mode;
100 behavior_flags = traversal_flags;
101
102 continue;
103 }
104
105 child_flags_or_world_component = child_node->traversal_flags & SCENE_NODE_DISABLED;
106
107 if (child_node_type == SCENE_NODE_ACTOR)
108 {
109 render_owner = (struct Scene_Type1RenderOwnerView *)(child_node);
110
112 {
113 uint32_t callback_traversal_flags = behavior_flags;
114
115 callback_traversal_flags &= ~(uint32_t)SCENE_NODE_RESET_REQUESTED;
116 traversal_flags_2 = callback_traversal_flags;
117 // dword_6344A0[*(node+197)] -- model-type function ptr dispatch
118 (&g_actorPhaseCallback0)[(int32_t)child_node->type_1_dispatch_index]((struct Actor_State *)(child_node));
119
120 uint8_t traversal_flags_1 = child_node->traversal_flags;
121 uint8_t post_callback_child_flags = traversal_flags_1;
122
123 if ((post_callback_child_flags & child_node_type) != child_flags_or_world_component)
124 {
126 {
127 uint32_t traversal_flags_3 = traversal_flags_2;
128
129 traversal_flags_3 |= SCENE_NODE_FORCE_REINITIALIZE;
130 traversal_flags_2 = traversal_flags_3;
131 }
132 else if (!child_flags_or_world_component)
133 {
134 child_flags_or_world_component = 1;
135 traversal_flags_2 |= SCENE_NODE_DISABLED;
136 }
137 else
138 {
139 uint32_t traversal_flags_4 = traversal_flags_2;
140
141 traversal_flags_4 |= SCENE_NODE_RESET_REQUESTED;
142 traversal_flags_2 = traversal_flags_4;
143 }
144 }
145
146 // NODE TYPE SWITCH - Component types at unknown_30[0x36]: 1=Actor/Model (full anim),
147 // 2=Static/Prop, 4=Sound, 5=AnimatedComponent (fixed frame), 6=MeshComponent (parent sync),
148 // 7=SpriteComponent
149 else if (!child_flags_or_world_component)
150 {
151 if (!(traversal_flags_1 & SCENE_NODE_FORCE_REINITIALIZE))
152 child_node->traversal_flags = traversal_flags_1 & (uint8_t)~SCENE_NODE_VISIBILITY_HIDDEN;
153 }
154 else
155 {
156 child_node = child_node->next_sibling; // node = node->next (offset +4) -- walk sibling list
157
158 if (!child_node)
159 break;
160
161 initial_visibility_mode = saved_visibility_mode;
162 behavior_flags = traversal_flags;
163
164 continue;
165 }
166 }
167 }
168
169 if ((uint8_t)traversal_flags_2 & (SCENE_NODE_RESET_REQUESTED | SCENE_NODE_FORCE_REINITIALIZE))
170 {
171 Scene_InitNodeState(child_node);
172
174 {
175 child_flags_or_world_component = 1;
177 }
178 else
179 {
180 child_flags_or_world_component = child_node->traversal_flags & SCENE_NODE_DISABLED;
181 }
182
183 if (child_node_type == SCENE_NODE_EVENT)
184 {
185 if (child_flags_or_world_component && child_node->type_specific_secondary_render_or_sound_index == SCENE_SOUND_EVENT_INDEX)
187 &child_node->world_pos, 1);
188 }
189 else if (child_node_type == SCENE_NODE_ACTOR)
190 {
191 uint32_t traversal_flags_5 = traversal_flags_2 & SCENE_NODE_FORCE_REINITIALIZE;
192
193 if (!traversal_flags_5 && render_owner->behavior_flags_high_byte & (SCENE_OWNER_INITIAL_DISABLED >> 8))
194 {
195 child_flags_or_world_component = 0;
196 child_node->traversal_flags &= (uint8_t)~SCENE_NODE_DISABLED;
197 behavior_flags = render_owner->behavior_flags;
199 render_owner->behavior_flags = behavior_flags;
200 }
201
202 if (!child_flags_or_world_component)
203 {
204 traversal_flags_5 |= SCENE_NODE_RESET_REQUESTED;
205 traversal_flags_2 = traversal_flags_5;
206
207 struct Mesh_CmdList *command_list = render_owner->command_list;
208
210 Graphics_MarkMeshDirty(command_list);
211 }
212 else
213 {
214 traversal_flags_5 |= SCENE_NODE_DISABLED;
215 traversal_flags_2 = traversal_flags_5;
216 }
217 }
218 }
219
220 if (!child_flags_or_world_component)
221 {
222 int32_t visibility_index_or_flags = node->traversal_flags & (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_FORCE_REINITIALIZE);
223 uint32_t inherited_visibility_flags = visibility_index_or_flags;
224
225 if (!((uint8_t)visibility_index_or_flags & SCENE_NODE_FORCE_REINITIALIZE))
226 {
227 visibility_index_or_flags =
229
230 if (visibility_index_or_flags >= 0)
231 {
232 struct Animation_SplineChannelVis *channel = &render_owner->animation_source.direct_block->visibility_channels[visibility_index_or_flags];
233 int32_t animation_tick = render_owner->animation_tick;
234 int32_t sample_time =
236
237 if (animation_tick < sample_time)
238 sample_time = animation_tick;
240 sample_time = (int64_t)animation_tick % sample_time;
241
242 visibility_index_or_flags =
243 Animation_CheckKeyframeActive(sample_time, channel);
244
245 if ((uint8_t)visibility_index_or_flags)
246 inherited_visibility_flags = (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_FORCE_REINITIALIZE);
247 }
248 }
249
250 visibility_index_or_flags = child_node->traversal_flags;
251 child_flags_or_world_component = (uint32_t)(uint8_t)visibility_index_or_flags;
252
253 uint32_t effective_traversal_flags = traversal_flags_2 | (child_flags_or_world_component & ((SCENE_NODE_CULL_SENSITIVE_UPDATE | SCENE_NODE_LOCAL_UPDATE) | SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_TRANSFORM_DIRTY));
254
255 if (((uint8_t)child_flags_or_world_component & (SCENE_NODE_RENDER_REQUESTED | SCENE_NODE_FORCE_REINITIALIZE)) == SCENE_NODE_RENDER_REQUESTED)
256 effective_traversal_flags |= SCENE_NODE_RENDER_REQUESTED;
257
258 if (((child_flags_or_world_component | effective_traversal_flags) ^ inherited_visibility_flags) & (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_RESET_REQUESTED | SCENE_NODE_FORCE_REINITIALIZE))
259 {
260 // SMB1 ball-size second-pass 2026-05-17: local port implements
261 // animate_ball_size_change radius/modelScale semantics from SMB1 ball.c and same-mode
262 // pulse timer extension. Note boundary: decomp grow/shrink pulse start helpers also
263 // add upward vel/offset impulse; local smb1_ball_begin_size_pulse models
264 // flag/timer/size pulse only until that behavior is explicitly needed.
265 uint8_t type_specific_secondary_render_or_sound_index =
266 (uint8_t)visibility_index_or_flags & (uint8_t)~(SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_FORCE_REINITIALIZE);
267
268 child_node->traversal_flags = type_specific_secondary_render_or_sound_index;
269
270 if (inherited_visibility_flags)
271 {
272 child_node->traversal_flags =
273 type_specific_secondary_render_or_sound_index | (uint8_t)inherited_visibility_flags;
274
275 if ((uint8_t)effective_traversal_flags & SCENE_NODE_FORCE_REINITIALIZE)
276 {
277 uint32_t effective_traversal_flags_1 = effective_traversal_flags;
278
279 effective_traversal_flags_1 &= ~(uint32_t)SCENE_NODE_RENDER_REQUESTED;
280 effective_traversal_flags = effective_traversal_flags_1;
281 }
282
283 if (child_node_type == SCENE_NODE_EVENT)
284 {
285 type_specific_secondary_render_or_sound_index =
287
288 if (type_specific_secondary_render_or_sound_index <= SCENE_SOUND_EVENT_INDEX)
289 {
290 if ((uint8_t)inherited_visibility_flags & SCENE_NODE_FORCE_REINITIALIZE)
291 {
292 if (type_specific_secondary_render_or_sound_index == SCENE_SOUND_EVENT_INDEX)
294 (int32_t)child_node->runtime_sound_slot,
295 &child_node->world_pos, 1);
296 }
297 else if ((uint8_t)effective_traversal_flags & (SCENE_NODE_RESET_REQUESTED | SCENE_NODE_FORCE_REINITIALIZE) || (uint8_t)child_flags_or_world_component & SCENE_NODE_FORCE_REINITIALIZE)
298 Actor_ResetChainState((struct Actor_State *)(child_node), ((int32_t)0xffffffff));
299 }
300 }
301 }
302 else if ((uint8_t)effective_traversal_flags & (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_RESET_REQUESTED | SCENE_NODE_FORCE_REINITIALIZE))
303 {
304 Scene_UpdateNodeAnimation(render_owner, node, child_node);
305
306 if (child_node_type == SCENE_NODE_ACTOR)
307 {
308 int32_t x = render_owner->render_offset.x;
309
310 child_flags_or_world_component = render_owner->transform.world_position.x;
311
312 int32_t z = render_owner->render_offset.z;
313
314 render_owner->world_render_position.y =
315 render_owner->render_offset.y + render_owner->transform.world_position.y;
316 behavior_flags = z + render_owner->transform.world_position.z;
317 render_owner->world_render_position.x = x + child_flags_or_world_component;
318 render_owner->world_render_position.z = behavior_flags;
319 }
320 else if (child_node_type == SCENE_NODE_EVENT && ((uint8_t)child_flags_or_world_component & SCENE_NODE_FORCE_REINITIALIZE || !((uint8_t)effective_traversal_flags & SCENE_NODE_VISIBILITY_HIDDEN)) && child_node->type_specific_secondary_render_or_sound_index <= SCENE_SOUND_EVENT_INDEX)
321 Actor_ResetChainState((struct Actor_State *)(child_node), ((int32_t)0xffffffff));
322 }
323
324 uint32_t effective_traversal_flags_2 = effective_traversal_flags;
325
326 effective_traversal_flags_2 |= SCENE_NODE_TRANSFORM_DIRTY;
327 effective_traversal_flags = effective_traversal_flags_2;
328 }
329
330 uint32_t traversal_flags_6 = effective_traversal_flags & ~SCENE_NODE_VISIBILITY_HIDDEN;
331
332 traversal_flags_2 = traversal_flags_6;
333
334 if (!traversal_flags_6)
335 {
336 if ((void *)render_owner != (void *)actor)
337 {
338 if (render_owner->behavior_flags & SCENE_OWNER_TRAILS_ACTIVE)
339 Trail_UpdateAndRenderActorTrails((struct Actor_State *)(render_owner));
340
341 int32_t z_1 = render_owner->render_offset.z;
342 int32_t y = render_owner->render_offset.y;
343
344 child_flags_or_world_component = render_owner->transform.world_position.y;
345 render_owner->world_render_position.x = render_owner->render_offset.x + render_owner->transform.world_position.x;
346
347 int32_t render_world_z = z_1 + render_owner->transform.world_position.z;
348 struct Mesh_CmdList *command_list_1 = render_owner->command_list;
349
350 render_owner->world_render_position.y = y + child_flags_or_world_component;
351 render_owner->world_render_position.z = render_world_z;
352 Graphics_UpdateMeshCommandState(command_list_1);
353 render_owner = (struct Scene_Type1RenderOwnerView *)(actor);
354 }
355
356 child_node = child_node->next_sibling; // node = node->next (offset +4) -- walk sibling list
357
358 if (!child_node)
359 break;
360
361 initial_visibility_mode = saved_visibility_mode;
362 behavior_flags = traversal_flags;
363
364 continue;
365 }
366 }
367
368 if (child_node_type == SCENE_NODE_STATIC)
369 {
370 child_node = child_node->next_sibling; // node = node->next (offset +4) -- walk sibling list
371
372 if (!child_node)
373 break;
374
375 initial_visibility_mode = saved_visibility_mode;
376 behavior_flags = traversal_flags;
377
378 continue;
379 }
380
381 switch (child_node_type)
382 {
383 case SCENE_NODE_ACTOR:
384 {
385 child_flags_or_world_component = (child_flags_or_world_component & UINT32_C(0xffffff00)) | child_node->traversal_flags;
386 child_flags_or_world_component &= ~(uint32_t)SCENE_NODE_TRANSFORM_DIRTY;
387 child_node->traversal_flags = (uint8_t)child_flags_or_world_component;
388
389 uint32_t culled_owner_flags = render_owner->behavior_flags | SCENE_OWNER_CULLED;
390
391 render_owner->behavior_flags = culled_owner_flags;
392
393 if ((uint8_t)traversal_flags_2 & SCENE_NODE_RENDER_REQUESTED)
394 {
396 &render_owner->world_render_position,
397 (int32_t)render_owner->cull_radius, culled_owner_flags & SCENE_OWNER_CULL_COORDINATES_Q6) ||
399 {
400 uint32_t traversal_flags_7 = traversal_flags_2;
401
402 if (!((uint8_t)traversal_flags_2 & SCENE_NODE_TRANSFORM_DIRTY))
403 traversal_flags_7 &= ~(uint32_t)(SCENE_NODE_RENDER_REQUESTED | SCENE_NODE_CULL_SENSITIVE_UPDATE);
404 else
405 traversal_flags_7 &= ~(uint32_t)(SCENE_NODE_RENDER_REQUESTED | SCENE_NODE_TRANSFORM_DIRTY);
406
407 traversal_flags_2 = traversal_flags_7;
408
409 uint8_t lifecycle_or_traversal_flags =
411
412 if (!(lifecycle_or_traversal_flags & SCENE_NODE_VISIBILITY_HIDDEN))
413 traversal_flags_2 |= SCENE_NODE_TRANSFORM_DIRTY;
414
416 lifecycle_or_traversal_flags | (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_TRANSFORM_DIRTY);
417 }
418 else
419 {
420 render_owner->behavior_flags &= ~SCENE_OWNER_CULLED;
421
422 bool use_scene_geometry_wrapper = Game_FrameTransitionFlags & GAME_TRANSITION_BEYOND_NEAR_PLANE;
423
424 // TYPE 6 MESH RENDERING: MeshComponent nodes render via
425 // RenderMeshWithTransform using parent's transform table at +0x66
428
429 if (!use_scene_geometry_wrapper)
432
434 {
436 render_owner->controller_slots, render_owner);
437
438 char render_entry_index = render_owner->render_entry_index;
439
440 if (render_entry_index >= 0)
441 // TYPE 7 SPRITE RENDERING: SpriteComponent nodes render via
442 // RenderMeshNodeWrapper with embedded transform at +0x3E
443 Scene_RenderSubMesh((struct Actor_State *)(render_owner), child_node,
444 &render_owner->render_entries[(int32_t)
446 }
447 }
448 }
449 else if (actor && actor->behavior_flags & SCENE_OWNER_CULLED)
450 {
451 uint32_t traversal_flags_7 = traversal_flags_2;
452
453 if (!((uint8_t)traversal_flags_2 & SCENE_NODE_TRANSFORM_DIRTY))
454 traversal_flags_7 &= ~(uint32_t)(SCENE_NODE_RENDER_REQUESTED | SCENE_NODE_CULL_SENSITIVE_UPDATE);
455 else
456 traversal_flags_7 &= ~(uint32_t)(SCENE_NODE_RENDER_REQUESTED | SCENE_NODE_TRANSFORM_DIRTY);
457
458 traversal_flags_2 = traversal_flags_7;
459
460 uint8_t lifecycle_or_traversal_flags =
462
463 if (!(lifecycle_or_traversal_flags & SCENE_NODE_VISIBILITY_HIDDEN))
464 traversal_flags_2 |= SCENE_NODE_TRANSFORM_DIRTY;
465
467 lifecycle_or_traversal_flags | (SCENE_NODE_VISIBILITY_HIDDEN | SCENE_NODE_TRANSFORM_DIRTY);
468 }
469
470 break;
471 }
472
474 case SCENE_NODE_EVENT:
476 {
477 break;
478 }
479
481 {
482 if (!((uint8_t)traversal_flags_2 & SCENE_NODE_RENDER_REQUESTED) || render_owner->behavior_flags & SCENE_NODE_DISABLED)
483 break;
484
485 int32_t render_entry_index_for_type_6 =
486 (int32_t)child_node->render_entry_index_for_type_6;
487
488 if (render_entry_index_for_type_6 >= 0)
489 Scene_RenderSubMesh((struct Actor_State *)(render_owner), child_node,
490 &render_owner->render_entries[render_entry_index_for_type_6]);
491
492 break;
493 }
494
496 {
497 if ((uint8_t)traversal_flags_2 & SCENE_NODE_RENDER_REQUESTED && !(render_owner->behavior_flags & SCENE_NODE_DISABLED))
498 {
499 Scene_SubmitSpriteNode((struct Scene_BillboardNodeView *)(child_node));
500 }
501
502 break;
503 }
504 }
505
507 Scene_UpdateNodeAnimation(render_owner, node, child_node);
508
509 if (traversal_flags_2 && child_node->first_child)
510 Scene_TraverseNodeTree(child_node, (struct Actor_State *)(render_owner), traversal_flags_2);
511
512 if ((void *)render_owner != (void *)actor)
513 {
514 if (render_owner->behavior_flags & SCENE_OWNER_TRAILS_ACTIVE)
515 Trail_UpdateAndRenderActorTrails((struct Actor_State *)(render_owner));
516
517 int32_t z_1 = render_owner->render_offset.z;
518 int32_t y = render_owner->render_offset.y;
519
520 child_flags_or_world_component = render_owner->transform.world_position.y;
521 render_owner->world_render_position.x = render_owner->render_offset.x + render_owner->transform.world_position.x;
522
523 int32_t render_world_z = z_1 + render_owner->transform.world_position.z;
524 struct Mesh_CmdList *command_list_1 = render_owner->command_list;
525
526 render_owner->world_render_position.y = y + child_flags_or_world_component;
527 render_owner->world_render_position.z = render_world_z;
528 Graphics_UpdateMeshCommandState(command_list_1);
529 render_owner = (struct Scene_Type1RenderOwnerView *)(actor);
530 }
531
532 child_node = child_node->next_sibling; // node = node->next (offset +4) -- walk sibling list
533
534 if (!child_node)
535 break;
536
537 initial_visibility_mode = saved_visibility_mode;
538 behavior_flags = traversal_flags;
539 }
540}
541
542// Original pcdogs.exe: 0x401790
543// Sets the node's world transform as the active render transform and submits its sprite payload. The exact billboard subtype is not established.
549
551{
552 /* Copy before transposing, including the in-place camera-matrix case. */
553 struct Math_Matrix3x3I16 rotation = world->rotationQ12;
554 int16_t *inverse = g_renderNodeInvRotMatrix;
555 const int16_t *matrix = (const int16_t *)&rotation;
556
557 for (int r = 0; r < 3; ++r)
558 for (int c = 0; c < 3; ++c)
559 inverse[r * 3 + c] = matrix[c * 3 + r];
560
562 int32_t delta[3] = {list->eye_pos.x - world->translationQ6.x,
563 list->eye_pos.z - world->translationQ6.y,
564 list->eye_pos.y - world->translationQ6.z};
565 int16_t view_direction[3];
566
567 for (int r = 0; r < 3; ++r)
568 {
569 int64_t sum = (int64_t)inverse[r * 3] * delta[0] + (int64_t)inverse[r * 3 + 1] * delta[1] + (int64_t)inverse[r * 3 + 2] * delta[2];
570
571 /* Native IMUL/ADD/ADC followed by SHRD preserves carries. */
572 view_direction[r] = (int16_t)((int32_t)(sum >> MATH_Q12_SHIFT) >> 8);
573 }
574
575 g_viewDirectionX = view_direction[0];
576 g_viewDirectionY = view_direction[1];
577 g_viewDirectionZ = view_direction[2];
578
579 const int16_t *view_matrix = (const int16_t *)&list->node_view_matrix;
580 const int32_t *translation = (const int32_t *)&g_renderWorldTransformPtr->translationQ6;
581 int32_t transformed[3];
582
583 for (int r = 0; r < 3; ++r)
584 transformed[r] = (int32_t)(((int64_t)view_matrix[r * 3] * translation[0] + (int64_t)view_matrix[r * 3 + 1] * translation[1] + (int64_t)view_matrix[r * 3 + 2] * translation[2]) >> MATH_Q12_SHIFT);
585
586 g_nodeViewTranslationX = list->node_view_translation.x + transformed[0];
587 g_nodeViewTranslationY = list->node_view_translation.y + transformed[1];
588 g_nodeViewTranslationZ = list->node_view_translation.z + transformed[2];
590 &g_renderWorldTransformPtr->rotationQ12, &list->node_view_matrix);
591}
592
593// Original pcdogs.exe: 0x4019b0
594// Updates and renders a trail-backed span or submits its polygon references after composing view transforms. The actor supplies the compatible render-owner layout expected by the callback.
595void Scene_RenderSubMesh(struct Actor_State *actor, struct Scene_Node *node, struct Submesh_RenderSpan *span)
596{
597 struct Math_TransformQ12Q6 *world = (struct Math_TransformQ12Q6 *)&node->world_rot_matrix;
598
600
601 int index = span->render_node_entry_index;
602
603 if (index > 0)
604 {
605 struct Component_TrailObject *trail = &actor->trail_chain_ptr[index - 1];
606 struct Trail_RenderRuntimeView *view = (struct Trail_RenderRuntimeView *)trail;
607 char active = !!((actor->behavior_flags & SCENE_OWNER_TRAILS_ACTIVE) || (view->flags & SCENE_TRAIL_ACTIVE));
608
609 if (!active && !view->expiry_countdown)
610 return;
611
612 if (!Trail_UpdateEffect(trail, actor,
614 return;
615
616 if (trail)
617 {
618 Trail_RenderAnimated(view, actor, span);
619
620 return;
621 }
622
624 }
625
626 if (span->polygon_ref_count <= 0)
627 return;
628
632 span->polygon_ref_count);
633}
634
636{
637 int32_t dx = state->target_pos.x - state->eye_pos.x;
638 int32_t dy = state->target_pos.z - state->eye_pos.z;
639 int32_t dz = state->target_pos.y - state->eye_pos.y;
640 uint64_t xx = (int64_t)dx * dx, yy = (int64_t)dy * dy, zz = (int64_t)dz * dz;
641 /* The horizontal length truncates each square separately. */
642 int32_t horizontal_squared = (int32_t)(xx >> MATH_Q12_SHIFT) + (int32_t)(zz >> MATH_Q12_SHIFT);
643 int16_t roll = MATH_ANGLE_HALF_TURN - state->view_roll;
644 if (horizontal_squared <= 0x400)
645 {
647 (int16_t)-state->look_pitch, (int16_t)-state->look_yaw, roll);
648 }
649 else
650 {
651 int32_t horizontal = Math_SqrtFP12(horizontal_squared);
652 int32_t distance = Math_SqrtFP12((uint32_t)((xx + yy + zz) >> MATH_Q12_SHIFT));
653 int32_t pitch_sine = ((int64_t)dy * MATH_Q12_ONE) / distance;
654 int16_t pitch_cosine = Math_SqrtFP12(MATH_Q12_ONE - (int32_t)(((int64_t)pitch_sine * pitch_sine) >> MATH_Q12_SHIFT));
655 int16_t yaw_sine = -(int32_t)(((int64_t)dx * MATH_Q12_ONE) / horizontal);
656 int16_t yaw_cosine = ((int64_t)dz * MATH_Q12_ONE) / horizontal;
658 (int16_t)pitch_sine, pitch_cosine, yaw_sine, yaw_cosine, roll);
659 }
660
661 /* Frustum directions use the unscaled matrix and Q8 eye coordinates. */
662 struct Math_Matrix3x3I16 *matrix = &state->node_view_matrix;
663 int32_t eye_x = (int16_t)(state->eye_pos.x >> 8);
664 int32_t eye_y = (int16_t)(state->eye_pos.z >> 8);
665 int32_t eye_z = (int16_t)(state->eye_pos.y >> 8);
666 for (unsigned i = 0; i < 5; ++i)
667 {
668 struct Math_Vec3I16 dir = state->frustum_dirs.v[i].dir;
669 struct Graphics_Render_FrustumClipPlane *plane = &state->frustum_planes[i];
670 plane->normal.x = (dir.x * matrix->m00 + dir.y * matrix->m10 + dir.z * matrix->m20) >> MATH_Q12_SHIFT;
671 plane->normal.y = (dir.x * matrix->m01 + dir.y * matrix->m11 + dir.z * matrix->m21) >> MATH_Q12_SHIFT;
672 plane->normal.z = (dir.x * matrix->m02 + dir.y * matrix->m12 + dir.z * matrix->m22) >> MATH_Q12_SHIFT;
673 plane->distance = -(plane->normal.x * eye_x + plane->normal.y * eye_y + plane->normal.z * eye_z);
674 }
675
676 for (unsigned i = 0; i < 3; ++i)
677 {
679 matrix->elements[3 + i] = matrix->elements[3 + i] * Graphics_WindowHeight / GRAPHICS_DEFAULT_HEIGHT;
680 }
681 int32_t translation[3];
682 for (unsigned i = 0; i < 3; ++i)
683 {
684 const int16_t *row = &matrix->elements[i * 3];
685 int64_t dot = (int64_t)row[0] * state->eye_pos.x + (int64_t)row[1] * state->eye_pos.z + (int64_t)row[2] * state->eye_pos.y;
686 translation[i] = -(int32_t)(dot >> MATH_Q12_SHIFT);
687 }
688 state->node_view_translation = (struct Math_Vec3I32){translation[0], translation[1], translation[2]};
689}
690
691// Original pcdogs.exe: 0x401d40
692// Builds the camera and clipping planes, submits this frame's objects, and draws the sorted queues.
694{
696 return;
697
701 uint8_t *pose_flags = (uint8_t *)&state->pose_state_flags;
702 if (!(*pose_flags & SCENE_POSE_INITIALIZED))
703 {
704 *pose_flags |= SCENE_POSE_INITIALIZED;
706 state = render_list_state;
707 }
709
711 {
715 memset(&main_list->sorted_list_head, 0,
716 sizeof(main_list->sorted_list_head) + sizeof(main_list->sorted_list_buckets) + sizeof(main_list->sorted_bucket_tail));
717
718 state = render_list_state;
719 if (state->pre_shadow_callback)
720 state->pre_shadow_callback(state);
723 }
724
727 else
734
736 {
738 state = render_list_state;
739 if (state->post_sorted_callback)
740 state->post_sorted_callback(state);
742 }
743}
744
745// Original pcdogs.exe: 0x402370
746// Composes view transforms and submits static geometry, or only updates its mesh command state when the rendering and overlay flags suppress submission.
748{
750 {
751 Graphics_UpdateMeshCommandState(g_objectNodeRoot->model_relocated_ptr_80);
752 return;
753 }
754
756 struct Scene_StaticRenderNodeView **cursor = g_objectNodeRoot->static_render_nodes;
757 struct Scene_StaticRenderNodeView *node;
758 while ((node = *cursor++) != NULL)
759 {
760 if (node->node_type == SCENE_NODE_BILLBOARD)
761 {
763 continue;
764 }
765
767 {
768 cursor += node->subtree_skip_count;
769 continue;
770 }
771
772 uint32_t flags = node->render_flags;
776 {
777 cursor += node->subtree_skip_count;
778 continue;
779 }
780
782 if (!(flags & SCENE_STATIC_HAS_COMMANDS))
783 continue;
784
788 {
791 }
792
795 else
797 }
798
799 cursor[-1] = NULL;
800 Graphics_UpdateMeshCommandState(g_objectNodeRoot->model_relocated_ptr_80);
801}
802
803// Original pcdogs.exe: 0x423c40
804// Clears the pending sprite flag and installs a temporary world transform from the accumulated position. Submission, optional normal generation, and accumulator reset occur only when frame flag 0x100000 is set. The global render-transform pointer is left pointing at the local transform on return.
806{
808 return;
809
810 uint32_t game_frame_transition_flags = Game_FrameTransitionFlags;
811 int32_t sprite_last_position_x = g_spriteLastPositionX;
812 int32_t sprite_last_position_y = g_spriteLastPositionY;
813 int32_t sprite_last_position_z = g_spriteLastPositionZ;
814
815 game_frame_transition_flags &= ~(uint32_t)GAME_TRANSITION_SPRITE_PENDING;
816 Game_FrameTransitionFlags = game_frame_transition_flags;
817
818 struct Math_TransformQ12Q6 sprite_world_transform;
819
821
822 uint32_t game_frame_transition_flags_2 = Game_FrameTransitionFlags;
823
824 __builtin_memcpy(&sprite_world_transform,
825 "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x10", 0x12);
826 sprite_world_transform.translationQ6.x = sprite_last_position_x;
827 sprite_world_transform.translationQ6.y = sprite_last_position_y;
828 sprite_world_transform.translationQ6.z = sprite_last_position_z;
829
830 if (!(game_frame_transition_flags_2 & GAME_TRANSITION_OBJECT_VISIBLE))
831 return;
832
839
840 struct Graphics_Render_ListState *render_list_state_1 = render_list_state;
841
842 g_renderNodeInvRotMatrix[0] = 0x1000;
843 g_renderNodeInvRotMatrix[4] = 0x1000;
844 g_renderNodeInvRotMatrix[8] = 0x1000;
845
846 int32_t eye_delta_x = render_list_state_1->eye_pos.x - sprite_last_position_x;
847 int32_t eye_delta_y = render_list_state_1->eye_pos.z - sprite_last_position_y;
848 int32_t eye_delta_z = render_list_state_1->eye_pos.y - sprite_last_position_z;
849 uint64_t view_direction_xx_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[0] * eye_delta_x);
850 uint64_t view_direction_xy_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[1] * eye_delta_y);
851 uint64_t view_direction_xz_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[2] * eye_delta_z);
852 uint64_t view_direction_yx_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[3] * eye_delta_x);
853 uint64_t view_direction_yy_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[4] * eye_delta_y);
854 uint64_t view_direction_yz_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[5] * eye_delta_z);
855 uint64_t view_direction_zx_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[6] * eye_delta_x);
856 uint64_t view_direction_zy_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[7] * eye_delta_y);
857 uint64_t view_direction_zz_wide = (uint64_t)((int64_t)(int32_t)g_renderNodeInvRotMatrix[8] * eye_delta_z);
858 struct Math_TransformQ12Q6 *render_world_transform_ptr_2 = g_renderWorldTransformPtr;
859
860 g_viewDirectionX = (int16_t)(((int32_t)((view_direction_xz_wide + view_direction_xx_wide + view_direction_xy_wide) >> 0xc)) >> 8);
861 g_viewDirectionY = (int16_t)(((int32_t)((view_direction_yz_wide + view_direction_yx_wide + view_direction_yy_wide) >> 0xc)) >> 8);
862
863 struct Math_Matrix3x3I16 *view_rotation = &render_list_state->node_view_matrix;
864
866 (int16_t)(((int32_t)((view_direction_zz_wide + view_direction_zx_wide + view_direction_zy_wide) >> 0xc)) >> 8);
867
868 uint64_t view_translation_xx_wide = (uint64_t)((int64_t)(int32_t)view_rotation->m00 * render_world_transform_ptr_2->translationQ6.x);
869 uint64_t view_translation_xy_wide = (uint64_t)((int64_t)(int32_t)view_rotation->m01 * render_world_transform_ptr_2->translationQ6.y);
870 uint64_t view_translation_xz_wide = (uint64_t)((int64_t)(int32_t)view_rotation->m02 * render_world_transform_ptr_2->translationQ6.z);
871 struct Graphics_Render_ListState *render_list_state_2 = render_list_state;
872 struct Math_Vec3I32 *world_translation_for_y = &g_renderWorldTransformPtr->translationQ6;
873
874 g_nodeViewTranslationX = render_list_state_2->node_view_translation.x + ((int32_t)((view_translation_xz_wide + view_translation_xx_wide + view_translation_xy_wide) >> 0xc));
875
876 uint64_t view_translation_yx_wide = (uint64_t)((int64_t)(int32_t)render_list_state_2->node_view_matrix.m10 * world_translation_for_y->x);
877 uint64_t view_translation_yy_wide = (uint64_t)((int64_t)(int32_t)render_list_state_2->node_view_matrix.m11 * world_translation_for_y->y);
878 uint64_t view_translation_yz_wide = (uint64_t)((int64_t)(int32_t)render_list_state_2->node_view_matrix.m12 * world_translation_for_y->z);
879 struct Graphics_Render_ListState *render_list_state_3 = render_list_state;
880 struct Math_Vec3I32 *world_translation_for_z = &g_renderWorldTransformPtr->translationQ6;
881
882 g_nodeViewTranslationY = render_list_state_3->node_view_translation.y + ((int32_t)((view_translation_yz_wide + view_translation_yx_wide + view_translation_yy_wide) >> 0xc));
883
884 uint64_t view_translation_zx_wide = (uint64_t)((int64_t)(int32_t)render_list_state_3->node_view_matrix.m20 * world_translation_for_z->x);
885 uint64_t view_translation_zy_wide = (uint64_t)((int64_t)(int32_t)render_list_state_3->node_view_matrix.m21 * world_translation_for_z->y);
886 uint64_t view_translation_zz_wide = (uint64_t)((int64_t)(int32_t)render_list_state_3->node_view_matrix.m22 * world_translation_for_z->z);
887 struct Graphics_Render_ListState *render_list_state_4 = render_list_state;
888 struct Math_TransformQ12Q6 *render_world_transform_ptr = g_renderWorldTransformPtr;
889
890 g_nodeViewTranslationZ = render_list_state_4->node_view_translation.z + ((int32_t)((view_translation_zz_wide + view_translation_zx_wide + view_translation_zy_wide) >> 0xc));
891 Math_MulMat3x3Q12(&g_cameraTransformMatrix, (const struct Math_Matrix3x3I16 *)(render_world_transform_ptr),
892 &render_list_state_4->node_view_matrix);
893
896 (int32_t)(int16_t)node->variant_transform_tail, (struct Graphics_Render_SpriteVertexData *)(&data_4967c0), (int32_t)(int16_t)node->render_param_1);
897
899
900 int32_t i = 0;
901
902 if ((int16_t)node->render_param_1 <= 0)
903 return;
904
905 int16_t *normal_accumulator_cursor = &g_vertexNormalAccumY;
906 int32_t clear_normal_accumulators = g_graphicsCapabilities & GRAPHICS_CAP_VERTEX_NORMALS;
907 struct Graphics_Render_SpriteVertexData *vertex_state_cursor = data_4967c0;
908
909 do
910 {
911 vertex_state_cursor->vertex_state = 0;
912
913 if (clear_normal_accumulators)
914 {
915 normal_accumulator_cursor[1] = 0;
916 *(uint16_t *)normal_accumulator_cursor = 0;
917 normal_accumulator_cursor[-1] = 0;
918 normal_accumulator_cursor[2] = 0;
919 }
920
921 i += 1;
922 vertex_state_cursor += 1;
923 normal_accumulator_cursor = &normal_accumulator_cursor[4];
924 } while (i < (int32_t)(int16_t)node->render_param_1);
925}
void Actor_ResetChainState(struct Actor_State *actor, int32_t chain_index)
Definition animation.c:748
void Actor_UpdateProjectileList(void)
Definition lifecycle.c:108
void Actor_UpdateList(void)
Definition lifecycle.c:41
#define g_actorPhaseCallback0
Definition globals.h:33
#define ANIMATION_SPLINE_TIME_Q6_MASK
Definition constants.h:37
#define ANIMATION_SPLINE_WRAP_SAMPLE_TIME
Definition enums.h:55
void Mesh_CalculateVertexNormals(struct Graphics_Render_PolygonRenderRef *polygon_refs, int32_t polygon_count, struct Graphics_Render_SpriteVertexData *transformed_vertices, int32_t vertex_count)
Definition normals.c:77
uint8_t Animation_CheckKeyframeActive(uint32_t sample_time, struct Animation_SplineChannelVis *channel)
Definition controller.c:17
void Audio_StopOrUpdateSoundsAtPosition(int32_t sound_index_or_mode, struct Math_Vec3I32 *position, char looping_only)
Definition spatial.c:76
int32_t Camera_RecomputePitchYawFromEyeTarget(struct Camera_Pose *pose)
Definition follow.c:482
#define g_cameraTransformMatrix
Definition globals.h:81
#define g_cameraData
Definition globals.h:63
#define GAME_TRANSITION_FADE_COUNTDOWN
Definition constants.h:25
#define GAME_OVERLAY_SKIP_NODE_ANIMATION
Definition constants.h:34
#define GAME_TRANSITION_COLOR_FADE
Definition constants.h:30
#define GAME_TRANSITION_SPRITE_PENDING
Definition constants.h:22
#define GAME_OVERLAY_SKIP_OBJECT_RENDER
Definition constants.h:36
#define GAME_TRANSITION_UNLOAD_LEVEL
Definition constants.h:19
#define GAME_TRANSITION_BEYOND_NEAR_PLANE
Definition constants.h:32
#define GAME_TRANSITION_OBJECT_VISIBLE
Definition constants.h:29
#define Game_FrameTransitionFlags
Definition globals.h:47
#define Game_FrameOverlayFlags
Definition globals.h:44
#define GRAPHICS_CAP_ENHANCED_RENDER
Definition constants.h:12
#define GRAPHICS_DEFAULT_WIDTH
Definition constants.h:25
#define GRAPHICS_CAP_VERTEX_NORMALS
Definition constants.h:15
#define GRAPHICS_CAP_SUPPRESS_FRAME_FADE
Definition constants.h:13
#define GRAPHICS_DEFAULT_HEIGHT
Definition constants.h:26
void Graphics_RenderMeshNode(struct Scene_Node *node, struct Graphics_Render_MeshBillboardRuntimeView *sprite_ctx)
void Graphics_RenderPolygonBatchAdapter(struct Scene_Node *node, struct Graphics_Render_PolygonRenderRef *polygon_refs, int32_t count)
Definition geometry.c:24
void Shadow_RenderAll(void)
Definition shadows.c:28
void Graphics_ProcessMeshCommands(struct Mesh_CmdList *cmd_list, struct Material_Node **material_nodes, void *owner_context)
Definition meshes.c:70
void Graphics_RenderPolygonBatch(struct Scene_Node *node, struct Graphics_Render_PolygonRenderRef *polygon_refs, int32_t count)
Definition polygons.c:28
void Graphics_EndRendering(void)
Definition frame.c:156
void Graphics_DrawSortedLists(void)
Definition frame.c:104
void Graphics_UpdateMeshCommandState(struct Mesh_CmdList *cmd_list)
Definition meshes.c:109
void Graphics_RenderSpriteObjectNode(struct Scene_BillboardNodeView *node)
Definition sprites.c:28
void Graphics_RenderSpritePolygons(struct Scene_Node *node, struct Graphics_Render_SpriteVertexData *transformed_vertices, struct Graphics_Render_ProjectedVertex *projected_vertices)
Definition sprites.c:211
int32_t Graphics_CheckFrustumCull(struct Math_Vec3I32 *position, int32_t cull_radius, uint32_t cull_flags)
Definition clipping.c:772
void Shadow_ClearList(void)
Definition shadows.c:21
void Graphics_IncrementPassCounter(void)
Definition frame.c:141
void Graphics_MarkMeshDirty(struct Mesh_CmdList *cmd_list)
Definition meshes.c:33
#define g_spriteLastPositionZ
Definition globals.h:263
#define g_projectedSpriteVertices
Definition globals.h:266
#define g_spriteLastPositionX
Definition globals.h:257
#define Graphics_WindowWidth
Definition globals.h:140
#define g_graphicsCapabilities_high_byte
Definition globals.h:335
#define Graphics_RenderPolygonCallback
Definition globals.h:155
#define g_graphicsCapabilities
Definition globals.h:284
#define render_list_state
Definition globals.h:152
#define Graphics_WindowHeight
Definition globals.h:143
#define g_spriteLastPositionY
Definition globals.h:260
#define data_4967c0
Definition globals.h:254
#define MATH_Q12_SHIFT
Definition constants.h:8
#define MATH_Q12_ONE
Definition constants.h:9
#define MATH_ANGLE_HALF_TURN
Definition constants.h:14
int32_t Math_SqrtFP12(uint32_t value)
void Math_BuildRotationMatrixFromXYSinCos(struct Math_Matrix3x3I16 *out_matrix, struct Math_Matrix3x3I16 const *left_factor, int16_t sin_x_q12, int16_t cos_x_q12, int16_t sin_y_q12, int16_t cos_y_q12, int32_t angle_z)
Definition matrices.c:204
void Math_MulMat3x3Q12(struct Math_Matrix3x3I16 *out_matrix, struct Math_Matrix3x3I16 const *right_factor, struct Math_Matrix3x3I16 const *left_factor)
Definition matrices.c:11
void Math_BuildRotationMatrix(struct Math_Matrix3x3I16 *out_matrix, struct Math_Matrix3x3I16 const *left_factor, int32_t angle_x, int32_t angle_y, int32_t angle_z)
Definition matrices.c:154
struct Math_TransformQ12Q6 * global_type_g_renderWorldTransformPtr
Definition globals.h:26
#define g_renderWorldTransformPtr
Definition globals.h:27
void Powerup_UpdateLiveActorList(void)
Definition lifecycle.c:35
#define SCENE_OWNER_INITIAL_DISABLED
Definition constants.h:39
#define SCENE_OWNER_REQUIRES_ENHANCED_RENDER
Definition constants.h:36
#define SCENE_OWNER_CULL_COORDINATES_Q6
Definition constants.h:34
#define SCENE_NODE_RESET_REQUESTED
Definition constants.h:26
#define SCENE_STATIC_HAS_COMMANDS
Definition constants.h:45
#define SCENE_STATIC_CULL_SPECIAL
Definition constants.h:47
#define SCENE_POSE_INITIALIZED
Definition constants.h:48
#define SCENE_NODE_VISIBILITY_HIDDEN
Definition constants.h:25
#define SCENE_NODE_FORCE_REINITIALIZE
Definition constants.h:32
#define SCENE_NODE_LOCAL_UPDATE
Definition constants.h:30
#define SCENE_SOUND_EVENT_INDEX
Definition constants.h:52
#define SCENE_NODE_CULL_SENSITIVE_UPDATE
Definition constants.h:29
#define SCENE_OWNER_DISABLED_LATCH
Definition constants.h:38
#define SCENE_NODE_DISABLED
Definition constants.h:24
#define SCENE_NODE_RENDER_REQUESTED
Definition constants.h:27
#define SCENE_OWNER_TRAILS_ACTIVE
Definition constants.h:35
#define SCENE_OWNER_REINITIALIZE_ON_VISIBILITY_CHANGE
Definition constants.h:37
#define SCENE_OWNER_CULLED
Definition constants.h:33
#define SCENE_TRAIL_ACTIVE
Definition constants.h:49
@ SCENE_NODE_NO_RENDER_KIND_5
Definition constants.h:12
@ SCENE_NODE_SCALED_GEOMETRY
Definition constants.h:9
@ SCENE_NODE_EVENT
Definition constants.h:10
@ SCENE_NODE_ACTOR
Definition constants.h:7
@ SCENE_NODE_STATIC
Definition constants.h:8
@ SCENE_NODE_SUBMESH
Definition constants.h:13
@ SCENE_NODE_BILLBOARD
Definition constants.h:14
#define SCENE_NODE_TRANSFORM_DIRTY
Definition constants.h:31
#define SCENE_STATIC_SHARED_OWNER
Definition constants.h:46
void Scene_UpdateNodeAnimation(struct Scene_Type1RenderOwnerView *owner, struct Scene_Node *parent_node, struct Scene_Node *node)
Definition state.c:133
void Scene_ComposeRenderTransform(const struct Math_TransformQ12Q6 *world)
Definition rendering.c:550
void Scene_InitNodeState(struct Scene_Node *node)
Definition state.c:32
void Scene_FinalizeNodeRender(struct Scene_Node *node)
Definition rendering.c:805
#define g_objectNodeRoot
Definition globals.h:12
void Scene_SubmitSpriteNode(struct Scene_BillboardNodeView *node)
Definition rendering.c:544
void Scene_RenderSubMesh(struct Actor_State *actor, struct Scene_Node *node, struct Submesh_RenderSpan *span)
Definition rendering.c:595
static void Scene_BuildFrameView(struct Graphics_Render_ListState *state)
Definition rendering.c:635
void Scene_TraverseNodeTree(struct Scene_Node *node, struct Actor_State *actor, uint32_t traversal_flags)
Definition rendering.c:39
void Scene_RenderFrame(void)
Definition rendering.c:693
void Scene_RenderStaticGeometry(void)
Definition rendering.c:747
struct Mesh_Polygon * mesh_polygon_array
Definition types.h:396
int32_t behavior_flags
Definition types.h:407
struct Component_TrailObject * trail_chain_ptr
Definition types.h:431
struct Animation_SplineChannelVis * visibility_channels
Definition types.h:766
int32_t packed_time_bias_and_end_time
Definition types.h:396
Animation_SplineChannelFlags channel_flags
Definition types.h:400
struct Math_Vec3I16 dir
Definition types.h:148
struct Camera_FrustumDirEntry v[0x5]
Definition types.h:208
struct Graphics_Render_FrustumClipPlane::@002324077244057217040013003070153264014256137317 normal
struct Graphics_Render_PolygonBatchRecord * sorted_list_head
Definition types.h:692
struct Graphics_Render_PolygonBatchRecord * sorted_list_buckets[0x4000]
Definition types.h:693
struct Math_Vec3I32XZY target_pos
Definition types.h:673
struct Graphics_Render_FrustumClipPlane frustum_planes[0x5]
Definition types.h:676
struct Math_Vec3I32 node_view_translation
Definition types.h:679
Graphics_Render_ListCallback pre_shadow_callback
Definition types.h:686
struct Camera_FrustumDirTable frustum_dirs
Definition types.h:675
struct Math_Matrix3x3I16 node_view_matrix
Definition types.h:677
struct Math_Vec3I32XZY eye_pos
Definition types.h:672
Graphics_Render_ListCallback post_sorted_callback
Definition types.h:685
uint32_t sorted_bucket_tail
Definition types.h:699
int16_t m21
Definition types.h:169
int16_t m00
Definition types.h:162
int16_t m01
Definition types.h:163
int16_t elements[9]
Definition types.h:173
int16_t m12
Definition types.h:167
int16_t m11
Definition types.h:166
int16_t m20
Definition types.h:168
int16_t m22
Definition types.h:170
int16_t m02
Definition types.h:164
int16_t m10
Definition types.h:165
struct Math_Vec3I32 translationQ6
Definition types.h:562
struct Math_Matrix3x3I16 rotationQ12
Definition types.h:560
int16_t z
Definition types.h:460
int16_t x
Definition types.h:458
int16_t y
Definition types.h:459
int32_t x
Definition types.h:482
int32_t z
Definition types.h:483
int32_t y
Definition types.h:484
int32_t y
Definition types.h:471
int32_t x
Definition types.h:470
int32_t z
Definition types.h:472
struct Math_TransformQ12Q6 world_transform
Definition types.h:282
struct Graphics_Render_MeshBillboardRuntimeView payload
Definition types.h:288
struct Scene_Node * next_sibling
Definition types.h:113
char type_specific_secondary_render_or_sound_index
Definition types.h:132
char type_1_dispatch_index
Definition types.h:203
uint8_t traversal_flags
Definition types.h:130
int16_t runtime_sound_slot
Definition types.h:148
uint8_t node_type
Definition types.h:129
uint32_t variant_transform_tail
Definition types.h:183
struct Math_Matrix3x3I16 world_rot_matrix
Definition types.h:118
int32_t render_param_1
Definition types.h:136
uint8_t model_runtime_flags_high_byte
Definition types.h:178
struct Math_Vec3I32 world_pos
Definition types.h:120
char render_entry_index_for_type_6
Definition types.h:131
void * variant_payload_ptr
Definition types.h:140
char visibility_anim_channel_index_or_minus_one
Definition types.h:124
struct Scene_Node * first_child
Definition types.h:114
struct Math_TransformQ12Q6 world_transform
Definition types.h:300
void * vertex_data_or_shared_owner
Definition types.h:308
struct Material_Node ** controller_slots
Definition types.h:310
struct Mesh_CmdList * command_list
Definition types.h:311
struct Graphics_Render_PolygonRenderRef * polygon_refs
Definition types.h:307
uint32_t subtree_skip_count
Definition types.h:298
struct Math_Vec3I32 world_position
Definition types.h:262
uint8_t lifecycle_or_traversal_flags
Definition types.h:269
struct Scene_TransformNodePrefix transform
Definition types.h:324
struct Math_Vec3I32 world_render_position
Definition types.h:349
uint8_t behavior_flags_high_byte
Definition types.h:341
struct Math_Vec3I32 render_offset
Definition types.h:366
union Scene_AnimationSource animation_source
Definition types.h:352
struct Submesh_RenderSpan * render_entries
Definition types.h:348
struct Material_Node ** controller_slots
Definition types.h:329
struct Mesh_CmdList * command_list
Definition types.h:330
char render_node_entry_index
Definition types.h:349
int16_t polygon_ref_start_index
Definition types.h:352
int16_t polygon_ref_count
Definition types.h:353
uint8_t expiry_countdown
Definition types.h:54
char Trail_UpdateEffect(struct Component_TrailObject *trail, struct Actor_State const *actor, struct Graphics_Render_PolygonRenderRef const *polygon_ref, char active)
Definition effects.c:72
void Trail_UpdateAndRenderActorTrails(struct Actor_State *actor)
Definition effects.c:44
void Trail_RenderAnimated(struct Trail_RenderRuntimeView *trail, struct Actor_State *actor, struct Submesh_RenderSpan *span)
Definition effects.c:304
struct Animation_DataBlock * direct_block
Definition types.h:12
#define g_nodeViewTranslationY
Definition values.h:774
#define g_renderingStateFlag
Definition values.h:627
#define g_frameCounter
Definition values.h:501
#define g_currentPolygonBatchIndex
Definition values.h:768
#define g_viewDirectionZ
Definition values.h:765
#define g_nodeViewTranslationZ
Definition values.h:777
#define g_viewDirectionX
Definition values.h:759
#define g_nodeViewTranslationX
Definition values.h:771
#define g_vertexNormalAccumY
Definition values.h:333
#define g_renderNodeInvRotMatrix
Definition values.h:753
#define g_viewDirectionY
Definition values.h:762