diff --git a/mm/2s2h/BenPort.cpp b/mm/2s2h/BenPort.cpp index 0c3c9dda8..e8a08471a 100644 --- a/mm/2s2h/BenPort.cpp +++ b/mm/2s2h/BenPort.cpp @@ -1176,6 +1176,10 @@ extern "C" Vtx* ResourceMgr_LoadVtxByName(char* path) { return (Vtx*)ResourceGetDataByName(path); } +extern "C" Mtx* ResourceMgr_LoadMtxByName(char* path) { + return (Mtx*)ResourceGetDataByName(path); +} + extern "C" SequenceData ResourceMgr_LoadSeqByName(const char* path) { SequenceData* sequence = (SequenceData*)ResourceGetDataByName(path); return *sequence; diff --git a/mm/2s2h/BenPort.h b/mm/2s2h/BenPort.h index 1bad7f7af..f67607bbc 100644 --- a/mm/2s2h/BenPort.h +++ b/mm/2s2h/BenPort.h @@ -103,6 +103,7 @@ Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); char* ResourceMgr_LoadVtxArrayByName(const char* path); size_t ResourceMgr_GetVtxArraySizeByName(const char* path); Vtx* ResourceMgr_LoadVtxByName(char* path); +Mtx* ResourceMgr_LoadMtxByName(char* path); KeyFrameSkeleton* ResourceMgr_LoadKeyFrameSkelByName(const char* path); KeyFrameAnimation* ResourceMgr_LoadKeyFrameAnimByName(const char* path); diff --git a/mm/src/code/z_draw.c b/mm/src/code/z_draw.c index 1d5b967d7..8dd890d73 100644 --- a/mm/src/code/z_draw.c +++ b/mm/src/code/z_draw.c @@ -90,6 +90,8 @@ #include "assets/objects/object_bsmask/object_bsmask.h" #include "assets/objects/object_st/object_st.h" +#include "2s2h/BenPort.h" + void GetItem_DrawBombchu(PlayState* play, s16 drawId); void GetItem_DrawPoes(PlayState* play, s16 drawId); void GetItem_DrawFairyBottle(PlayState* play, s16 drawId); @@ -669,7 +671,7 @@ void GetItem_DrawSeahorse(PlayState* play, s16 drawId) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[1]); - Matrix_MtxToMtxF(Lib_SegmentedToVirtual(sDrawItemTable[drawId].drawResources[3]), &mtx); + Matrix_MtxToMtxF(ResourceMgr_LoadMtxByName(Lib_SegmentedToVirtual(sDrawItemTable[drawId].drawResources[3])), &mtx); Matrix_Mult(&mtx, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF); @@ -695,7 +697,7 @@ void GetItem_DrawFairyContainer(PlayState* play, s16 drawId) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, sDrawItemTable[drawId].drawResources[1]); - Matrix_MtxToMtxF(Lib_SegmentedToVirtual(sDrawItemTable[drawId].drawResources[3]), &mtx); + Matrix_MtxToMtxF(ResourceMgr_LoadMtxByName(Lib_SegmentedToVirtual(sDrawItemTable[drawId].drawResources[3])), &mtx); Matrix_Mult(&mtx, MTXMODE_APPLY); Matrix_ReplaceRotation(&play->billboardMtxF);