From df294c0f64ee98933bb9cc31d38308108bd82f91 Mon Sep 17 00:00:00 2001 From: MysterD Date: Fri, 22 Apr 2022 18:57:26 -0700 Subject: [PATCH] Fix up DynOS actor override --- src/engine/graph_node.c | 4 ++++ src/engine/graph_node_manager.c | 4 +++- src/game/mario_misc.c | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/engine/graph_node.c b/src/engine/graph_node.c index 2ca5b051..9de10590 100644 --- a/src/engine/graph_node.c +++ b/src/engine/graph_node.c @@ -321,6 +321,7 @@ struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, graphNode->animInfo.animAccel = 0x10000; graphNode->animInfo.animTimer = 0; graphNode->node.flags |= GRAPH_RENDER_HAS_ANIMATION; + dynos_actor_override((void*)&graphNode->sharedChild); } return graphNode; @@ -438,6 +439,7 @@ struct GraphNodeObjectParent *init_graph_node_object_parent(struct AllocOnlyPool if (graphNode != NULL) { init_scene_graph_node_links(&graphNode->node, GRAPH_NODE_TYPE_OBJECT_PARENT); graphNode->sharedChild = sharedChild; + dynos_actor_override((void*)&graphNode->sharedChild); } return graphNode; @@ -725,6 +727,7 @@ void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f po graphNode->unk4C = 0; graphNode->throwMatrix = NULL; graphNode->animInfo.curAnim = NULL; + dynos_actor_override((void*)&graphNode->sharedChild); graphNode->node.flags |= GRAPH_RENDER_ACTIVE; graphNode->node.flags &= ~GRAPH_RENDER_INVISIBLE; @@ -749,6 +752,7 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo graphNode->unk4C = spawn; graphNode->throwMatrix = NULL; graphNode->animInfo.curAnim = 0; + dynos_actor_override((void*)&graphNode->sharedChild); graphNode->node.flags |= GRAPH_RENDER_ACTIVE; graphNode->node.flags &= ~GRAPH_RENDER_INVISIBLE; diff --git a/src/engine/graph_node_manager.c b/src/engine/graph_node_manager.c index b9b7f579..fbf0ab3e 100644 --- a/src/engine/graph_node_manager.c +++ b/src/engine/graph_node_manager.c @@ -70,7 +70,9 @@ void register_scene_graph_node(struct GraphNode *graphNode) { } } else { if (gCurGraphNodeList[gCurGraphNodeIndex - 1]->type == GRAPH_NODE_TYPE_OBJECT_PARENT) { - ((struct GraphNodeObjectParent *) gCurGraphNodeList[gCurGraphNodeIndex - 1])->sharedChild = graphNode; + struct GraphNodeObjectParent* objParent = ((struct GraphNodeObjectParent *) gCurGraphNodeList[gCurGraphNodeIndex - 1]); + objParent->sharedChild = graphNode; + dynos_actor_override((void*)&objParent->sharedChild); } else { geo_add_child(gCurGraphNodeList[gCurGraphNodeIndex - 1], graphNode); } diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index baa549f5..e52dd04a 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -761,6 +761,7 @@ Gfx* geo_render_mirror_mario(s32 callContext, struct GraphNode* node, UNUSED Mat if (mario->header.gfx.pos[0] > 1700.0f) { // TODO: Is this a geo layout copy or a graph node copy? gMirrorMario[i].sharedChild = mario->header.gfx.sharedChild; + dynos_actor_override((void*)&gMirrorMario[i].sharedChild); gMirrorMario[i].areaIndex = mario->header.gfx.areaIndex; vec3s_copy(gMirrorMario[i].angle, mario->header.gfx.angle); vec3f_copy(gMirrorMario[i].pos, mario->header.gfx.pos);