mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-08-20 13:23:45 -07:00
Merge dd53ad8cd4
into 7b4df9bdb2
This commit is contained in:
commit
5f0d6ead22
13 changed files with 64 additions and 38 deletions
|
@ -502,6 +502,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
if (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
-Wall -Wextra -Wno-error
|
-Wall -Wextra -Wno-error
|
||||||
|
-Wformat-security
|
||||||
-Wno-return-type
|
-Wno-return-type
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
|
@ -529,6 +530,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "NintendoSwitch")
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
-Wall -Wextra -Wno-error
|
-Wall -Wextra -Wno-error
|
||||||
|
-Wformat-security
|
||||||
-Wno-return-type
|
-Wno-return-type
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
|
@ -579,6 +581,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
|
||||||
|
|
||||||
target_compile_options(${PROJECT_NAME} PRIVATE
|
target_compile_options(${PROJECT_NAME} PRIVATE
|
||||||
-Wall -Wextra -Wno-error
|
-Wall -Wextra -Wno-error
|
||||||
|
-Wformat-security
|
||||||
-Wno-unused-parameter
|
-Wno-unused-parameter
|
||||||
-Wno-unused-function
|
-Wno-unused-function
|
||||||
-Wno-unused-variable
|
-Wno-unused-variable
|
||||||
|
|
|
@ -1238,6 +1238,8 @@ void func_80097534(PlayState* play, RoomContext* roomCtx);
|
||||||
void Sample_Destroy(GameState* thisx);
|
void Sample_Destroy(GameState* thisx);
|
||||||
void Sample_Init(GameState* thisx);
|
void Sample_Init(GameState* thisx);
|
||||||
void Inventory_ChangeEquipment(s16 equipment, u16 value);
|
void Inventory_ChangeEquipment(s16 equipment, u16 value);
|
||||||
|
void *Item_GetIcon(s16 item);
|
||||||
|
s32 Item_GetAction(s16 item);
|
||||||
u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment);
|
u8 Inventory_DeleteEquipment(PlayState* play, s16 equipment);
|
||||||
void Inventory_ChangeUpgrade(s16 upgrade, s16 value);
|
void Inventory_ChangeUpgrade(s16 upgrade, s16 value);
|
||||||
void Object_InitBank(PlayState* play, ObjectContext* objectCtx);
|
void Object_InitBank(PlayState* play, ObjectContext* objectCtx);
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
#define IS_DAY (gSaveContext.nightFlag == 0)
|
#define IS_DAY (gSaveContext.nightFlag == 0)
|
||||||
#define IS_NIGHT (gSaveContext.nightFlag == 1)
|
#define IS_NIGHT (gSaveContext.nightFlag == 1)
|
||||||
|
|
||||||
#define SLOT(item) gItemSlots[item]
|
#define SLOT(item) (item > ARRAY_COUNT(gItemSlots)-1 ? SLOT_BOTTLE_1 : gItemSlots[item])
|
||||||
#define INV_CONTENT(item) gSaveContext.inventory.items[SLOT(item)]
|
#define INV_CONTENT(item) gSaveContext.inventory.items[SLOT(item)]
|
||||||
#define AMMO(item) gSaveContext.inventory.ammo[SLOT(item)]
|
#define AMMO(item) gSaveContext.inventory.ammo[SLOT(item)]
|
||||||
#define BEANS_BOUGHT AMMO(ITEM_BEAN + 1)
|
#define BEANS_BOUGHT AMMO(ITEM_BEAN + 1)
|
||||||
|
|
|
@ -395,7 +395,7 @@ void PresetsCustomWidget(WidgetInfo& info) {
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::AlignTextToFramePadding();
|
ImGui::AlignTextToFramePadding();
|
||||||
ImGui::Text(name.c_str());
|
ImGui::Text("%s", name.c_str());
|
||||||
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
|
for (int i = PRESET_SECTION_SETTINGS; i < PRESET_SECTION_MAX; i++) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
DrawSectionCheck(name, !info.presetValues["blocks"].contains(blockInfo[i].names[1]), &info.apply[i],
|
DrawSectionCheck(name, !info.presetValues["blocks"].contains(blockInfo[i].names[1]), &info.apply[i],
|
||||||
|
|
|
@ -647,7 +647,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject) {
|
||||||
imageMax.y - ImGui::CalcTextSize(std::to_string(drawObject.second).c_str()).y - 2);
|
imageMax.y - ImGui::CalcTextSize(std::to_string(drawObject.second).c_str()).y - 2);
|
||||||
|
|
||||||
ImGui::SetCursorScreenPos(textPos);
|
ImGui::SetCursorScreenPos(textPos);
|
||||||
ImGui::Text(std::to_string(drawObject.second).c_str());
|
ImGui::Text("%s", std::to_string(drawObject.second).c_str());
|
||||||
|
|
||||||
// Overlay item info
|
// Overlay item info
|
||||||
if (drawObject.first.GetRandomizerGet() >= RG_PROGRESSIVE_HOOKSHOT &&
|
if (drawObject.first.GetRandomizerGet() >= RG_PROGRESSIVE_HOOKSHOT &&
|
||||||
|
@ -665,7 +665,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject) {
|
||||||
ImGui::SetCursorScreenPos(textPos);
|
ImGui::SetCursorScreenPos(textPos);
|
||||||
std::string overlayText = "+";
|
std::string overlayText = "+";
|
||||||
overlayText += extractNumberInParentheses(drawObject.first.GetName().english.c_str());
|
overlayText += extractNumberInParentheses(drawObject.first.GetName().english.c_str());
|
||||||
ImGui::Text(overlayText.c_str());
|
ImGui::Text("%s", overlayText.c_str());
|
||||||
}
|
}
|
||||||
if (drawObject.first.GetRandomizerGet() >= RG_FOREST_TEMPLE_BOSS_KEY &&
|
if (drawObject.first.GetRandomizerGet() >= RG_FOREST_TEMPLE_BOSS_KEY &&
|
||||||
drawObject.first.GetRandomizerGet() <= RG_GANONS_CASTLE_BOSS_KEY) {
|
drawObject.first.GetRandomizerGet() <= RG_GANONS_CASTLE_BOSS_KEY) {
|
||||||
|
@ -678,7 +678,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Text(shortName.c_str());
|
ImGui::Text("%s", shortName.c_str());
|
||||||
}
|
}
|
||||||
if (drawObject.first.GetRandomizerGet() >= RG_OCARINA_A_BUTTON &&
|
if (drawObject.first.GetRandomizerGet() >= RG_OCARINA_A_BUTTON &&
|
||||||
drawObject.first.GetRandomizerGet() <= RG_OCARINA_C_RIGHT_BUTTON) {
|
drawObject.first.GetRandomizerGet() <= RG_OCARINA_C_RIGHT_BUTTON) {
|
||||||
|
@ -691,7 +691,7 @@ void PlandomizerOverlayText(std::pair<Rando::Item, uint32_t> drawObject) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImGui::Text(shortName.c_str());
|
ImGui::Text("%s", shortName.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1066,7 +1066,7 @@ void PlandomizerDrawHintsWindow() {
|
||||||
ImGui::SeparatorText(hintData.hintName.c_str());
|
ImGui::SeparatorText(hintData.hintName.c_str());
|
||||||
ImGui::Text("Current Hint: ");
|
ImGui::Text("Current Hint: ");
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
ImGui::TextWrapped(hintData.hintText.c_str());
|
ImGui::TextWrapped("%s", hintData.hintText.c_str());
|
||||||
|
|
||||||
if (spoilerHintData.size() > 0) {
|
if (spoilerHintData.size() > 0) {
|
||||||
hintInputText = plandoHintData[index].hintText.c_str();
|
hintInputText = plandoHintData[index].hintText.c_str();
|
||||||
|
@ -1115,9 +1115,9 @@ void PlandomizerDrawLocationsWindow(RandomizerCheckArea rcArea) {
|
||||||
auto randoArea = Rando::StaticData::GetLocation(checkID)->GetArea();
|
auto randoArea = Rando::StaticData::GetLocation(checkID)->GetArea();
|
||||||
if (rcArea == RCAREA_INVALID || rcArea == randoArea) {
|
if (rcArea == RCAREA_INVALID || rcArea == randoArea) {
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextWrapped(spoilerData.checkName.c_str());
|
ImGui::TextWrapped("%s", spoilerData.checkName.c_str());
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
ImGui::TextWrapped(spoilerData.checkRewardItem.GetName().english.c_str());
|
ImGui::TextWrapped("%s", spoilerData.checkRewardItem.GetName().english.c_str());
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
PlandomizerDrawItemSlots(index);
|
PlandomizerDrawItemSlots(index);
|
||||||
if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
if (plandoLogData[index].checkRewardItem.GetRandomizerGet() == RG_ICE_TRAP) {
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ void CheckTrackerWindow::DrawElement() {
|
||||||
totalChecksSS << totalChecksAvailable << " Available / ";
|
totalChecksSS << totalChecksAvailable << " Available / ";
|
||||||
}
|
}
|
||||||
totalChecksSS << totalChecksGotten << " Checked / " << totalChecks << " Total";
|
totalChecksSS << totalChecksGotten << " Checked / " << totalChecks << " Total";
|
||||||
ImGui::Text(totalChecksSS.str().c_str());
|
ImGui::Text("%s", totalChecksSS.str().c_str());
|
||||||
|
|
||||||
UIWidgets::PaddedSeparator();
|
UIWidgets::PaddedSeparator();
|
||||||
|
|
||||||
|
@ -1194,7 +1194,7 @@ void CheckTrackerWindow::DrawElement() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text(areaTotalsSS.str().c_str());
|
ImGui::Text("%s", areaTotalsSS.str().c_str());
|
||||||
UIWidgets::Tooltip(areaTotalsTooltipSS.str().c_str());
|
UIWidgets::Tooltip(areaTotalsTooltipSS.str().c_str());
|
||||||
} else {
|
} else {
|
||||||
ImGui::Text("???");
|
ImGui::Text("???");
|
||||||
|
|
|
@ -169,6 +169,18 @@ void* gItemIcons[] = {
|
||||||
gOcarinaBtnIconATex,
|
gOcarinaBtnIconATex,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Safe wrapper around gItemIcons, so we don't crash with bad data when we try
|
||||||
|
// to do weird things like assign non-button items to buttons
|
||||||
|
void *Item_GetIcon(s16 itemId)
|
||||||
|
{
|
||||||
|
if (itemId > ARRAY_COUNT(gItemIcons)-1) {
|
||||||
|
return gItemIconSoldOutTex;
|
||||||
|
}
|
||||||
|
|
||||||
|
return gItemIcons[itemId];
|
||||||
|
}
|
||||||
|
|
||||||
// Used to map item IDs to inventory slots
|
// Used to map item IDs to inventory slots
|
||||||
u8 gItemSlots[] = {
|
u8 gItemSlots[] = {
|
||||||
SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE,
|
SLOT_STICK, SLOT_NUT, SLOT_BOMB, SLOT_BOW, SLOT_ARROW_FIRE, SLOT_DINS_FIRE,
|
||||||
|
|
|
@ -1652,16 +1652,16 @@ void Message_LoadItemIcon(PlayState* play, u16 itemId, s16 y) {
|
||||||
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[language];
|
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem32XOffsets[language];
|
||||||
R_TEXTBOX_ICON_YPOS = y + 6;
|
R_TEXTBOX_ICON_YPOS = y + 6;
|
||||||
R_TEXTBOX_ICON_SIZE = 32;
|
R_TEXTBOX_ICON_SIZE = 32;
|
||||||
memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, gItemIcons[itemId],
|
memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, Item_GetIcon(itemId),
|
||||||
strlen(gItemIcons[itemId]) + 1);
|
strlen(Item_GetIcon(itemId)) + 1);
|
||||||
// "Item 32-0"
|
// "Item 32-0"
|
||||||
osSyncPrintf("アイテム32-0\n");
|
osSyncPrintf("アイテム32-0\n");
|
||||||
} else {
|
} else {
|
||||||
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[language];
|
R_TEXTBOX_ICON_XPOS = R_TEXT_INIT_XPOS - sIconItem24XOffsets[language];
|
||||||
R_TEXTBOX_ICON_YPOS = y + 10;
|
R_TEXTBOX_ICON_YPOS = y + 10;
|
||||||
R_TEXTBOX_ICON_SIZE = 24;
|
R_TEXTBOX_ICON_SIZE = 24;
|
||||||
memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, gItemIcons[itemId],
|
memcpy((uintptr_t)msgCtx->textboxSegment + MESSAGE_STATIC_TEX_SIZE, Item_GetIcon(itemId),
|
||||||
strlen(gItemIcons[itemId]) + 1);
|
strlen(Item_GetIcon(itemId)) + 1);
|
||||||
// "Item 24"
|
// "Item 24"
|
||||||
osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84);
|
osSyncPrintf("アイテム24=%d (%d) {%d}\n", itemId, itemId - ITEM_KOKIRI_EMERALD, 84);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5433,14 +5433,14 @@ void Interface_Draw(PlayState* play) {
|
||||||
// B Button Icon & Ammo Count
|
// B Button Icon & Ammo Count
|
||||||
if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) {
|
if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) {
|
||||||
if (fullUi) {
|
if (fullUi) {
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[0]], 0);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[0]), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((player->stateFlags1 & PLAYER_STATE1_ON_HORSE) || (play->shootingGalleryStatus > 1) ||
|
if ((player->stateFlags1 & PLAYER_STATE1_ON_HORSE) || (play->shootingGalleryStatus > 1) ||
|
||||||
((play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38))) {
|
((play->sceneNum == SCENE_BOMBCHU_BOWLING_ALLEY) && Flags_GetSwitch(play, 0x38))) {
|
||||||
|
|
||||||
if (!fullUi) {
|
if (!fullUi) {
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[0]], 0);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[0]), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
|
@ -5521,7 +5521,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[1] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cLeftAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[1]], 1);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[1]), 1);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5534,7 +5534,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[2] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cDownAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[2]], 2);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[2]), 2);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5547,7 +5547,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[3] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->cRightAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[3]], 3);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[3]), 3);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5613,7 +5613,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[4] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[4] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadUpAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadUpAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[4]], 4);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[4]), 4);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5624,7 +5624,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[5] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[5] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadDownAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadDownAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[5]], 5);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[5]), 5);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5635,7 +5635,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[6] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[6] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadLeftAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadLeftAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[6]], 6);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[6]), 6);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5646,7 +5646,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
if (gSaveContext.equips.buttonItems[7] < 0xF0) {
|
if (gSaveContext.equips.buttonItems[7] < 0xF0) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadRightAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->dpadRightAlpha);
|
||||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
|
||||||
Interface_DrawItemIconTexture(play, gItemIcons[gSaveContext.equips.buttonItems[7]], 7);
|
Interface_DrawItemIconTexture(play, Item_GetIcon(gSaveContext.equips.buttonItems[7]), 7);
|
||||||
gDPPipeSync(OVERLAY_DISP++);
|
gDPPipeSync(OVERLAY_DISP++);
|
||||||
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0,
|
||||||
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0);
|
||||||
|
@ -5753,7 +5753,7 @@ void Interface_Draw(PlayState* play) {
|
||||||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha);
|
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, pauseCtx->equipAnimAlpha);
|
||||||
gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
|
gSPVertex(OVERLAY_DISP++, &pauseCtx->cursorVtx[16], 4, 0);
|
||||||
|
|
||||||
gDPLoadTextureBlock(OVERLAY_DISP++, gItemIcons[pauseCtx->equipTargetItem], G_IM_FMT_RGBA, G_IM_SIZ_32b,
|
gDPLoadTextureBlock(OVERLAY_DISP++, Item_GetIcon(pauseCtx->equipTargetItem), G_IM_FMT_RGBA, G_IM_SIZ_32b,
|
||||||
32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||||
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2253,7 +2253,7 @@ s8 Player_ItemToItemAction(s32 item) {
|
||||||
} else if (item == ITEM_FISHING_POLE) {
|
} else if (item == ITEM_FISHING_POLE) {
|
||||||
return PLAYER_IA_FISHING_POLE;
|
return PLAYER_IA_FISHING_POLE;
|
||||||
} else {
|
} else {
|
||||||
return sItemActions[item];
|
return Item_GetAction(item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10657,9 +10657,18 @@ void Player_StartMode_BlueWarp(PlayState* play, Player* this) {
|
||||||
|
|
||||||
static u8 D_808546F0[] = { ITEM_SWORD_MASTER, ITEM_SWORD_KOKIRI };
|
static u8 D_808546F0[] = { ITEM_SWORD_MASTER, ITEM_SWORD_KOKIRI };
|
||||||
|
|
||||||
|
// Helper so that we don't buffer overrun item actions with custom items
|
||||||
|
s32 Item_GetAction(s16 item) {
|
||||||
|
if (item > ARRAY_COUNT(sItemActions)-1) {
|
||||||
|
return PLAYER_IA_POCKET_EGG;
|
||||||
|
}
|
||||||
|
|
||||||
|
return sItemActions[item];
|
||||||
|
}
|
||||||
|
|
||||||
void func_80846720(PlayState* play, Player* this, s32 arg2) {
|
void func_80846720(PlayState* play, Player* this, s32 arg2) {
|
||||||
s32 item = D_808546F0[(void)0, gSaveContext.linkAge];
|
s32 item = D_808546F0[(void)0, gSaveContext.linkAge];
|
||||||
s32 itemAction = sItemActions[item];
|
s32 itemAction = Item_GetAction(item);
|
||||||
|
|
||||||
Player_DestroyHookshot(this);
|
Player_DestroyHookshot(this);
|
||||||
Player_DetachHeldActor(play, this);
|
Player_DetachHeldActor(play, this);
|
||||||
|
|
|
@ -396,7 +396,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
|
||||||
gDPSetEnvColor(POLY_OPA_DISP++, D_8082A0D8[sp218], D_8082A0E4[sp218], D_8082A0F0[sp218], 0);
|
gDPSetEnvColor(POLY_OPA_DISP++, D_8082A0D8[sp218], D_8082A0E4[sp218], D_8082A0F0[sp218], 0);
|
||||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
||||||
|
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_MEDALLION_FOREST + sp218], 24, 24, 0);
|
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, Item_GetIcon(ITEM_MEDALLION_FOREST + sp218), 24, 24, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
|
||||||
for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) {
|
for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) {
|
||||||
if (CHECK_QUEST_ITEM(sp218 + 0x12)) {
|
if (CHECK_QUEST_ITEM(sp218 + 0x12)) {
|
||||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_KOKIRI_EMERALD + sp218], 24, 24, 0);
|
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, Item_GetIcon(ITEM_KOKIRI_EMERALD + sp218), 24, 24, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -455,7 +455,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
|
||||||
if (CHECK_QUEST_ITEM(sp218 + 0x15)) {
|
if (CHECK_QUEST_ITEM(sp218 + 0x15)) {
|
||||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
||||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
|
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 255, 255, 255, pauseCtx->alpha);
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, gItemIcons[ITEM_STONE_OF_AGONY + sp218], 24, 24, 0);
|
KaleidoScope_DrawQuadTextureRGBA32(gfxCtx, Item_GetIcon(ITEM_STONE_OF_AGONY + sp218), 24, 24, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -511,7 +511,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
|
||||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
gSPVertex(POLY_OPA_DISP++, &pauseCtx->questVtx[sp21A], 4, 0);
|
||||||
|
|
||||||
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(
|
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(
|
||||||
POLY_OPA_DISP, gItemIcons[0x79 + (((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> 0x1C)],
|
POLY_OPA_DISP, Item_GetIcon(0x79 + (((gSaveContext.inventory.questItems & 0xF0000000) & 0xF0000000) >> 0x1C)),
|
||||||
48, 48, 0);
|
48, 48, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -775,7 +775,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx,
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx,
|
||||||
gItemIcons[sChildUpgradeItemBases[i] + point - 1], 32, 32, 0);
|
Item_GetIcon(sChildUpgradeItemBases[i] + point - 1), 32, 32, 0);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -787,7 +787,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(
|
KaleidoScope_DrawQuadTextureRGBA32(
|
||||||
play->state.gfxCtx, gItemIcons[sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1],
|
play->state.gfxCtx, Item_GetIcon(sChildUpgradeItemBases[i] + CUR_UPG_VALUE(sChildUpgrades[i]) - 1),
|
||||||
32, 32, 0);
|
32, 32, 0);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
} else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) {
|
} else if (CUR_UPG_VALUE(sAdultUpgrades[i]) != 0) {
|
||||||
|
@ -802,7 +802,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(
|
KaleidoScope_DrawQuadTextureRGBA32(
|
||||||
play->state.gfxCtx, gItemIcons[sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1],
|
play->state.gfxCtx, Item_GetIcon(sAdultUpgradeItemBases[i] + CUR_UPG_VALUE(sAdultUpgrades[i]) - 1),
|
||||||
32, 32, 0);
|
32, 32, 0);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
|
@ -821,7 +821,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
|
||||||
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) {
|
} else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) {
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, 32, 32, point);
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIconBrokenGiantsKnifeTex, 32, 32, point);
|
||||||
} else if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
} else if (gBitFlags[bit] & gSaveContext.inventory.equipment) {
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[itemId], 32, 32, point);
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, Item_GetIcon(itemId), 32, 32, point);
|
||||||
}
|
}
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ void KaleidoScope_DrawItemCycleExtras(PlayState* play, u8 slot, u8 canCycle, u8
|
||||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[leftItem], 32, 32, 0);
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, Item_GetIcon(leftItem), 32, 32, 0);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
if (showRightItem) {
|
if (showRightItem) {
|
||||||
|
@ -253,7 +253,7 @@ void KaleidoScope_DrawItemCycleExtras(PlayState* play, u8 slot, u8 canCycle, u8
|
||||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[rightItem], 32, 32, 4);
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, Item_GetIcon(rightItem), 32, 32, 4);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
|
||||||
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
gDPSetGrayscaleColor(POLY_OPA_DISP++, 109, 109, 109, 255);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, true);
|
gSPGrayscale(POLY_OPA_DISP++, true);
|
||||||
}
|
}
|
||||||
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, gItemIcons[itemId], 32, 32, 0);
|
KaleidoScope_DrawQuadTextureRGBA32(play->state.gfxCtx, Item_GetIcon(itemId), 32, 32, 0);
|
||||||
gSPGrayscale(POLY_OPA_DISP++, false);
|
gSPGrayscale(POLY_OPA_DISP++, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue