mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-07-15 01:22:59 -07:00
Use PlayState instead of GlobalContext (#1927)
* Use PlayState instead of GlobalContext - GlobalContext -> PlayState - globalCtx -> play - GlobalCtx -> PlayState - globalContext -> playState * Find and replace Gameplay_ with Play_ * Correct some misnamed argument cases
This commit is contained in:
parent
710a768d76
commit
99260acaf1
926 changed files with 41210 additions and 41210 deletions
|
@ -17,17 +17,17 @@ s16 Left_MM_Margin = 0;
|
|||
s16 Right_MM_Margin = 0;
|
||||
s16 Bottom_MM_Margin = 0;
|
||||
|
||||
void Map_SavePlayerInitialInfo(GlobalContext* globalCtx) {
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
void Map_SavePlayerInitialInfo(PlayState* play) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
|
||||
sPlayerInitialPosX = player->actor.world.pos.x;
|
||||
sPlayerInitialPosZ = player->actor.world.pos.z;
|
||||
sPlayerInitialDirection = (s16)((0x7FFF - player->actor.shape.rot.y) / 0x400);
|
||||
}
|
||||
|
||||
void Map_SetPaletteData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_SetPaletteData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 paletteIndex = gMapData->roomPalette[mapIndex][room];
|
||||
|
||||
if (interfaceCtx->mapRoomNum == room) {
|
||||
|
@ -44,9 +44,9 @@ void Map_SetPaletteData(GlobalContext* globalCtx, s16 room) {
|
|||
interfaceCtx->mapPalette[paletteIndex * 2 + 1] = 0xBF;
|
||||
}
|
||||
|
||||
void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
||||
void Map_SetFloorPalettesData(PlayState* play, s16 floor) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 room;
|
||||
s16 i;
|
||||
|
||||
|
@ -60,7 +60,7 @@ void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
|||
interfaceCtx->mapPalette[31] = 1;
|
||||
}
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
|
@ -82,7 +82,7 @@ void Map_SetFloorPalettesData(GlobalContext* globalCtx, s16 floor) {
|
|||
for (i = 0; i < gMapData->maxPaletteCount[mapIndex]; i++) {
|
||||
room = gMapData->paletteRoom[mapIndex][floor][i];
|
||||
if ((room != 0xFF) && (gSaveContext.sceneFlags[mapIndex].rooms & gBitFlags[room])) {
|
||||
Map_SetPaletteData(globalCtx, room);
|
||||
Map_SetPaletteData(play, room);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -360,12 +360,12 @@ const char* minimapTableDangeon[] =
|
|||
gIceCavernRoom11MinimapTex,
|
||||
};
|
||||
|
||||
void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_InitData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 extendedMapIndex;
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_SPOT00:
|
||||
case SCENE_SPOT01:
|
||||
case SCENE_SPOT02:
|
||||
|
@ -387,19 +387,19 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
|||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
extendedMapIndex = mapIndex;
|
||||
if (globalCtx->sceneNum == SCENE_SPOT02) {
|
||||
if (play->sceneNum == SCENE_SPOT02) {
|
||||
if (CHECK_QUEST_ITEM(QUEST_SONG_NOCTURNE)) {
|
||||
extendedMapIndex = 0x14;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT06) {
|
||||
} else if (play->sceneNum == SCENE_SPOT06) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) {
|
||||
extendedMapIndex = 0x15;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT09) {
|
||||
} else if (play->sceneNum == SCENE_SPOT09) {
|
||||
if ((LINK_AGE_IN_YEARS == YEARS_ADULT) && !((gSaveContext.eventChkInf[9] & 0xF) == 0xF)) {
|
||||
extendedMapIndex = 0x16;
|
||||
}
|
||||
} else if (globalCtx->sceneNum == SCENE_SPOT12) {
|
||||
} else if (play->sceneNum == SCENE_SPOT12) {
|
||||
if ((gSaveContext.eventChkInf[9] & 0xF) == 0xF) {
|
||||
extendedMapIndex = 0x17;
|
||||
}
|
||||
|
@ -414,7 +414,7 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
|||
|
||||
if (sEntranceIconMapIndex < 24) {
|
||||
const char* textureName = minimapTableOW[sEntranceIconMapIndex];
|
||||
memcpy(globalCtx->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName));
|
||||
memcpy(play->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName));
|
||||
}
|
||||
|
||||
interfaceCtx->unk_258 = mapIndex;
|
||||
|
@ -442,31 +442,31 @@ void Map_InitData(GlobalContext* globalCtx, s16 room) {
|
|||
osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room,
|
||||
mapIndex, VREG(30));
|
||||
osSyncPrintf(VT_RST);
|
||||
//DmaMgr_SendRequest1(globalCtx->interfaceCtx.mapSegment,
|
||||
//DmaMgr_SendRequest1(play->interfaceCtx.mapSegment,
|
||||
//(uintptr_t)_map_i_staticSegmentRomStart +
|
||||
//((gMapData->dgnMinimapTexIndexOffset[mapIndex] + room) * 0xFF0),
|
||||
//0xFF0, __FILE__, __LINE__);
|
||||
|
||||
const char* textureName = minimapTableDangeon[gMapData->dgnMinimapTexIndexOffset[mapIndex] + room];
|
||||
memcpy(globalCtx->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName));
|
||||
memcpy(play->interfaceCtx.mapSegment, ResourceMgr_LoadTexByName(textureName), ResourceMgr_LoadTexSizeByName(textureName));
|
||||
|
||||
R_COMPASS_OFFSET_X = gMapData->roomCompassOffsetX[mapIndex][room];
|
||||
R_COMPASS_OFFSET_Y = gMapData->roomCompassOffsetY[mapIndex][room];
|
||||
Map_SetFloorPalettesData(globalCtx, VREG(30));
|
||||
Map_SetFloorPalettesData(play, VREG(30));
|
||||
osSyncPrintf("MAP 各階ONチェック\n"); // "MAP Individual Floor ON Check"
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
||||
void Map_InitRoomData(PlayState* play, s16 room) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
osSyncPrintf("*******\n*******\nroom_no=%d (%d)(%d)\n*******\n*******\n", room,
|
||||
mapIndex, globalCtx->sceneNum);
|
||||
mapIndex, play->sceneNum);
|
||||
|
||||
if (room >= 0) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
|
@ -489,11 +489,11 @@ void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
|||
osSyncPrintf("ROOM_INF=%d\n", gSaveContext.sceneFlags[mapIndex].rooms);
|
||||
interfaceCtx->mapRoomNum = room;
|
||||
interfaceCtx->unk_25A = mapIndex;
|
||||
Map_SetPaletteData(globalCtx, room);
|
||||
Map_SetPaletteData(play, room);
|
||||
osSyncPrintf(VT_FGCOL(YELLOW));
|
||||
osSyncPrintf("部屋部屋=%d\n", room); // "Room Room = %d"
|
||||
osSyncPrintf(VT_RST);
|
||||
Map_InitData(globalCtx, room);
|
||||
Map_InitData(play, room);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
@ -505,27 +505,27 @@ void Map_InitRoomData(GlobalContext* globalCtx, s16 room) {
|
|||
}
|
||||
}
|
||||
|
||||
void Map_Destroy(GlobalContext* globalCtx) {
|
||||
MapMark_ClearPointers(globalCtx);
|
||||
void Map_Destroy(PlayState* play) {
|
||||
MapMark_ClearPointers(play);
|
||||
gMapData = NULL;
|
||||
}
|
||||
|
||||
void Map_Init(GlobalContext* globalCtx) {
|
||||
void Map_Init(PlayState* play) {
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
gMapData = &gMapDataTable;
|
||||
|
||||
interfaceCtx->unk_258 = -1;
|
||||
interfaceCtx->unk_25A = -1;
|
||||
|
||||
interfaceCtx->mapSegment = GAMESTATE_ALLOC_MC(&globalCtx->state, 0x1000);
|
||||
interfaceCtx->mapSegment = GAMESTATE_ALLOC_MC(&play->state, 0x1000);
|
||||
// "MAP texture initialization scene_data_ID=%d mapSegment=%x"
|
||||
osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", globalCtx->sceneNum,
|
||||
interfaceCtx->mapSegment, globalCtx);
|
||||
osSyncPrintf("\n\n\nMAP テクスチャ初期化 scene_data_ID=%d\nmapSegment=%x\n\n", play->sceneNum,
|
||||
interfaceCtx->mapSegment, play);
|
||||
ASSERT(interfaceCtx->mapSegment != NULL);
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_SPOT00:
|
||||
case SCENE_SPOT01:
|
||||
case SCENE_SPOT02:
|
||||
|
@ -546,13 +546,13 @@ void Map_Init(GlobalContext* globalCtx) {
|
|||
case SCENE_SPOT18:
|
||||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
mapIndex = globalCtx->sceneNum - SCENE_SPOT00;
|
||||
mapIndex = play->sceneNum - SCENE_SPOT00;
|
||||
R_MAP_INDEX = gSaveContext.mapIndex = mapIndex;
|
||||
R_COMPASS_SCALE_X = gMapData->owCompassInfo[mapIndex][0];
|
||||
R_COMPASS_SCALE_Y = gMapData->owCompassInfo[mapIndex][1];
|
||||
R_COMPASS_OFFSET_X = gMapData->owCompassInfo[mapIndex][2];
|
||||
R_COMPASS_OFFSET_Y = gMapData->owCompassInfo[mapIndex][3];
|
||||
Map_InitData(globalCtx, mapIndex);
|
||||
Map_InitData(play, mapIndex);
|
||||
R_OW_MINIMAP_X = gMapData->owMinimapPosX[mapIndex];
|
||||
R_OW_MINIMAP_Y = gMapData->owMinimapPosY[mapIndex];
|
||||
break;
|
||||
|
@ -582,24 +582,24 @@ void Map_Init(GlobalContext* globalCtx) {
|
|||
case SCENE_JYASINBOSS:
|
||||
case SCENE_HAKADAN_BS:
|
||||
mapIndex =
|
||||
(globalCtx->sceneNum >= SCENE_YDAN_BOSS) ? globalCtx->sceneNum - SCENE_YDAN_BOSS : globalCtx->sceneNum;
|
||||
(play->sceneNum >= SCENE_YDAN_BOSS) ? play->sceneNum - SCENE_YDAN_BOSS : play->sceneNum;
|
||||
R_MAP_INDEX = gSaveContext.mapIndex = mapIndex;
|
||||
if ((globalCtx->sceneNum <= SCENE_ICE_DOUKUTO) || (globalCtx->sceneNum >= SCENE_YDAN_BOSS)) {
|
||||
if ((play->sceneNum <= SCENE_ICE_DOUKUTO) || (play->sceneNum >= SCENE_YDAN_BOSS)) {
|
||||
R_COMPASS_SCALE_X = gMapData->dgnCompassInfo[mapIndex][0];
|
||||
R_COMPASS_SCALE_Y = gMapData->dgnCompassInfo[mapIndex][1];
|
||||
R_COMPASS_OFFSET_X = gMapData->dgnCompassInfo[mapIndex][2];
|
||||
R_COMPASS_OFFSET_Y = gMapData->dgnCompassInfo[mapIndex][3];
|
||||
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE = gMapData->dgnMinimapTexIndexBase[mapIndex];
|
||||
Map_InitRoomData(globalCtx, globalCtx->roomCtx.curRoom.num);
|
||||
MapMark_Init(globalCtx);
|
||||
Map_InitRoomData(play, play->roomCtx.curRoom.num);
|
||||
MapMark_Init(play);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
||||
void Minimap_DrawCompassIcons(PlayState* play) {
|
||||
s32 pad;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
s16 tempX, tempZ;
|
||||
const Color_RGB8 LastEntrance_arrow = { 200, 0, 0 };
|
||||
const Color_RGB8 CurrentPosition_arrow = { 200, 255, 0 };
|
||||
|
@ -613,10 +613,10 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
|||
Y_Margins_Minimap = 0;
|
||||
}
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
if (globalCtx->interfaceCtx.minimapAlpha >= 0xAA) {
|
||||
func_80094A14(globalCtx->state.gfxCtx);
|
||||
if (play->interfaceCtx.minimapAlpha >= 0xAA) {
|
||||
func_80094A14(play->state.gfxCtx);
|
||||
|
||||
//Player current position (yellow arrow)
|
||||
gSPMatrix(OVERLAY_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
@ -656,7 +656,7 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
|||
Matrix_RotateX(-1.6f, MTXMODE_APPLY);
|
||||
tempX = (0x7FFF - player->actor.shape.rot.y) / 0x400;
|
||||
Matrix_RotateY(tempX / 10.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||
|
@ -697,7 +697,7 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
|||
Matrix_Scale(VREG(9) / 100.0f, VREG(9) / 100.0f, VREG(9) / 100.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateX(VREG(52) / 10.0f, MTXMODE_APPLY);
|
||||
Matrix_RotateY(sPlayerInitialDirection / 10.0f, MTXMODE_APPLY);
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
||||
gSPMatrix(OVERLAY_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if (CVar_GetS32("gHudColors", 1) == 2) {
|
||||
|
@ -708,24 +708,24 @@ void Minimap_DrawCompassIcons(GlobalContext* globalCtx) {
|
|||
gSPDisplayList(OVERLAY_DISP++, gCompassArrowDL);
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void Minimap_Draw(GlobalContext* globalCtx) {
|
||||
void Minimap_Draw(PlayState* play) {
|
||||
s32 pad[2];
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
const Color_RGB8 Dungeon_minimap = {100, 255, 255};
|
||||
const Color_RGB8 Overworld_minimap = {R_MINIMAP_COLOR(0), R_MINIMAP_COLOR(1), R_MINIMAP_COLOR(2)};
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
// If any of these CVars are enabled, disable toggling the minimap with L, unless gEnableMapToggle is set
|
||||
bool enableMapToggle =
|
||||
!(CVar_GetS32("gDebugEnabled", 0) || CVar_GetS32("gMoonJumpOnL", 0) || CVar_GetS32("gTurboOnL", 0)) ||
|
||||
CVar_GetS32("gEnableMapToggle", 0);
|
||||
|
||||
if (globalCtx->pauseCtx.state < 4) {
|
||||
if (play->pauseCtx.state < 4) {
|
||||
//Minimap margins
|
||||
s16 X_Margins_Minimap;
|
||||
s16 Y_Margins_Minimap;
|
||||
|
@ -737,7 +737,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
Y_Margins_Minimap = 0;
|
||||
}
|
||||
|
||||
switch (globalCtx->sceneNum) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
|
@ -749,7 +749,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
case SCENE_HAKADANCH:
|
||||
case SCENE_ICE_DOUKUTO:
|
||||
if (!R_MINIMAP_DISABLED) {
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
func_80094520(play->state.gfxCtx);
|
||||
gDPSetCombineLERP(OVERLAY_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
|
||||
TEXEL0, 0, PRIMITIVE, 0);
|
||||
|
||||
|
@ -787,14 +787,14 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, mapIndex)) {
|
||||
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
MapMark_Draw(globalCtx);
|
||||
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
|
||||
func_80094520(play->state.gfxCtx);
|
||||
MapMark_Draw(play);
|
||||
}
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
|
||||
osSyncPrintf("Game_play_demo_mode_check=%d\n", Gameplay_InCsMode(globalCtx));
|
||||
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play) && enableMapToggle) {
|
||||
osSyncPrintf("Game_play_demo_mode_check=%d\n", Play_InCsMode(play));
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
|
||||
&D_801333E0, &D_801333E0, &D_801333E8); }
|
||||
|
@ -826,7 +826,7 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
case SCENE_SPOT20:
|
||||
case SCENE_GANON_TOU:
|
||||
if (!R_MINIMAP_DISABLED) {
|
||||
func_80094520(globalCtx->state.gfxCtx);
|
||||
func_80094520(play->state.gfxCtx);
|
||||
|
||||
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
|
||||
if (CVar_GetS32("gHudColors", 1) == 2) {//Overworld minimap
|
||||
|
@ -865,8 +865,8 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, Overworld_minimap.r, Overworld_minimap.g, Overworld_minimap.b, interfaceCtx->minimapAlpha);
|
||||
}
|
||||
|
||||
if (((globalCtx->sceneNum != SCENE_SPOT01) && (globalCtx->sceneNum != SCENE_SPOT04) &&
|
||||
(globalCtx->sceneNum != SCENE_SPOT08)) ||
|
||||
if (((play->sceneNum != SCENE_SPOT01) && (play->sceneNum != SCENE_SPOT04) &&
|
||||
(play->sceneNum != SCENE_SPOT08)) ||
|
||||
(LINK_AGE_IN_YEARS != YEARS_ADULT)) {
|
||||
bool Map0 = gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2 == 0;
|
||||
s16 IconSize = 8;
|
||||
|
@ -941,13 +941,13 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) {
|
||||
if ((play->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) {
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 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);
|
||||
gSPWideTextureRectangle(OVERLAY_DISP++, entranceX << 2, entranceY << 2, (entranceX + 32) << 2, (entranceY + 8) << 2,
|
||||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
} else if ((globalCtx->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){
|
||||
} else if ((play->sceneNum == SCENE_SPOT08) && CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){
|
||||
|
||||
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, 8,
|
||||
8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
|
||||
|
@ -957,10 +957,10 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
|
||||
}
|
||||
|
||||
Minimap_DrawCompassIcons(globalCtx); // Draw icons for the player spawn and current position
|
||||
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
|
||||
}
|
||||
|
||||
if (CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_L) && !Gameplay_InCsMode(globalCtx) && enableMapToggle) {
|
||||
if (CHECK_BTN_ALL(play->state.input[0].press.button, BTN_L) && !Play_InCsMode(play) && enableMapToggle) {
|
||||
// clang-format off
|
||||
if (!R_MINIMAP_DISABLED) { Audio_PlaySoundGeneral(NA_SE_SY_CAMERA_ZOOM_UP, &D_801333D4, 4,
|
||||
&D_801333E0, &D_801333E0, &D_801333E8); }
|
||||
|
@ -974,18 +974,18 @@ void Minimap_Draw(GlobalContext* globalCtx) {
|
|||
}
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
s16 Map_GetFloorTextIndexOffset(s32 mapIndex, s32 floor) {
|
||||
return gMapData->floorTexIndexOffset[mapIndex][floor];
|
||||
}
|
||||
|
||||
void Map_Update(GlobalContext* globalCtx) {
|
||||
void Map_Update(PlayState* play) {
|
||||
static s16 sLastRoomNum = 99;
|
||||
Player* player = GET_PLAYER(globalCtx);
|
||||
Player* player = GET_PLAYER(play);
|
||||
s32 mapIndex = gSaveContext.mapIndex;
|
||||
InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx;
|
||||
InterfaceContext* interfaceCtx = &play->interfaceCtx;
|
||||
s16 floor;
|
||||
s16 i;
|
||||
|
||||
|
@ -994,8 +994,8 @@ void Map_Update(GlobalContext* globalCtx) {
|
|||
Right_MM_Margin = CVar_GetS32("gHUDMargin_R", 0);
|
||||
Bottom_MM_Margin = CVar_GetS32("gHUDMargin_B", 0);
|
||||
|
||||
if ((globalCtx->pauseCtx.state == 0) && (globalCtx->pauseCtx.debugState == 0)) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
if ((play->pauseCtx.state == 0) && (play->pauseCtx.debugState == 0)) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
|
@ -1040,9 +1040,9 @@ void Map_Update(GlobalContext* globalCtx) {
|
|||
// "Layer switching = %x"
|
||||
osSyncPrintf("階層切替=%x\n", interfaceCtx->mapRoomNum);
|
||||
osSyncPrintf(VT_RST);
|
||||
Map_InitData(globalCtx, interfaceCtx->mapRoomNum);
|
||||
Map_InitData(play, interfaceCtx->mapRoomNum);
|
||||
gSaveContext.sunsSongState = SUNSSONG_INACTIVE;
|
||||
Map_SavePlayerInitialInfo(globalCtx);
|
||||
Map_SavePlayerInitialInfo(play);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1056,9 +1056,9 @@ void Map_Update(GlobalContext* globalCtx) {
|
|||
case SCENE_MIZUSIN_BS:
|
||||
case SCENE_JYASINBOSS:
|
||||
case SCENE_HAKADAN_BS:
|
||||
VREG(30) = gMapData->bossFloor[globalCtx->sceneNum - SCENE_YDAN_BOSS];
|
||||
VREG(30) = gMapData->bossFloor[play->sceneNum - SCENE_YDAN_BOSS];
|
||||
R_MAP_TEX_INDEX = R_MAP_TEX_INDEX_BASE +
|
||||
gMapData->floorTexIndexOffset[globalCtx->sceneNum - SCENE_YDAN_BOSS][VREG(30)];
|
||||
gMapData->floorTexIndexOffset[play->sceneNum - SCENE_YDAN_BOSS][VREG(30)];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue