mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-03 06:24:30 +00:00
Interface improvements (#822)
* Add symbols, does NOT build OK * parameter OK with syms * Use `static` more and inline arrays * wip docs * Start on Interface_Draw, NOT OK yet * rename variables since interface dev is weird * nonmatching for now * kaleido * Update src/code/z_parameter.c Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> * Make most texture rectangles use shifts * fix symbols for all interface things * done with interface_draw for now * Update z_parameter.c * format files * fix wrong function calls * fix bss * improvements in matching * remove button enum for now * (void)0 to fix warning * make conditional look nicer * fix * fix wrong combiner * Update src/overlays/actors/ovl_kaleido_scope/z_lmap_mark.c Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com> * format * remove "HUD" naming * review suggestions Co-authored-by: louist103 <35883445+louist103@users.noreply.github.com> Co-authored-by: Roman971 <32455037+Roman971@users.noreply.github.com>
This commit is contained in:
parent
566d107e55
commit
c644aaa2ee
30 changed files with 954 additions and 842 deletions
|
@ -143,7 +143,7 @@ void BgGndFiremeiro_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
void BgGndFiremeiro_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 280);
|
||||
func_800943C8(globalCtx->state.gfxCtx);
|
||||
|
||||
|
||||
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_bg_gnd_firemeiro.c", 282),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(POLY_OPA_DISP++, gFireTrialPlatformDL);
|
||||
|
|
|
@ -342,7 +342,7 @@ void EnMag_DrawImageRGBA32(Gfx** gfxp, s16 centerX, s16 centerY, u8* source, u32
|
|||
gDPLoadTile(gfx++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2);
|
||||
|
||||
gSPTextureRectangle(gfx++, rectLeft << 2, rectTop << 2, (rectLeft + (s32)width) << 2,
|
||||
(rectTop + textureHeight) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
(rectTop + textureHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
curTexture += textureSize;
|
||||
rectTop += textureHeight;
|
||||
|
@ -477,7 +477,7 @@ void EnMag_DrawInner(Actor* thisx, GlobalContext* globalCtx, Gfx** gfxp) {
|
|||
gDPLoadTextureBlock(gfx++, D_06019A00, G_IM_FMT_IA, G_IM_SIZ_8b, 160, 16, 0, G_TX_NOMIRROR | G_TX_CLAMP,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSPTextureRectangle(gfx++, 312, 792, 952, 856, G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
gSPTextureRectangle(gfx++, 312, 792, 952, 856, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
if (gSaveContext.fileNum == 0xFEDC) {
|
||||
|
|
|
@ -94,20 +94,19 @@ void EndTitle_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
|||
gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->endAlpha);
|
||||
gDPLoadTextureTile(OVERLAY_DISP++, D_80B670E0, G_IM_FMT_IA, G_IM_SIZ_8b, 80, 24, 0, 0, 80, 24, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, (120 << 2), (90 << 2), (200 << 2), (113 << 2), G_TX_RENDERTILE, 0, 0, (32 << 5),
|
||||
(32 << 5));
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 120 << 2, 90 << 2, 200 << 2, 113 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->tlozAlpha);
|
||||
gDPLoadTextureTile(OVERLAY_DISP++, D_80B65EA0, G_IM_FMT_IA, G_IM_SIZ_8b, 120, 24, 0, 0, 120, 24, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, (100 << 2), (160 << 2), (220 << 2), (183 << 2), G_TX_RENDERTILE, 0, 0,
|
||||
(32 << 5), (32 << 5));
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 100 << 2, 160 << 2, 220 << 2, 183 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10,
|
||||
1 << 10);
|
||||
gDPPipeSync(OVERLAY_DISP++);
|
||||
gDPSetPrimColor(OVERLAY_DISP++, 0x00, 0x80, 0, 0, 0, this->ootAlpha);
|
||||
gDPLoadTextureTile(OVERLAY_DISP++, D_80B669E0, G_IM_FMT_IA, G_IM_SIZ_8b, 112, 16, 0, 0, 112, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0);
|
||||
gSPTextureRectangle(OVERLAY_DISP++, (104 << 2), (177 << 2), (216 << 2), (192 << 2), G_TX_RENDERTILE, 0, 0,
|
||||
(32 << 5), (32 << 5));
|
||||
gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10,
|
||||
1 << 10);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_end_title.c", 515);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
|
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
static void* D_8082A130[] = {
|
||||
gHUDButtonATex, gHUDButtonCDownTex, gHUDButtonCRightTex, gHUDButtonCLeftTex, gHUDButtonCUpTex,
|
||||
gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex,
|
||||
};
|
||||
static u16 D_8082A144[] = {
|
||||
0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC,
|
||||
|
@ -654,9 +654,9 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx
|
|||
phi_s0 = 0;
|
||||
for (sp218 = 0; sp218 < 3; sp218++, sp21A += 4) {
|
||||
if ((sp218 >= 2) || (sp208[sp218] != 0) || (phi_s0 != 0)) {
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, D_02003040[sp208[sp218]], G_IM_FMT_I, G_IM_SIZ_8b, 8, 16, 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);
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * sp208[sp218])), G_IM_FMT_I,
|
||||
G_IM_SIZ_8b, 8, 16, 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);
|
||||
if (1) {}
|
||||
|
||||
gSP1Quadrangle(POLY_OPA_DISP++, sp21A, sp21A + 2, sp21A + 3, sp21A + 1, 0);
|
||||
|
@ -697,7 +697,7 @@ static u8 D_8082A124[] = {
|
|||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
};
|
||||
static void* D_8082A130[] = {
|
||||
gHUDButtonATex, gHUDButtonCDownTex, gHUDButtonCRightTex, gHUDButtonCLeftTex, gHUDButtonCUpTex,
|
||||
gOcarinaATex, gOcarinaCDownTex, gOcarinaCRightTex, gOcarinaCLeftTex, gOcarinaCUpTex,
|
||||
};
|
||||
static u16 D_8082A144[] = {
|
||||
0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC, 0xFFCC,
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "z_kaleido_scope.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
// Positions of each input section in the editor
|
||||
static u16 sSectionPositions[][2] = {
|
||||
|
@ -81,11 +82,11 @@ void KaleidoScope_DrawDebugEditorText(Gfx** gfxp) {
|
|||
void KaleidoScope_DrawDigit(GlobalContext* globalCtx, s32 digit, s32 rectLeft, s32 rectTop) {
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_debug.c", 208);
|
||||
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, D_02003040[digit], G_IM_FMT_I, G_IM_SIZ_8b, 8, 16, 0,
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gCounterDigit0Tex + (8 * 16 * digit)), G_IM_FMT_I, G_IM_SIZ_8b, 8, 16, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + 8) << 2, (rectTop + 16) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_debug.c", 220);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "z_kaleido_scope.h"
|
||||
#include "textures/icon_item_static/icon_item_static.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
static u8 sChildUpgrades[] = { UPG_BULLET_BAG, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE };
|
||||
static u8 sAdultUpgrades[] = { UPG_QUIVER, UPG_BOMB_BAG, UPG_STRENGTH, UPG_SCALE };
|
||||
|
@ -140,7 +141,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) {
|
|||
gDPPipeSync(POLY_OPA_DISP++);
|
||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->equipVtx[j], 4, 0);
|
||||
|
||||
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_02000A00[1], 32, 32, 0);
|
||||
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "z_kaleido_scope.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
u8 gAmmoItems[] = {
|
||||
ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_NONE, ITEM_NONE, ITEM_SLINGSHOT, ITEM_NONE,
|
||||
|
@ -49,7 +50,7 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
|
|||
if (i != 0) {
|
||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 27) * 4], 4, 0);
|
||||
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, D_020035C0[i], G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 0,
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gAmmoDigit0Tex + (8 * 8 * i)), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 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);
|
||||
|
||||
|
@ -58,8 +59,9 @@ void KaleidoScope_DrawAmmoCount(PauseContext* pauseCtx, GraphicsContext* gfxCtx,
|
|||
|
||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[(sAmmoVtxOffset[item] + 28) * 4], 4, 0);
|
||||
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, D_020035C0[ammo], G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 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);
|
||||
gDPLoadTextureBlock(POLY_OPA_DISP++, ((u8*)gAmmoDigit0Tex + (8 * 8 * ammo)), G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 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);
|
||||
|
||||
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
|
||||
|
||||
|
@ -75,11 +77,10 @@ void KaleidoScope_SetItemCursorVtx(PauseContext* pauseCtx) {
|
|||
KaleidoScope_SetCursorVtx(pauseCtx, pauseCtx->cursorSlot[PAUSE_ITEM] * 4, pauseCtx->itemVtx);
|
||||
}
|
||||
|
||||
static s16 sMagicArrowEffectsR[] = { 255, 100, 255 };
|
||||
static s16 sMagicArrowEffectsG[] = { 0, 100, 255 };
|
||||
static s16 sMagicArrowEffectsB[] = { 0, 255, 100 };
|
||||
|
||||
void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
||||
static s16 magicArrowEffectsR[] = { 255, 100, 255 };
|
||||
static s16 magicArrowEffectsG[] = { 0, 100, 255 };
|
||||
static s16 magicArrowEffectsB[] = { 0, 255, 100 };
|
||||
Input* input = &globalCtx->state.input[0];
|
||||
PauseContext* pauseCtx = &globalCtx->pauseCtx;
|
||||
u16 i;
|
||||
|
@ -416,7 +417,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
|||
for (i = 0, j = 24 * 4; i < 3; i++, j += 4) {
|
||||
if (gSaveContext.equips.buttonItems[i + 1] != ITEM_NONE) {
|
||||
gSPVertex(POLY_OPA_DISP++, &pauseCtx->itemVtx[j], 4, 0);
|
||||
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, D_02000A00[1], 32, 32, 0);
|
||||
POLY_OPA_DISP = KaleidoScope_QuadTextureIA8(POLY_OPA_DISP, gEquippedItemOutlineTex, 32, 32, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -430,9 +431,9 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) {
|
|||
if ((pauseCtx->unk_1E4 == 0) && (pauseCtx->pageIndex == PAUSE_ITEM) && (pauseCtx->cursorSpecialPos == 0)) {
|
||||
if ((gSlotAgeReqs[i] == 9) || (gSlotAgeReqs[i] == ((void)0, gSaveContext.linkAge))) {
|
||||
if ((sEquipState == 2) && (i == 3)) {
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, sMagicArrowEffectsR[pauseCtx->equipTargetItem - 0xBF],
|
||||
sMagicArrowEffectsG[pauseCtx->equipTargetItem - 0xBF],
|
||||
sMagicArrowEffectsB[pauseCtx->equipTargetItem - 0xBF], pauseCtx->alpha);
|
||||
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, magicArrowEffectsR[pauseCtx->equipTargetItem - 0xBF],
|
||||
magicArrowEffectsG[pauseCtx->equipTargetItem - 0xBF],
|
||||
magicArrowEffectsB[pauseCtx->equipTargetItem - 0xBF], pauseCtx->alpha);
|
||||
|
||||
pauseCtx->itemVtx[j + 0].v.ob[0] = pauseCtx->itemVtx[j + 2].v.ob[0] =
|
||||
pauseCtx->itemVtx[j + 0].v.ob[0] - 2;
|
||||
|
|
|
@ -2237,20 +2237,20 @@ void KaleidoScope_DrawGameOver(GlobalContext* globalCtx) {
|
|||
gDPSetTileSize(POLY_OPA_DISP++, 1, 0, VREG(89) & 0x7F, 252, (VREG(89) & 0x7F) + 0x7C);
|
||||
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, VREG(87) << 2, VREG(88) << 2, (VREG(87) + 64) << 2, (VREG(88) + 32) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
gDPLoadMultiBlock(POLY_OPA_DISP++, gGameOverP2Tex, 0, 0, G_IM_FMT_IA, G_IM_SIZ_8b, 64, 32, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, (VREG(87) + 64) << 2, VREG(88) << 2, (VREG(87) + 128) << 2,
|
||||
(VREG(88) + 32) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
(VREG(88) + 32) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
gDPLoadMultiBlock(POLY_OPA_DISP++, gGameOverP3Tex, 0, 0, G_IM_FMT_IA, G_IM_SIZ_8b, 64, 32, 0,
|
||||
G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD,
|
||||
G_TX_NOLOD);
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, (VREG(87) + 128) << 2, VREG(88) << 2, (VREG(87) + 192) << 2,
|
||||
(VREG(88) + 32) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
(VREG(88) + 32) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
|
||||
CLOSE_DISPS(gfxCtx, "../z_kaleido_scope_PAL.c", 3169);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "z_kaleido_scope.h"
|
||||
#include "textures/parameter_static/parameter_static.h"
|
||||
|
||||
typedef struct {
|
||||
/* 0x00 */ void* texture;
|
||||
|
@ -13,8 +14,8 @@ typedef struct {
|
|||
} PauseMapMarkInfo; // size = 0x24
|
||||
|
||||
static PauseMapMarkInfo sMapMarkInfoTable[] = {
|
||||
{ D_02002580, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1024, 1024 }, // Chest Icon
|
||||
{ D_02002900, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1024, 1024 }, // Boss Skull Icon
|
||||
{ gMapChestIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 8, 32, 32, 1 << 10, 1 << 10 },
|
||||
{ gMapBossIconTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 32, 32, 1 << 10, 1 << 10 },
|
||||
};
|
||||
|
||||
static const u32 sBaseImageSizes[] = { 0, 1, 2, 3 };
|
||||
|
|
|
@ -109,7 +109,7 @@ void Title_Draw(TitleContext* this) {
|
|||
G_TX_NOLOD);
|
||||
|
||||
gDPSetTileSize(POLY_OPA_DISP++, 1, this->uls, (this->ult & 0x7F) - idx * 4, 0, 0);
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1024, 1024);
|
||||
gSPTextureRectangle(POLY_OPA_DISP++, 388, y << 2, 1156, (y + 2) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
func_8007672C(this->state.gfxCtx, 0, 0, 0, (s16)this->coverAlpha, 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue