Adds support for custom drawing functions, and adds one for Small Keys and Boss Keys.

This commit is contained in:
Christopher Leggett
2022-08-23 21:12:21 -04:00
parent b7e07bef2f
commit 28afbec341
7 changed files with 162 additions and 7 deletions
+10 -2
View File
@@ -1360,7 +1360,11 @@ void EnItem00_DrawCollectible(EnItem00* this, GlobalContext* globalCtx) {
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(this->getItemId, this->actor.id, this->ogParams, globalCtx->sceneNum);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
if (randoGetItemEntry.drawFunc != NULL) {
randoGetItemEntry.drawFunc(globalCtx, &randoGetItemEntry);
} else {
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
}
} else {
s32 texIndex = this->actor.params - 3;
@@ -1419,7 +1423,11 @@ void EnItem00_DrawHeartPiece(EnItem00* this, GlobalContext* globalCtx) {
GetItemEntry randoGetItemEntry =
Randomizer_GetRandomizedItem(GI_HEART_PIECE, this->actor.id, this->ogParams, globalCtx->sceneNum);
EnItem00_CustomItemsParticles(&this->actor, globalCtx, randoGetItemEntry);
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
if (randoGetItemEntry.drawFunc != NULL) {
randoGetItemEntry.drawFunc(globalCtx, &randoGetItemEntry);
} else {
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
}
} else {
s32 pad;
+5 -1
View File
@@ -1170,7 +1170,11 @@ void Player_DrawGetItemImpl(GlobalContext* globalCtx, Player* this, Vec3f* refPo
Matrix_RotateZYX(0, globalCtx->gameplayFrames * 1000, 0, MTXMODE_APPLY);
Matrix_Scale(0.2f, 0.2f, 0.2f, MTXMODE_APPLY);
GetItem_Draw(globalCtx, drawIdPlusOne - 1);
if(this->getItemEntry.drawFunc != NULL) {
this->getItemEntry.drawFunc(globalCtx, &this->getItemEntry);
} else {
GetItem_Draw(globalCtx, drawIdPlusOne - 1);
}
CLOSE_DISPS(globalCtx->state.gfxCtx);
}