1
0
mirror of https://github.com/zeldaret/oot.git synced 2024-09-21 04:24:43 +00:00

Improve matches in Interface_Draw (#1200)

This commit is contained in:
engineer124 2022-04-24 00:11:24 +10:00 committed by GitHub
parent 32e66c2da8
commit 924c10d2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -764,8 +764,6 @@ void func_80083108(GlobalContext* globalCtx) {
}
}
} else {
sp28 = 1;
if ((gSaveContext.equips.buttonItems[0] == ITEM_NONE) ||
(gSaveContext.equips.buttonItems[0] == ITEM_BOW)) {
@ -778,7 +776,7 @@ void func_80083108(GlobalContext* globalCtx) {
gSaveContext.buttonStatus[0] = gSaveContext.equips.buttonItems[0];
}
}
if (1) {} // Necessary to match
sp28 = 1;
}
if (sp28) {
@ -3254,7 +3252,6 @@ void Interface_Draw(GlobalContext* globalCtx) {
gDPPipeSync(OVERLAY_DISP++);
func_8008A994(interfaceCtx);
svar3 = 16;
if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 3)) {
// Inventory Equip Effects
@ -3263,12 +3260,12 @@ void Interface_Draw(GlobalContext* globalCtx) {
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATERGBA_PRIM, G_CC_MODULATERGBA_PRIM);
gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD);
pauseCtx->cursorVtx[svar3].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = svar2 = pauseCtx->equipAnimX / 10;
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] = svar2 =
pauseCtx->cursorVtx[svar3].v.ob[0] + WREG(90) / 10;
pauseCtx->cursorVtx[svar3].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] = svar2 = pauseCtx->equipAnimY / 10;
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] = svar2 =
pauseCtx->cursorVtx[svar3].v.ob[1] - WREG(90) / 10;
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = pauseCtx->equipAnimX / 10;
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] + WREG(90) / 10;
pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] = pauseCtx->equipAnimY / 10;
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] - WREG(90) / 10;
if (pauseCtx->equipTargetItem < 0xBF) {
// Normal Equip (icon goes from the inventory slot to the C button when equipping it)
@ -3286,13 +3283,13 @@ void Interface_Draw(GlobalContext* globalCtx) {
if ((pauseCtx->equipAnimAlpha > 0) && (pauseCtx->equipAnimAlpha < 255)) {
svar1 = (pauseCtx->equipAnimAlpha / 8) / 2;
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] = svar2 =
pauseCtx->cursorVtx[16].v.ob[0] = pauseCtx->cursorVtx[18].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] - svar1;
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] = svar2 =
pauseCtx->cursorVtx[17].v.ob[0] = pauseCtx->cursorVtx[19].v.ob[0] =
pauseCtx->cursorVtx[16].v.ob[0] + svar1 * 2 + 32;
pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] = svar2 =
pauseCtx->cursorVtx[16].v.ob[1] = pauseCtx->cursorVtx[17].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] + svar1;
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] = svar2 =
pauseCtx->cursorVtx[18].v.ob[1] = pauseCtx->cursorVtx[19].v.ob[1] =
pauseCtx->cursorVtx[16].v.ob[1] - svar1 * 2 - 32;
}
@ -3613,7 +3610,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
case 3:
case 9:
osSyncPrintf("event_xp[1]=%d, event_yp[1]=%d TOTAL_EVENT_TM=%d\n",
svar5 = gSaveContext.timerX[1], svar2 = gSaveContext.timerY[1],
((void)0, gSaveContext.timerX[1]), ((void)0, gSaveContext.timerY[1]),
gSaveContext.timer2Value);
svar1 = (gSaveContext.timerX[1] - 26) / D_8015FFE6;
gSaveContext.timerX[1] -= svar1;
@ -3718,7 +3715,7 @@ void Interface_Draw(GlobalContext* globalCtx) {
if (((gSaveContext.timer1State != 0) && (gSaveContext.timer1State != 10)) ||
(gSaveContext.timer2State != 0)) {
timerDigits[0] = timerDigits[1] = svar2 = timerDigits[3] = 0;
timerDigits[0] = timerDigits[1] = timerDigits[3] = 0;
timerDigits[2] = 10; // digit 10 is used as ':' (colon)
if (gSaveContext.timer1State != 0) {
@ -3745,10 +3742,9 @@ void Interface_Draw(GlobalContext* globalCtx) {
gDPPipeSync(OVERLAY_DISP++);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255);
gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0);
svar5 = gSaveContext.timerX[svar6];
svar2 = gSaveContext.timerY[svar6];
OVERLAY_DISP =
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, svar5, svar2 + 2, 16, 16, 1 << 10, 1 << 10);
Gfx_TextureIA8(OVERLAY_DISP, gClockIconTex, 16, 16, ((void)0, gSaveContext.timerX[svar6]),
((void)0, gSaveContext.timerY[svar6]) + 2, 16, 16, 1 << 10, 1 << 10);
// Timer Counter
gDPPipeSync(OVERLAY_DISP++);
@ -3770,13 +3766,11 @@ void Interface_Draw(GlobalContext* globalCtx) {
}
for (svar1 = 0; svar1 < 5; svar1++) {
// clang-format off
svar5 = gSaveContext.timerX[svar6]; OVERLAY_DISP =
OVERLAY_DISP =
Gfx_TextureI8(OVERLAY_DISP, ((u8*)gCounterDigit0Tex + (8 * 16 * timerDigits[svar1])), 8, 16,
svar5 + timerDigitLeftPos[svar1],
svar2 = gSaveContext.timerY[svar6], digitWidth[svar1], VREG(42), VREG(43) << 1,
((void)0, gSaveContext.timerX[svar6]) + timerDigitLeftPos[svar1],
((void)0, gSaveContext.timerY[svar6]), digitWidth[svar1], VREG(42), VREG(43) << 1,
VREG(43) << 1);
// clang-format on
}
}
}