1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-02-24 00:25:48 +00:00

PauseContext: stickRel -> stickAdj

This commit is contained in:
Dragorn421 2022-08-29 16:47:09 +02:00
parent 739397fd39
commit d3ed4be96b
No known key found for this signature in database
GPG key ID: 32B53D2D16FC4118
7 changed files with 53 additions and 53 deletions

View file

@ -838,8 +838,8 @@ typedef struct {
/* 0x0208 */ u16 alpha;
/* 0x020A */ s16 offsetY;
/* 0x020C */ char unk_20C[0x08];
/* 0x0214 */ s16 stickRelX;
/* 0x0216 */ s16 stickRelY;
/* 0x0214 */ s16 stickAdjX;
/* 0x0216 */ s16 stickAdjY;
/* 0x0218 */ s16 cursorPoint[5]; // "cursor_point"
/* 0x0222 */ s16 cursorX[5]; // "cur_xpt"
/* 0x022C */ s16 cursorY[5]; // "cur_ypt"

View file

@ -125,7 +125,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
if (pauseCtx->cursorSpecialPos == 0) {
pauseCtx->nameColorSet = 0;
if ((pauseCtx->state != PAUSE_STATE_MAIN) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) {
if ((pauseCtx->state != PAUSE_STATE_MAIN) || ((pauseCtx->stickAdjX == 0) && (pauseCtx->stickAdjY == 0))) {
// No cursor movement
cursor = pauseCtx->cursorSlot[PAUSE_QUEST];
} else {
@ -133,7 +133,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
i = pauseCtx->cursorPoint[PAUSE_QUEST];
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
// Move cursor left
nextCursorPoint = sCursorPointLinks[i][2];
if (nextCursorPoint == CURSOR_TO_LEFT) {
@ -147,7 +147,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
nextCursorPoint = sCursorPointLinks[nextCursorPoint][2];
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
// Move cursor right
nextCursorPoint = sCursorPointLinks[i][3];
if (nextCursorPoint == CURSOR_TO_RIGHT) {
@ -163,7 +163,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
// Move cursor down
nextCursorPoint = sCursorPointLinks[i][1];
while (nextCursorPoint >= 0) {
@ -172,7 +172,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
nextCursorPoint = sCursorPointLinks[nextCursorPoint][1];
}
} else if (pauseCtx->stickRelY > 30) {
} else if (pauseCtx->stickAdjY > 30) {
// Move cursor up
nextCursorPoint = sCursorPointLinks[i][0];
while (nextCursorPoint >= 0) {
@ -273,7 +273,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
} else if (pauseCtx->mainSubState == PAUSE_MAIN_STATE_SONG_PLAYER_PLAYING) {
// Abort having the player play the song if the stick is moved
if ((pauseCtx->stickRelX != 0) || (pauseCtx->stickRelY != 0)) {
if ((pauseCtx->stickAdjX != 0) || (pauseCtx->stickAdjY != 0)) {
pauseCtx->mainSubState = PAUSE_MAIN_STATE_IDLE;
AudioOcarina_SetInstrument(OCARINA_INSTRUMENT_OFF);
@ -288,7 +288,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
// Move cursor right from the "scroll to left page" position
pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_STONE_OF_AGONY;
@ -310,7 +310,7 @@ void KaleidoScope_DrawQuestStatus(PlayState* play, GraphicsContext* gfxCtx) {
pauseCtx->cursorSlot[pauseCtx->pageIndex] = cursor;
}
} else { // cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
// Move cursor left from the "scroll to right page" position
pauseCtx->cursorPoint[PAUSE_QUEST] = QUEST_MEDALLION_FOREST;

View file

@ -110,8 +110,8 @@ void KaleidoScope_DrawDebugEditor(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_debug.c", 402);
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
Gfx_SetupDL_39Opa(play->state.gfxCtx);

View file

@ -169,7 +169,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 0;
while (cursorMoveResult == 0) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) {
pauseCtx->cursorX[PAUSE_EQUIP] -= 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1;
@ -211,7 +211,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 3;
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_EQUIP] < 3) {
pauseCtx->cursorX[PAUSE_EQUIP] += 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] += 1;
@ -259,7 +259,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
cursorMoveResult = 0;
while (cursorMoveResult == 0) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) {
pauseCtx->cursorY[PAUSE_EQUIP] -= 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4;
@ -281,7 +281,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint;
cursorMoveResult = 3;
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorY[PAUSE_EQUIP] < 3) {
pauseCtx->cursorY[PAUSE_EQUIP] += 1;
pauseCtx->cursorPoint[PAUSE_EQUIP] += 4;
@ -304,7 +304,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -352,7 +352,7 @@ void KaleidoScope_DrawEquipment(PlayState* play) {
}
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
Audio_PlaySfxGeneral(NA_SE_SY_CURSOR, &gSfxDefaultPos, 4, &gSfxDefaultFreqAndVolScale,

View file

@ -115,10 +115,10 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
pauseCtx->cursorColorSet = 4;
if (cursorItem == PAUSE_ITEM_NONE) {
pauseCtx->stickRelX = 40;
pauseCtx->stickAdjX = 40;
}
if (ABS(pauseCtx->stickRelX) > 30) {
if (ABS(pauseCtx->stickAdjX) > 30) {
cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
cursorX = pauseCtx->cursorX[PAUSE_ITEM];
cursorY = pauseCtx->cursorY[PAUSE_ITEM];
@ -130,7 +130,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {}
while (moveCursorResult == 0) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_ITEM] != 0) {
pauseCtx->cursorX[PAUSE_ITEM] -= 1;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 1;
@ -162,7 +162,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
moveCursorResult = 2;
}
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_ITEM] < 5) {
pauseCtx->cursorX[PAUSE_ITEM] += 1;
pauseCtx->cursorPoint[PAUSE_ITEM] += 1;
@ -206,7 +206,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
cursorItem, pauseCtx->cursorSpecialPos);
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -241,7 +241,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
}
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
@ -280,13 +280,13 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
if (pauseCtx->cursorSpecialPos == 0) {
if (cursorItem != PAUSE_ITEM_NONE) {
if (ABS(pauseCtx->stickRelY) > 30) {
if (ABS(pauseCtx->stickAdjY) > 30) {
moveCursorResult = 0;
cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM];
cursorY = pauseCtx->cursorY[PAUSE_ITEM];
while (moveCursorResult == 0) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorY[PAUSE_ITEM] != 0) {
pauseCtx->cursorY[PAUSE_ITEM] -= 1;
pauseCtx->cursorPoint[PAUSE_ITEM] -= 6;
@ -300,7 +300,7 @@ void KaleidoScope_DrawItemSelect(PlayState* play) {
moveCursorResult = 2;
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorY[PAUSE_ITEM] < 3) {
pauseCtx->cursorY[PAUSE_ITEM] += 1;
pauseCtx->cursorPoint[PAUSE_ITEM] += 6;

View file

@ -52,7 +52,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP];
if (pauseCtx->cursorSpecialPos == 0) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
if (pauseCtx->cursorX[PAUSE_MAP] != 0) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_RIGHT);
} else {
@ -68,7 +68,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
}
} else if (pauseCtx->stickRelX < -30) {
} else if (pauseCtx->stickAdjX < -30) {
if (pauseCtx->cursorX[PAUSE_MAP] == 0) {
KaleidoScope_MoveCursorToSpecialPos(play, PAUSE_CURSOR_PAGE_LEFT);
} else {
@ -83,7 +83,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
if (pauseCtx->cursorPoint[PAUSE_MAP] < 3) {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 0) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 1; i >= 0; i--) {
if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) {
@ -93,7 +93,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else {
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 2) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] + 1; i < 3; i++) {
if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) {
@ -105,7 +105,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else {
if (pauseCtx->stickRelY > 30) {
if (pauseCtx->stickAdjY > 30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] >= 4) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 - 1; i >= 0; i--) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
@ -116,7 +116,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
}
} else if (pauseCtx->stickRelY < -30) {
} else if (pauseCtx->stickAdjY < -30) {
if (pauseCtx->cursorPoint[PAUSE_MAP] != 10) {
for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 + 1; i < 11; i++) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
@ -139,7 +139,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
}
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot;
@ -150,7 +150,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
&gSfxDefaultFreqAndVolScale, &gSfxDefaultReverb);
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->nameDisplayTimer = 0;
pauseCtx->cursorSpecialPos = 0;
pauseCtx->cursorX[PAUSE_MAP] = 1;
@ -417,7 +417,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP];
if (pauseCtx->cursorSpecialPos == 0) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
D_8082A6D4 = 0;
do {
@ -428,7 +428,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
break;
}
} while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0);
} else if (pauseCtx->stickRelX < -30) {
} else if (pauseCtx->stickAdjX < -30) {
D_8082A6D4 = 0;
do {
@ -449,7 +449,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
} else {
pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18;
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 0;
pauseCtx->cursorSpecialPos = 0;
@ -465,7 +465,7 @@ void KaleidoScope_DrawWorldMap(PlayState* play, GraphicsContext* gfxCtx) {
D_8082A6D4 = 0;
}
} else {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11;
pauseCtx->cursorSpecialPos = 0;

View file

@ -431,7 +431,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) {
}
if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) {
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
pauseCtx->delaySwitchPageInputTimer++;
if ((pauseCtx->delaySwitchPageInputTimer >= 10) || (pauseCtx->delaySwitchPageInputTimer == 0)) {
KaleidoScope_SwitchPage(pauseCtx, 0);
@ -440,7 +440,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) {
pauseCtx->delaySwitchPageInputTimer = -1;
}
} else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) {
if (pauseCtx->stickRelX > 30) {
if (pauseCtx->stickAdjX > 30) {
pauseCtx->delaySwitchPageInputTimer++;
if ((pauseCtx->delaySwitchPageInputTimer >= 10) || (pauseCtx->delaySwitchPageInputTimer == 0)) {
KaleidoScope_SwitchPage(pauseCtx, 2);
@ -613,23 +613,23 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
}
}
if (pauseCtx->stickRelX < -30) {
if (pauseCtx->stickAdjX < -30) {
if (sStickXRepeatState == -1) {
if (--sStickXRepeatTimer < 0) {
sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
} else {
pauseCtx->stickRelX = 0;
pauseCtx->stickAdjX = 0;
}
} else {
sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
sStickXRepeatState = -1;
}
} else if (pauseCtx->stickRelX > 30) {
} else if (pauseCtx->stickAdjX > 30) {
if (sStickXRepeatState == 1) {
if (--sStickXRepeatTimer < 0) {
sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
} else {
pauseCtx->stickRelX = 0;
pauseCtx->stickAdjX = 0;
}
} else {
sStickXRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
@ -639,23 +639,23 @@ void KaleidoScope_DrawPages(PlayState* play, GraphicsContext* gfxCtx) {
sStickXRepeatState = 0;
}
if (pauseCtx->stickRelY < -30) {
if (pauseCtx->stickAdjY < -30) {
if (sStickYRepeatState == -1) {
if (--sStickYRepeatTimer < 0) {
sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
} else {
pauseCtx->stickRelY = 0;
pauseCtx->stickAdjY = 0;
}
} else {
sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
sStickYRepeatState = -1;
}
} else if (pauseCtx->stickRelY > 30) {
} else if (pauseCtx->stickAdjY > 30) {
if (sStickYRepeatState == 1) {
if (--sStickYRepeatTimer < 0) {
sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY_FIRST;
} else {
pauseCtx->stickRelY = 0;
pauseCtx->stickAdjY = 0;
}
} else {
sStickYRepeatTimer = R_PAUSE_STICK_REPEAT_DELAY;
@ -2436,8 +2436,8 @@ void KaleidoScope_Draw(PlayState* play) {
OPEN_DISPS(play->state.gfxCtx, "../z_kaleido_scope_PAL.c", 3188);
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
gSPSegment(POLY_OPA_DISP++, 0x02, interfaceCtx->parameterSegment);
gSPSegment(POLY_OPA_DISP++, 0x07, pauseCtx->playerSegment);
@ -2686,8 +2686,8 @@ void KaleidoScope_Update(PlayState* play) {
(pauseCtx->mainSubState == PAUSE_MAIN_STATE_IDLE_CURSOR_ON_SONG)) &&
(pauseCtx->state == PAUSE_STATE_MAIN)) {
pauseCtx->stickRelX = input->rel.stick_x;
pauseCtx->stickRelY = input->rel.stick_y;
pauseCtx->stickAdjX = input->rel.stick_x;
pauseCtx->stickAdjY = input->rel.stick_y;
KaleidoScope_UpdateCursorSize(play);
KaleidoScope_HandlePageToggles(pauseCtx, input);