mirror of
https://github.com/HarbourMasters/Shipwright
synced 2026-06-18 15:55:29 -04:00
Implements better way to use new draw functions and adds Double Defense colors.
This commit is contained in:
@@ -395,6 +395,18 @@ void GetItem_Draw(GlobalContext* globalCtx, s16 drawId) {
|
||||
sDrawItemTable[drawId].drawFunc(globalCtx, drawId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw "Get Item" Model from a `GetItemEntry`
|
||||
* Uses the Custom Draw Function if it exists, or just calls `GetItem_Draw`
|
||||
*/
|
||||
void GetItemEntry_Draw(GlobalContext* globalCtx, GetItemEntry getItemEntry) {
|
||||
if (getItemEntry.drawFunc != NULL) {
|
||||
getItemEntry.drawFunc(globalCtx, &getItemEntry);
|
||||
} else {
|
||||
GetItem_Draw(globalCtx, getItemEntry.gid);
|
||||
}
|
||||
}
|
||||
|
||||
// All remaining functions in this file are draw functions referenced in the table and called by the function above
|
||||
|
||||
/* 0x0178 */ u8 primXluColor[3];
|
||||
|
||||
@@ -1272,7 +1272,7 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, GetI
|
||||
color_slot = 0;
|
||||
break;
|
||||
case RG_DOUBLE_DEFENSE:
|
||||
color_slot = 1;
|
||||
color_slot = 8;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -1284,14 +1284,14 @@ void EnItem00_CustomItemsParticles(Actor* Parent, GlobalContext* globalCtx, GetI
|
||||
|
||||
s16* colors[9][3] = {
|
||||
{ 34, 255, 76 }, // Minuet and Magic Upgrades Colors
|
||||
{ 177, 35, 35 }, // Bolero and Double Defense Colors
|
||||
{ 177, 35, 35 }, // Bolero Colors
|
||||
{ 115, 251, 253 }, // Serenade Color
|
||||
{ 177, 122, 35 }, // Requiem Color
|
||||
{ 177, 28, 212 }, // Nocturne Color
|
||||
{ 255, 255, 92 }, // Prelude Color
|
||||
{ 31, 152, 49 }, // Stick Upgrade Color
|
||||
{ 222, 182, 20 }, // Nut Upgrade Color
|
||||
{ 255, 255, 255 } // White Color placeholder
|
||||
{ 255, 255, 255 } // Double Defense Color
|
||||
};
|
||||
|
||||
s16* colorsEnv[9][3] = {
|
||||
@@ -1360,11 +1360,7 @@ 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);
|
||||
if (randoGetItemEntry.drawFunc != NULL) {
|
||||
randoGetItemEntry.drawFunc(globalCtx, &randoGetItemEntry);
|
||||
} else {
|
||||
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
|
||||
}
|
||||
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
|
||||
} else {
|
||||
s32 texIndex = this->actor.params - 3;
|
||||
|
||||
@@ -1423,11 +1419,7 @@ 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);
|
||||
if (randoGetItemEntry.drawFunc != NULL) {
|
||||
randoGetItemEntry.drawFunc(globalCtx, &randoGetItemEntry);
|
||||
} else {
|
||||
GetItem_Draw(globalCtx, randoGetItemEntry.gid);
|
||||
}
|
||||
GetItemEntry_Draw(globalCtx, randoGetItemEntry);
|
||||
} else {
|
||||
s32 pad;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user