Fix up DynOS actor override

This commit is contained in:
MysterD 2022-04-22 18:57:26 -07:00
parent e7cd7ccd6d
commit df294c0f64
3 changed files with 8 additions and 1 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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);