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:
@@ -54,11 +54,11 @@ static MapMarkInfo sMapMarkInfoTable[] = {
|
||||
|
||||
MapMarkData** sLoadedMarkDataTable;
|
||||
|
||||
void MapMark_Init(GlobalContext* globalCtx) {
|
||||
void MapMark_Init(PlayState* play) {
|
||||
//MapMarkDataOverlay* overlay = &sMapMarkDataOvl;
|
||||
//u32 overlaySize = (uintptr_t)overlay->vramEnd - (uintptr_t)overlay->vramStart;
|
||||
|
||||
//overlay->loadedRamAddr = GAMESTATE_ALLOC_MC(&globalCtx->state, overlaySize);
|
||||
//overlay->loadedRamAddr = GAMESTATE_ALLOC_MC(&play->state, overlaySize);
|
||||
//LOG_CHECK_NULL_POINTER("dlftbl->allocp", overlay->loadedRamAddr);
|
||||
|
||||
//Overlay_Load(overlay->vromStart, overlay->vromEnd, overlay->vramStart, overlay->vramEnd, overlay->loadedRamAddr);
|
||||
@@ -75,12 +75,12 @@ void MapMark_Init(GlobalContext* globalCtx) {
|
||||
//: NULL);
|
||||
}
|
||||
|
||||
void MapMark_ClearPointers(GlobalContext* globalCtx) {
|
||||
void MapMark_ClearPointers(PlayState* play) {
|
||||
//sMapMarkDataOvl.loadedRamAddr = NULL;
|
||||
sLoadedMarkDataTable = NULL;
|
||||
}
|
||||
|
||||
void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
void MapMark_DrawForDungeon(PlayState* play) {
|
||||
InterfaceContext* interfaceCtx;
|
||||
MapMarkIconData* mapMarkIconData;
|
||||
MapMarkPoint* markPoint;
|
||||
@@ -90,18 +90,18 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
s32 rectLeft;
|
||||
s32 rectTop;
|
||||
|
||||
interfaceCtx = &globalCtx->interfaceCtx;
|
||||
interfaceCtx = &play->interfaceCtx;
|
||||
|
||||
if ((gMapData != NULL) && (globalCtx->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
|
||||
if ((gMapData != NULL) && (play->interfaceCtx.mapRoomNum >= gMapData->dgnMinimapCount[dungeon])) {
|
||||
// "Room number exceeded, yikes %d/%d MapMarkDraw processing interrupted"
|
||||
osSyncPrintf(VT_COL(RED, WHITE) "部屋番号がオーバーしてるで,ヤバイで %d/%d \nMapMarkDraw の処理を中断します\n",
|
||||
VT_RST, globalCtx->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
|
||||
VT_RST, play->interfaceCtx.mapRoomNum, gMapData->dgnMinimapCount[dungeon]);
|
||||
return;
|
||||
}
|
||||
|
||||
mapMarkIconData = &sLoadedMarkDataTable[dungeon][interfaceCtx->mapRoomNum][0];
|
||||
|
||||
OPEN_DISPS(globalCtx->state.gfxCtx);
|
||||
OPEN_DISPS(play->state.gfxCtx);
|
||||
|
||||
while (true) {
|
||||
if (mapMarkIconData->markType == MAP_MARK_NONE) {
|
||||
@@ -131,7 +131,7 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
markPoint = &mapMarkIconData->points[0];
|
||||
//Place each chest / boss room icon
|
||||
for (i = 0; i < mapMarkIconData->count; i++) {
|
||||
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(globalCtx, markPoint->chestFlag)) {
|
||||
if ((mapMarkIconData->markType != MAP_MARK_CHEST) || !Flags_GetTreasure(play, markPoint->chestFlag)) {
|
||||
//Minimap chest / boss icon
|
||||
const s32 PosX_Minimap_ori = GREG(94) + OTRGetRectDimensionFromRightEdge(markPoint->x+X_Margins_Minimap_ic) + 204;
|
||||
const s32 PosY_Minimap_ori = GREG(95) + markPoint->y + Y_Margins_Minimap_ic + 140;
|
||||
@@ -139,10 +139,10 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 + CVar_GetS32("gMinimapPosY", 0));
|
||||
if (CVar_GetS32("gMinimapPosType", 0) == 1) {//Anchor Left
|
||||
if (CVar_GetS32("gMinimapUseMargins", 0) != 0) {X_Margins_Minimap_ic = Left_MC_Margin;};
|
||||
if (globalCtx->sceneNum == SCENE_YDAN || globalCtx->sceneNum == SCENE_DDAN || globalCtx->sceneNum == SCENE_BDAN ||
|
||||
globalCtx->sceneNum == SCENE_BMORI1 || globalCtx->sceneNum == SCENE_HIDAN || globalCtx->sceneNum == SCENE_MIZUSIN ||
|
||||
globalCtx->sceneNum == SCENE_JYASINZOU || globalCtx->sceneNum == SCENE_HAKADAN || globalCtx->sceneNum == SCENE_HAKADANCH ||
|
||||
globalCtx->sceneNum == SCENE_ICE_DOUKUTO) {
|
||||
if (play->sceneNum == SCENE_YDAN || play->sceneNum == SCENE_DDAN || play->sceneNum == SCENE_BDAN ||
|
||||
play->sceneNum == SCENE_BMORI1 || play->sceneNum == SCENE_HIDAN || play->sceneNum == SCENE_MIZUSIN ||
|
||||
play->sceneNum == SCENE_JYASINZOU || play->sceneNum == SCENE_HAKADAN || play->sceneNum == SCENE_HAKADANCH ||
|
||||
play->sceneNum == SCENE_ICE_DOUKUTO) {
|
||||
rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic);
|
||||
} else {
|
||||
rectLeft = OTRGetRectDimensionFromLeftEdge(markPoint->x+CVar_GetS32("gMinimapPosX", 0)+204+X_Margins_Minimap_ic);
|
||||
@@ -183,11 +183,11 @@ void MapMark_DrawForDungeon(GlobalContext* globalCtx) {
|
||||
mapMarkIconData++;
|
||||
}
|
||||
|
||||
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
switch (globalCtx->sceneNum) {
|
||||
void MapMark_Draw(PlayState* play) {
|
||||
switch (play->sceneNum) {
|
||||
case SCENE_YDAN:
|
||||
case SCENE_DDAN:
|
||||
case SCENE_BDAN:
|
||||
@@ -203,7 +203,7 @@ void MapMark_Draw(GlobalContext* globalCtx) {
|
||||
case SCENE_BDAN_BOSS:
|
||||
case SCENE_MORIBOSSROOM:
|
||||
case SCENE_FIRE_BS:
|
||||
MapMark_DrawForDungeon(globalCtx);
|
||||
MapMark_DrawForDungeon(play);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user