Fix fairy container and seahorse rendering (#804)

This commit is contained in:
Garrett Cox 2024-10-10 13:38:58 -05:00 committed by GitHub
parent 3ebfdb3928
commit 0129959d7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 2 deletions

View File

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

View File

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

View File

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