diff --git a/data/dynos_mgr_actor.cpp b/data/dynos_mgr_actor.cpp index 68a87437..75f4e94b 100644 --- a/data/dynos_mgr_actor.cpp +++ b/data/dynos_mgr_actor.cpp @@ -144,7 +144,7 @@ void DynOS_Actor_Override_All(void) { struct Object *_Head = (struct Object *) &gObjectLists[list]; for (struct Object *_Object = (struct Object *) _Head->header.next; _Object != _Head; _Object = (struct Object *) _Object->header.next) { if (_Object->header.gfx.sharedChild != NULL && _Object->header.gfx.sharedChild->georef != NULL) { - GraphNode* georef =(GraphNode*)_Object->header.gfx.sharedChild->georef; + GraphNode* georef = (GraphNode*)_Object->header.gfx.sharedChild->georef; _Object->header.gfx.sharedChild = (GraphNode *) DynOS_Geo_GetGraphNode(georef, true); } DynOS_Actor_Override((void**)&_Object->header.gfx.sharedChild); diff --git a/data/dynos_mgr_pack.cpp b/data/dynos_mgr_pack.cpp index eee63dae..c2645722 100644 --- a/data/dynos_mgr_pack.cpp +++ b/data/dynos_mgr_pack.cpp @@ -1,4 +1,7 @@ #include "dynos.cpp.h" +extern "C" { +#include "engine/graph_node.h" +} static Array& DynosPacks() { static Array sDynosPacks; @@ -21,6 +24,15 @@ static void DynOS_Pack_ActivateActor(s32 aPackIndex, PairmVertices) { + vertices += vtx->mSize; + } + if (vertices > 6) { + actorGfx.mGraphNode->extraFlags |= GRAPH_EXTRA_FORCE_3D; + } + DynOS_Actor_Valid(georef, actorGfx); } diff --git a/data/dynos_misc.cpp b/data/dynos_misc.cpp index d822872f..c34fa0a9 100644 --- a/data/dynos_misc.cpp +++ b/data/dynos_misc.cpp @@ -167,6 +167,7 @@ void *DynOS_Geo_GetGraphNode(const void *aGeoLayout, bool aKeepInMemory) { if (aKeepInMemory) { sLoadedGraphNodes.Add({ (void *) aGeoLayout, (void *) _Node }); } + free(_Pool); return _Node; } diff --git a/include/types.h b/include/types.h index ad222967..1e1f0928 100644 --- a/include/types.h +++ b/include/types.h @@ -113,6 +113,7 @@ struct GraphNode /*0x0C*/ struct GraphNode *parent; /*0x10*/ struct GraphNode *children; /*0x14*/ const void *georef; + /*????*/ u8 extraFlags; }; struct AnimInfo diff --git a/src/engine/graph_node.h b/src/engine/graph_node.h index 0eb5b44b..0f9e2914 100644 --- a/src/engine/graph_node.h +++ b/src/engine/graph_node.h @@ -16,6 +16,9 @@ #define GRAPH_RENDER_CYLBOARD (1 << 6) #define GRAPH_RENDER_PLAYER (1 << 7) +// Extra, custom, flags +#define GRAPH_EXTRA_FORCE_3D (1 << 0) + // Whether the node type has a function pointer of type GraphNodeFunc #define GRAPH_NODE_TYPE_FUNCTIONAL 0x100 diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c index 54d16676..c9cc5f4c 100644 --- a/src/game/obj_behaviors.c +++ b/src/game/obj_behaviors.c @@ -225,7 +225,7 @@ void obj_orient_graph(struct Object *obj, f32 normalX, f32 normalY, f32 normalZ) } // Passes on orienting billboard objects, i.e. coins, trees, etc. - if (obj->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { + if ((obj->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) && !(obj->header.gfx.sharedChild && obj->header.gfx.sharedChild->extraFlags & GRAPH_EXTRA_FORCE_3D)) { return; } diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 692eec1d..5e87327d 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -1113,7 +1113,7 @@ static void geo_process_object(struct Object *node) { } mtxf_copy(node->header.gfx.prevThrowMatrix, *node->header.gfx.throwMatrix); node->header.gfx.prevThrowMatrixTimestamp = gGlobalTimer; - } else if (node->header.gfx.node.flags & GRAPH_RENDER_CYLBOARD) { + } else if ((node->header.gfx.node.flags & GRAPH_RENDER_CYLBOARD) && !(node->header.gfx.sharedChild && node->header.gfx.sharedChild->extraFlags & GRAPH_EXTRA_FORCE_3D)) { Vec3f posInterpolated; if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && gGlobalTimer != node->header.gfx.skipInterpolationTimestamp && @@ -1128,7 +1128,7 @@ static void geo_process_object(struct Object *node) { node->header.gfx.pos, gCurGraphNodeCamera->roll); mtxf_cylboard(gMatStackInterpolated[gMatStackIndex + 1], gMatStackInterpolated[gMatStackIndex], posInterpolated, gCurGraphNodeCamera->roll); - } else if (node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { + } else if ((node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) && !(node->header.gfx.sharedChild && node->header.gfx.sharedChild->extraFlags & GRAPH_EXTRA_FORCE_3D)) { Vec3f posInterpolated; if (gGlobalTimer == node->header.gfx.prevTimestamp + 1 && gGlobalTimer != node->header.gfx.skipInterpolationTimestamp &&