This commit is contained in:
rozlette 2025-05-22 01:52:19 -05:00
commit ec738d0645
22 changed files with 4068 additions and 2620 deletions

View file

@ -514,7 +514,8 @@ ActorDB::Entry& ActorDB::AddEntry(const std::string& name, const std::string& de
return entry;
}
// Adds an actor with the new ActorDBInit struct. The id assigned to the actor is dynamic. Use the returned Entry or RetrieveId to get it.
// Adds an actor with the new ActorDBInit struct. The id assigned to the actor is dynamic. Use the returned Entry or
// RetrieveId to get it.
ActorDB::Entry& ActorDB::AddEntry(const ActorDBInit& init) {
Entry& entry = AddEntry(init.name, init.desc, nextFreeId);

View file

@ -858,20 +858,18 @@ void RandomizerOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_l
*should = !Flags_GetRandomizerInf(RAND_INF_DARUNIAS_JOY);
break;
case VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS:
*should =
LINK_IS_ADULT &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId == SCENE_TEMPLE_OF_TIME) &&
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
MeetsLACSRequirements();
*should = LINK_IS_ADULT &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId ==
SCENE_TEMPLE_OF_TIME) &&
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
MeetsLACSRequirements();
break;
case VB_BE_ELIGIBLE_FOR_NOCTURNE_OF_SHADOW:
*should =
!Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) &&
LINK_IS_ADULT &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId == SCENE_KAKARIKO_VILLAGE) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER);
*should = !Flags_GetEventChkInf(EVENTCHKINF_BONGO_BONGO_ESCAPED_FROM_WELL) && LINK_IS_ADULT &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId ==
SCENE_KAKARIKO_VILLAGE) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_FOREST) && CHECK_QUEST_ITEM(QUEST_MEDALLION_FIRE) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER);
break;
case VB_BE_ELIGIBLE_FOR_CHILD_ROLLING_GORON_REWARD: {
// Don't require a bomb bag to get prize in rando

View file

@ -2027,80 +2027,80 @@ void Logic::InitSaveContext() {
}
mSaveContext->equips.equipment = 0;
// Inventory
size_t numScenes = SceneDB::Instance->GetNumEntries();
for (int item = 0; item < ARRAY_COUNT(mSaveContext->inventory.items); item++) {
mSaveContext->inventory.items[item] = ITEM_NONE;
}
for (int ammo = 0; ammo < ARRAY_COUNT(mSaveContext->inventory.ammo); ammo++) {
mSaveContext->inventory.ammo[ammo] = 0;
}
mSaveContext->inventory.equipment = 0;
mSaveContext->inventory.upgrades = 0;
mSaveContext->inventory.questItems = 0;
for (int dungeon = 0; dungeon < numScenes; dungeon++) {
mSaveContext->inventory.dungeonItems[dungeon] = 0;
}
for (int dungeon = 0; dungeon < numScenes; dungeon++) {
mSaveContext->inventory.dungeonKeys[dungeon] = 0x0;
}
mSaveContext->inventory.defenseHearts = 0;
mSaveContext->inventory.gsTokens = 0;
for (int scene = 0; scene < numScenes; scene++) {
mSaveContext->sceneFlags[scene].chest = 0;
mSaveContext->sceneFlags[scene].swch = 0;
mSaveContext->sceneFlags[scene].clear = 0;
mSaveContext->sceneFlags[scene].collect = 0;
mSaveContext->sceneFlags[scene].unk = 0;
mSaveContext->sceneFlags[scene].rooms = 0;
mSaveContext->sceneFlags[scene].floors = 0;
}
mSaveContext->fw.pos.x = 0;
mSaveContext->fw.pos.y = 0;
mSaveContext->fw.pos.z = 0;
mSaveContext->fw.yaw = 0;
mSaveContext->fw.playerParams = 0;
mSaveContext->fw.entranceIndex = 0;
mSaveContext->fw.roomIndex = 0;
mSaveContext->fw.set = 0;
mSaveContext->fw.tempSwchFlags = 0;
mSaveContext->fw.tempCollectFlags = 0;
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->gsFlags); flag++) {
mSaveContext->gsFlags[flag] = 0;
}
for (int highscore = 0; highscore < ARRAY_COUNT(mSaveContext->highScores); highscore++) {
mSaveContext->highScores[highscore] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->eventChkInf); flag++) {
mSaveContext->eventChkInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->itemGetInf); flag++) {
mSaveContext->itemGetInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->infTable); flag++) {
mSaveContext->infTable[flag] = 0;
}
mSaveContext->worldMapAreaData = 0;
mSaveContext->scarecrowLongSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(mSaveContext->scarecrowLongSong); i++) {
mSaveContext->scarecrowLongSong[i].noteIdx = 0;
mSaveContext->scarecrowLongSong[i].unk_01 = 0;
mSaveContext->scarecrowLongSong[i].unk_02 = 0;
mSaveContext->scarecrowLongSong[i].volume = 0;
mSaveContext->scarecrowLongSong[i].vibrato = 0;
mSaveContext->scarecrowLongSong[i].tone = 0;
mSaveContext->scarecrowLongSong[i].semitone = 0;
}
mSaveContext->scarecrowSpawnSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(mSaveContext->scarecrowSpawnSong); i++) {
mSaveContext->scarecrowSpawnSong[i].noteIdx = 0;
mSaveContext->scarecrowSpawnSong[i].unk_01 = 0;
mSaveContext->scarecrowSpawnSong[i].unk_02 = 0;
mSaveContext->scarecrowSpawnSong[i].volume = 0;
mSaveContext->scarecrowSpawnSong[i].vibrato = 0;
mSaveContext->scarecrowSpawnSong[i].tone = 0;
mSaveContext->scarecrowSpawnSong[i].semitone = 0;
}
// Inventory
size_t numScenes = SceneDB::Instance->GetNumEntries();
for (int item = 0; item < ARRAY_COUNT(mSaveContext->inventory.items); item++) {
mSaveContext->inventory.items[item] = ITEM_NONE;
}
for (int ammo = 0; ammo < ARRAY_COUNT(mSaveContext->inventory.ammo); ammo++) {
mSaveContext->inventory.ammo[ammo] = 0;
}
mSaveContext->inventory.equipment = 0;
mSaveContext->inventory.upgrades = 0;
mSaveContext->inventory.questItems = 0;
for (int dungeon = 0; dungeon < numScenes; dungeon++) {
mSaveContext->inventory.dungeonItems[dungeon] = 0;
}
for (int dungeon = 0; dungeon < numScenes; dungeon++) {
mSaveContext->inventory.dungeonKeys[dungeon] = 0x0;
}
mSaveContext->inventory.defenseHearts = 0;
mSaveContext->inventory.gsTokens = 0;
for (int scene = 0; scene < numScenes; scene++) {
mSaveContext->sceneFlags[scene].chest = 0;
mSaveContext->sceneFlags[scene].swch = 0;
mSaveContext->sceneFlags[scene].clear = 0;
mSaveContext->sceneFlags[scene].collect = 0;
mSaveContext->sceneFlags[scene].unk = 0;
mSaveContext->sceneFlags[scene].rooms = 0;
mSaveContext->sceneFlags[scene].floors = 0;
}
mSaveContext->fw.pos.x = 0;
mSaveContext->fw.pos.y = 0;
mSaveContext->fw.pos.z = 0;
mSaveContext->fw.yaw = 0;
mSaveContext->fw.playerParams = 0;
mSaveContext->fw.entranceIndex = 0;
mSaveContext->fw.roomIndex = 0;
mSaveContext->fw.set = 0;
mSaveContext->fw.tempSwchFlags = 0;
mSaveContext->fw.tempCollectFlags = 0;
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->gsFlags); flag++) {
mSaveContext->gsFlags[flag] = 0;
}
for (int highscore = 0; highscore < ARRAY_COUNT(mSaveContext->highScores); highscore++) {
mSaveContext->highScores[highscore] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->eventChkInf); flag++) {
mSaveContext->eventChkInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->itemGetInf); flag++) {
mSaveContext->itemGetInf[flag] = 0;
}
for (int flag = 0; flag < ARRAY_COUNT(mSaveContext->infTable); flag++) {
mSaveContext->infTable[flag] = 0;
}
mSaveContext->worldMapAreaData = 0;
mSaveContext->scarecrowLongSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(mSaveContext->scarecrowLongSong); i++) {
mSaveContext->scarecrowLongSong[i].noteIdx = 0;
mSaveContext->scarecrowLongSong[i].unk_01 = 0;
mSaveContext->scarecrowLongSong[i].unk_02 = 0;
mSaveContext->scarecrowLongSong[i].volume = 0;
mSaveContext->scarecrowLongSong[i].vibrato = 0;
mSaveContext->scarecrowLongSong[i].tone = 0;
mSaveContext->scarecrowLongSong[i].semitone = 0;
}
mSaveContext->scarecrowSpawnSongSet = 0;
for (int i = 0; i < ARRAY_COUNT(mSaveContext->scarecrowSpawnSong); i++) {
mSaveContext->scarecrowSpawnSong[i].noteIdx = 0;
mSaveContext->scarecrowSpawnSong[i].unk_01 = 0;
mSaveContext->scarecrowSpawnSong[i].unk_02 = 0;
mSaveContext->scarecrowSpawnSong[i].volume = 0;
mSaveContext->scarecrowSpawnSong[i].vibrato = 0;
mSaveContext->scarecrowSpawnSong[i].tone = 0;
mSaveContext->scarecrowSpawnSong[i].semitone = 0;
}
mSaveContext->horseData.scene = SCENE_HYRULE_FIELD;
mSaveContext->horseData.pos.x = -1840;
@ -2123,20 +2123,20 @@ void Logic::InitSaveContext() {
// RANDOTODO (ADD ITEMLOCATIONS TO GSAVECONTEXT)
}
void Logic::NewSaveContext() {
if (mSaveContext != nullptr && mSaveContext != &gSaveContext) {
delete[] mSaveContext->inventory.dungeonItems;
delete[] mSaveContext->inventory.dungeonKeys;
delete[] mSaveContext->sceneFlags;
delete mSaveContext;
}
size_t numScenes = SceneDB::Instance->GetNumEntries();
mSaveContext = new SaveContext();
mSaveContext->inventory.dungeonItems = new u8[numScenes];
mSaveContext->inventory.dungeonKeys = new s8[numScenes];
mSaveContext->sceneFlags = new SavedSceneFlags[numScenes];
InitSaveContext();
void Logic::NewSaveContext() {
if (mSaveContext != nullptr && mSaveContext != &gSaveContext) {
delete[] mSaveContext->inventory.dungeonItems;
delete[] mSaveContext->inventory.dungeonKeys;
delete[] mSaveContext->sceneFlags;
delete mSaveContext;
}
size_t numScenes = SceneDB::Instance->GetNumEntries();
mSaveContext = new SaveContext();
mSaveContext->inventory.dungeonItems = new u8[numScenes];
mSaveContext->inventory.dungeonKeys = new s8[numScenes];
mSaveContext->sceneFlags = new SavedSceneFlags[numScenes];
InitSaveContext();
}
uint8_t Logic::InventorySlot(uint32_t item) {
return gItemSlots[item];

View file

@ -182,9 +182,9 @@ void TimeSaverOnVanillaBehaviorHandler(GIVanillaBehavior id, bool* should, va_li
// LACS
u8 meetsLACSRequirements =
LINK_IS_ADULT &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId == SCENE_TEMPLE_OF_TIME) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
(EntranceDB::Instance->RetrieveEntry(gSaveContext.entranceIndex).entry.sceneId ==
SCENE_TEMPLE_OF_TIME) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);
if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, meetsLACSRequirements)) {
Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);

View file

@ -1173,9 +1173,9 @@ void SaveManager::AllocateSceneData() {
size_t numScenes = SceneDB::Instance->GetNumEntries();
gSaveContext.inventory.dungeonItems = new u8[numScenes];
gSaveContext.inventory.dungeonKeys = new s8[numScenes];
gSaveContext.sceneFlags = new SavedSceneFlags[numScenes];
gSaveContext.inventory.dungeonItems = new u8[numScenes];
gSaveContext.inventory.dungeonKeys = new s8[numScenes];
gSaveContext.sceneFlags = new SavedSceneFlags[numScenes];
std::fill_n(gSaveContext.inventory.dungeonItems, numScenes, 0);
std::fill_n(gSaveContext.inventory.dungeonKeys, numScenes, -1);
@ -2254,9 +2254,8 @@ void SaveManager::LoadBaseVersion5() {
SaveManager::Instance->LoadData("totalDays", gSaveContext.totalDays);
SaveManager::Instance->LoadData("bgsDayCount", gSaveContext.bgsDayCount);
SaveManager::Instance->LoadData("deaths", gSaveContext.deaths);
SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.playerName[i]);
});
SaveManager::Instance->LoadArray("playerName", ARRAY_COUNT(gSaveContext.playerName),
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.playerName[i]); });
int isRando = 0;
SaveManager::Instance->LoadData("n64ddFlag", isRando);
if (isRando) {
@ -2275,25 +2274,29 @@ void SaveManager::LoadBaseVersion5() {
SaveManager::Instance->LoadData("bgsFlag", gSaveContext.bgsFlag);
SaveManager::Instance->LoadData("ocarinaGameRoundNum", gSaveContext.ocarinaGameRoundNum);
SaveManager::Instance->LoadStruct("childEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadArray(
"buttonItems", ARRAY_COUNT(gSaveContext.childEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray(
"cButtonSlots", ARRAY_COUNT(gSaveContext.childEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.childEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.childEquips.equipment);
});
SaveManager::Instance->LoadStruct("adultEquips", []() {
SaveManager::Instance->LoadArray("buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray("cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadArray(
"buttonItems", ARRAY_COUNT(gSaveContext.adultEquips.buttonItems), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.buttonItems[i],
static_cast<uint8_t>(ITEM_NONE));
});
SaveManager::Instance->LoadArray(
"cButtonSlots", ARRAY_COUNT(gSaveContext.adultEquips.cButtonSlots), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.adultEquips.cButtonSlots[i],
static_cast<uint8_t>(SLOT_NONE));
});
SaveManager::Instance->LoadData("equipment", gSaveContext.adultEquips.equipment);
});
SaveManager::Instance->LoadData("unk_54", gSaveContext.unk_54);
@ -2350,21 +2353,17 @@ void SaveManager::LoadBaseVersion5() {
SaveManager::Instance->LoadData("tempSwchFlags", gSaveContext.fw.tempSwchFlags);
SaveManager::Instance->LoadData("tempCollectFlags", gSaveContext.fw.tempCollectFlags);
});
SaveManager::Instance->LoadArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.gsFlags[i]);
});
SaveManager::Instance->LoadArray("highScores", ARRAY_COUNT(gSaveContext.highScores), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.highScores[i]);
});
SaveManager::Instance->LoadArray("gsFlags", ARRAY_COUNT(gSaveContext.gsFlags),
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.gsFlags[i]); });
SaveManager::Instance->LoadArray("highScores", ARRAY_COUNT(gSaveContext.highScores),
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.highScores[i]); });
SaveManager::Instance->LoadArray("eventChkInf", ARRAY_COUNT(gSaveContext.eventChkInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.eventChkInf[i]);
});
SaveManager::Instance->LoadArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.itemGetInf[i]);
});
SaveManager::Instance->LoadArray("infTable", ARRAY_COUNT(gSaveContext.infTable), [](size_t i) {
SaveManager::Instance->LoadData("", gSaveContext.infTable[i]);
});
SaveManager::Instance->LoadArray("itemGetInf", ARRAY_COUNT(gSaveContext.itemGetInf),
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.itemGetInf[i]); });
SaveManager::Instance->LoadArray("infTable", ARRAY_COUNT(gSaveContext.infTable),
[](size_t i) { SaveManager::Instance->LoadData("", gSaveContext.infTable[i]); });
SaveManager::Instance->LoadData("worldMapAreaData", gSaveContext.worldMapAreaData);
SaveManager::Instance->LoadData("scarecrowLongSongSet", gSaveContext.scarecrowLongSongSet);
SaveManager::Instance->LoadArray("scarecrowLongSong", ARRAY_COUNT(gSaveContext.scarecrowLongSong), [](size_t i) {

View file

@ -11,8 +11,8 @@ EntranceDB* EntranceDB::Instance;
extern const std::vector<SceneDB::Init> sceneDBInit;
// We need a different struct than EntranceDB::Init (scene is a int not a string) because tables/entrance_table.h has the scene
// as an enum, which we do not have a compile-time way to convert to a string
// We need a different struct than EntranceDB::Init (scene is a int not a string) because tables/entrance_table.h has
// the scene as an enum, which we do not have a compile-time way to convert to a string
struct EntranceTableInit {
std::string name;
std::string desc;
@ -41,7 +41,7 @@ SceneDB::SceneDB() {
SceneDB::Entry& entry = RetrieveEntry(SCENE_BOTTOM_OF_THE_WELL);
entry.entry.epona.allowed = true;
entry.SetEponaSpawnPos({ { -630, 0, 53} });
entry.SetEponaSpawnPos({ { -630, 0, 53 } });
}
// Adds an scene at the given index. The name must be unique.
@ -107,7 +107,8 @@ SceneDB::Entry& SceneDB::AddEntry(const Init& init) {
}
entry.entry.dungeonData.bossFloor = init.dungeonData.bossFloor;
entry.SetDungeonPalettes(init.dungeonData.palettes);
entry.SetDungeonNameTextures(init.dungeonData.nameEngTexture, init.dungeonData.nameGerTexture, init.dungeonData.nameFraTexture);
entry.SetDungeonNameTextures(init.dungeonData.nameEngTexture, init.dungeonData.nameGerTexture,
init.dungeonData.nameFraTexture);
entry.SetDungeonFloors(init.dungeonData.floors);
entry.SetDungeonRooms(init.dungeonData.rooms);
entry.SetDungeonIntraRoomTransitions(init.dungeonData.intraRoomTransitions);
@ -257,7 +258,8 @@ void SceneDB::Entry::SetDungeonPalettes(const std::vector<s16>& newDungeonPalett
entry.dungeonData.numPalettes = dungeonPalettes.size();
}
void SceneDB::Entry::SetDungeonNameTextures(const std::string& newNameEngTexture, const std::string& newNameGerTexture, const std::string& newNameFraTexture) {
void SceneDB::Entry::SetDungeonNameTextures(const std::string& newNameEngTexture, const std::string& newNameGerTexture,
const std::string& newNameFraTexture) {
nameEngTexture = newNameEngTexture;
nameGerTexture = newNameGerTexture;
nameFraTexture = newNameFraTexture;
@ -276,8 +278,11 @@ void SceneDB::Entry::SetDungeonFloors(const std::vector<Init::FloorInit>& newDun
dungeonFloorInfo.reserve(newDungeonFloors.size());
for (size_t i = 0; i < newDungeonFloors.size(); i++) {
dungeonFloors.push_back(SceneDBFloor{ static_cast<FloorID>(newDungeonFloors[i].id), newDungeonFloors[i].height, nullptr, 0, nullptr, nullptr, nullptr, 0, nullptr, 0 });
dungeonFloorInfo.push_back(FloorInfo{ newDungeonFloors[i].palettes, newDungeonFloors[i].mapLeftTexture, newDungeonFloors[i].mapRightTexture, newDungeonFloors[i].chestMarks, newDungeonFloors[i].bossMarks });
dungeonFloors.push_back(SceneDBFloor{ static_cast<FloorID>(newDungeonFloors[i].id), newDungeonFloors[i].height,
nullptr, 0, nullptr, nullptr, nullptr, 0, nullptr, 0 });
dungeonFloorInfo.push_back(FloorInfo{ newDungeonFloors[i].palettes, newDungeonFloors[i].mapLeftTexture,
newDungeonFloors[i].mapRightTexture, newDungeonFloors[i].chestMarks,
newDungeonFloors[i].bossMarks });
}
for (size_t i = 0; i < dungeonFloors.size(); i++) {
@ -293,7 +298,8 @@ void SceneDB::Entry::SetDungeonFloors(const std::vector<Init::FloorInit>& newDun
std::copy(dungeonFloors.begin(), dungeonFloors.end(), entry.dungeonData.floors);
}
void SceneDB::Entry::SetDungeonFloors(const std::vector<SceneDBFloor>& newDungeonFloors, const std::vector<FloorInfo>& newDungeonFloorInfo) {
void SceneDB::Entry::SetDungeonFloors(const std::vector<SceneDBFloor>& newDungeonFloors,
const std::vector<FloorInfo>& newDungeonFloorInfo) {
assert(newDungeonFloors.size() == 8 || newDungeonFloors.size() == 0);
assert(newDungeonFloorInfo.size() == 8 || newDungeonFloorInfo.size() == 0);
assert(newDungeonFloors.size() == newDungeonFloorInfo.size());
@ -320,8 +326,10 @@ void SceneDB::Entry::SetDungeonRooms(const std::vector<Init::RoomInit>& newDunge
dungeonRoomInfo.reserve(newDungeonRooms.size());
for (size_t i = 0; i < newDungeonRooms.size(); i++) {
dungeonRooms.push_back(SceneDBRoom{ newDungeonRooms[i].compassOffsetX, newDungeonRooms[i].compassOffsetY, nullptr, nullptr, 0, nullptr, 0 });
dungeonRoomInfo.push_back(RoomInfo{ newDungeonRooms[i].minimapTexture, newDungeonRooms[i].chestMarks, newDungeonRooms[i].bossMarks });
dungeonRooms.push_back(SceneDBRoom{ newDungeonRooms[i].compassOffsetX, newDungeonRooms[i].compassOffsetY,
nullptr, nullptr, 0, nullptr, 0 });
dungeonRoomInfo.push_back(
RoomInfo{ newDungeonRooms[i].minimapTexture, newDungeonRooms[i].chestMarks, newDungeonRooms[i].bossMarks });
}
for (size_t i = 0; i < dungeonRooms.size(); i++) {
@ -335,7 +343,8 @@ void SceneDB::Entry::SetDungeonRooms(const std::vector<Init::RoomInit>& newDunge
entry.dungeonData.numRooms = dungeonRooms.size();
}
void SceneDB::Entry::SetDungeonRooms(const std::vector<SceneDBRoom>& newDungeonRooms, const std::vector<RoomInfo>& newDungeonRoomInfo) {
void SceneDB::Entry::SetDungeonRooms(const std::vector<SceneDBRoom>& newDungeonRooms,
const std::vector<RoomInfo>& newDungeonRoomInfo) {
dungeonRooms = newDungeonRooms;
dungeonRoomInfo = newDungeonRoomInfo;
for (size_t i = 0; i < dungeonRooms.size(); i++) {
@ -349,19 +358,23 @@ void SceneDB::Entry::SetDungeonRooms(const std::vector<SceneDBRoom>& newDungeonR
entry.dungeonData.numRooms = dungeonRooms.size();
}
void SceneDB::Entry::SetDungeonIntraRoomTransitions(const std::vector<Init::IntraRoomTransitionInit>& newDungeonIntraRoomTransitions) {
void SceneDB::Entry::SetDungeonIntraRoomTransitions(
const std::vector<Init::IntraRoomTransitionInit>& newDungeonIntraRoomTransitions) {
dungeonIntraRoomTransitions.clear();
dungeonIntraRoomTransitions.reserve(newDungeonIntraRoomTransitions.size());
for (size_t i = 0; i < newDungeonIntraRoomTransitions.size(); i++) {
dungeonIntraRoomTransitions.push_back(SceneDBIntraRoomTransition{ newDungeonIntraRoomTransitions[i].fromRoom, newDungeonIntraRoomTransitions[i].toRoom, newDungeonIntraRoomTransitions[i].toFloor });
dungeonIntraRoomTransitions.push_back(SceneDBIntraRoomTransition{ newDungeonIntraRoomTransitions[i].fromRoom,
newDungeonIntraRoomTransitions[i].toRoom,
newDungeonIntraRoomTransitions[i].toFloor });
}
entry.dungeonData.intraRoomTransitions = dungeonIntraRoomTransitions.data();
entry.dungeonData.numIntraRoomTransitions = dungeonIntraRoomTransitions.size();
}
void SceneDB::Entry::SetDungeonIntraRoomTransitions(const std::vector<SceneDBIntraRoomTransition>& newDungeonIntraRoomTransitions) {
void SceneDB::Entry::SetDungeonIntraRoomTransitions(
const std::vector<SceneDBIntraRoomTransition>& newDungeonIntraRoomTransitions) {
dungeonIntraRoomTransitions = newDungeonIntraRoomTransitions;
entry.dungeonData.intraRoomTransitions = dungeonIntraRoomTransitions.data();
entry.dungeonData.numIntraRoomTransitions = dungeonIntraRoomTransitions.size();
@ -384,298 +397,278 @@ struct MqMapMarkInit {
std::vector<MqMapMarkInit> mqMapMarkInit = {
// Deku Tree
{
{
{ { { 3, 71, 50 } }, {} },
{ {}, {} },
{ { { 1, 64, 62 } }, {} },
{ { { 4, 76, 37 } }, {} },
{ {}, {} },
{ { { 0, 46, 50 }, { 5, 76, 52 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, { { -1, 50, 23 } } },
{ { { 2, 46, 50 }, { 6, 58, 60 } }, {} },
{ {}, {} },
{ {}, {} }
},
{ { { { 3, 71, 50 } }, {} },
{ {}, {} },
{ { { 1, 64, 62 } }, {} },
{ { { 4, 76, 37 } }, {} },
{ {}, {} },
{ { { 0, 46, 50 }, { 5, 76, 52 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, { { -1, 50, 23 } } },
{ { { 2, 46, 50 }, { 6, 58, 60 } }, {} },
{ {}, {} },
{ {}, {} } },
},
// Dodongo's Cavern
{
{
{ { { 0, 69, 14 }, { 4, 69, 30 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 54, 54 } }, {} },
{ { { 2, 69, 54 } }, {} },
{ {}, { { -1, 37, 49 } } },
{ {}, {} },
{ { { 3, 59, 53 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 68, 54 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
}
},
{ {
{ { { 0, 69, 14 }, { 4, 69, 30 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 54, 54 } }, {} },
{ { { 2, 69, 54 } }, {} },
{ {}, { { -1, 37, 49 } } },
{ {}, {} },
{ { { 3, 59, 53 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 68, 54 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
} },
// Jabu-Jabu's Belly
{
{
{ { { 3, 66, 50 }, { 5, 72, 47 } }, {} },
{ { { 7, 72, 54 } }, {} },
{ {}, {} },
{ { { 4, 64, 62 }, { 8, 79, 38 } }, {} },
{ {}, {} },
{ { { 10, 64, 45 } }, { { -1, 67, 32 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 9, 68, 45 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 79, 33 }, { 6, 61, 41 } }, {} },
{ { { 0, 48, 57 }, { 2, 77, 55 } }, {} },
// Jabu-Jabu's Belly minimap 16
// SoH [General] - This entry corresponds to Big Octorok's room and is missing in the MQ game
// N64 hardware does an OoB read and lands on MQ Forest Temple room 0
// To avoid UB with OoB for SoH, the correct entry is now added below
{ {}, {} },
}
},
{ {
{ { { 3, 66, 50 }, { 5, 72, 47 } }, {} },
{ { { 7, 72, 54 } }, {} },
{ {}, {} },
{ { { 4, 64, 62 }, { 8, 79, 38 } }, {} },
{ {}, {} },
{ { { 10, 64, 45 } }, { { -1, 67, 32 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 9, 68, 45 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 79, 33 }, { 6, 61, 41 } }, {} },
{ { { 0, 48, 57 }, { 2, 77, 55 } }, {} },
// Jabu-Jabu's Belly minimap 16
// SoH [General] - This entry corresponds to Big Octorok's room and is missing in the MQ game
// N64 hardware does an OoB read and lands on MQ Forest Temple room 0
// To avoid UB with OoB for SoH, the correct entry is now added below
{ {}, {} },
} },
// Forest Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 72, 57 } }, {} },
{ { { 1, 69, 39 }, { 9, 62, 65 } }, {} },
{ {}, {} },
{ { { 9, 71, 59 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 13, 80, 53 } }, {} },
{ { { 15, 49, 50 } }, {} },
{ {}, {} },
{ { { 6, 65, 53 } }, {} },
{ {}, {} },
{ { { 11, 39, 35 } }, { { -1, 53, 5 } } },
{ { { 2, 65, 54 } }, {} },
{ { { 14, 64, 31 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 75, 53 } }, {} },
{ { { 12, 69, 52 } }, {} },
{ { { 5, 58, 27 } }, {} },
{ {}, {} },
{ {}, {} },
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 72, 57 } }, {} },
{ { { 1, 69, 39 }, { 9, 62, 65 } }, {} },
{ {}, {} },
{ { { 9, 71, 59 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 13, 80, 53 } }, {} },
{ { { 15, 49, 50 } }, {} },
{ {}, {} },
{ { { 6, 65, 53 } }, {} },
{ {}, {} },
{ { { 11, 39, 35 } }, { { -1, 53, 5 } } },
{ { { 2, 65, 54 } }, {} },
{ { { 14, 64, 31 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 75, 53 } }, {} },
{ { { 12, 69, 52 } }, {} },
{ { { 5, 58, 27 } }, {} },
{ {}, {} },
{ {}, {} },
} },
// Fire Temple
{
{
{ {}, {} },
{ {}, {} },
{ { { 7, 53, 70 } }, { { -1, 40, 47 } } },
{ {}, {} },
{ { { 11, 57, 48 } }, {} },
{ { { 3, 67, 73 }, { 6, 58, 76 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 78, 62 }, { 12, 77, 58 } }, {} },
{ {}, {} },
{ { { 4, 60, 54 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 72, 68 } }, {} },
{ { { 8, 66, 57 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 51, 61 } }, {} },
{ {}, {} },
{ {}, {} },
}
},
{ {
{ {}, {} },
{ {}, {} },
{ { { 7, 53, 70 } }, { { -1, 40, 47 } } },
{ {}, {} },
{ { { 11, 57, 48 } }, {} },
{ { { 3, 67, 73 }, { 6, 58, 76 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 78, 62 }, { 12, 77, 58 } }, {} },
{ {}, {} },
{ { { 4, 60, 54 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 72, 68 } }, {} },
{ { { 8, 66, 57 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 51, 61 } }, {} },
{ {}, {} },
{ {}, {} },
} },
// Water Temple
{
{
{ {}, {} },
{ {}, {} },
{ { { 6, 81, 68 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 75, 55 } }, {} },
{ {}, {} },
{ {}, { { -1, 77, 40 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 74, 61 } }, {} },
{ { { 2, 73, 65 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 73, 63 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
}
},
{ {
{ {}, {} },
{ {}, {} },
{ { { 6, 81, 68 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 75, 55 } }, {} },
{ {}, {} },
{ {}, { { -1, 77, 40 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 74, 61 } }, {} },
{ { { 2, 73, 65 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 73, 63 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
} },
// Spirit Temple
{
{
{ { { 26, 27, 35 }, { 27, 36, 35 }, { 30, 27, 28 }, { 31, 36, 28 } }, {} },
{ { { 29, 67, 63 } }, {} },
{ {}, {} },
{ { { 0, 71, 62 }, { 8, 71, 48 } }, {} },
{ {}, {} },
{ { { 3, 56, 54 }, { 15, 69, 42 } }, {} },
{ { { 28, 60, 54 } }, {} },
{ {}, {} },
{ { { 1, 76, 40 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 7, 70, 53 } }, {} },
{ {}, {} },
{ { { 4, 68, 42 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 25, 78, 58 } }, {} },
{ { { 24, 78, 58 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 71, 55 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 18, 75, 54 } }, {} },
{ {}, {} },
{ { { 6, 78, 55 }, { 12, 70, 70 } }, {} },
{ { { 2, 76, 37 } }, { { -1, 57, 23 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
}
},
{ {
{ { { 26, 27, 35 }, { 27, 36, 35 }, { 30, 27, 28 }, { 31, 36, 28 } }, {} },
{ { { 29, 67, 63 } }, {} },
{ {}, {} },
{ { { 0, 71, 62 }, { 8, 71, 48 } }, {} },
{ {}, {} },
{ { { 3, 56, 54 }, { 15, 69, 42 } }, {} },
{ { { 28, 60, 54 } }, {} },
{ {}, {} },
{ { { 1, 76, 40 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 7, 70, 53 } }, {} },
{ {}, {} },
{ { { 4, 68, 42 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 25, 78, 58 } }, {} },
{ { { 24, 78, 58 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 71, 55 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 18, 75, 54 } }, {} },
{ {}, {} },
{ { { 6, 78, 55 }, { 12, 70, 70 } }, {} },
{ { { 2, 76, 37 } }, { { -1, 57, 23 } } },
{ {}, {} },
{ {}, {} },
{ {}, {} },
} },
// Shadow Temple
{
{
{ {}, {} },
{ { { 1, 77, 64 } }, {} },
{ {}, {} },
{ {}, { { -1, 77, 76 } } },
{ { { 7, 76, 65 } }, {} },
{ {}, {} },
{ { { 2, 83, 67 }, { 14, 84, 59 } }, {} },
{ { { 3, 76, 67 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 4, 78, 62 }, { 5, 74, 62 }, { 6, 71, 68 } }, {} },
{ { { 9, 77, 64 } }, {} },
{ {}, {} },
{ { { 10, 71, 65 }, { 11, 80, 65 } }, {} },
{ { { 16, 73, 64 } }, {} },
{ {}, {} },
{ { { 12, 87, 64 }, { 22, 87, 68 } }, {} },
{ { { 13, 77, 66 } }, {} },
{ {}, {} },
{ { { 21, 78, 66 } }, {} },
{ { { 8, 76, 66 }, { 20, 78, 68 } }, {} },
{ { { 14, 77, 62 } }, {} },
{ {}, {} },
{ { { 15, 56, 67 } }, {} },
{ {}, {} },
{ { { 16, 73, 64 } }, {} },
{ { { 14, 77, 62 } }, {} },
}
},
{ {
{ {}, {} },
{ { { 1, 77, 64 } }, {} },
{ {}, {} },
{ {}, { { -1, 77, 76 } } },
{ { { 7, 76, 65 } }, {} },
{ {}, {} },
{ { { 2, 83, 67 }, { 14, 84, 59 } }, {} },
{ { { 3, 76, 67 } }, {} },
{ {}, {} },
{ {}, {} },
{ { { 4, 78, 62 }, { 5, 74, 62 }, { 6, 71, 68 } }, {} },
{ { { 9, 77, 64 } }, {} },
{ {}, {} },
{ { { 10, 71, 65 }, { 11, 80, 65 } }, {} },
{ { { 16, 73, 64 } }, {} },
{ {}, {} },
{ { { 12, 87, 64 }, { 22, 87, 68 } }, {} },
{ { { 13, 77, 66 } }, {} },
{ {}, {} },
{ { { 21, 78, 66 } }, {} },
{ { { 8, 76, 66 }, { 20, 78, 68 } }, {} },
{ { { 14, 77, 62 } }, {} },
{ {}, {} },
{ { { 15, 56, 67 } }, {} },
{ {}, {} },
{ { { 16, 73, 64 } }, {} },
{ { { 14, 77, 62 } }, {} },
} },
// Bottom of the Well
{
{
{ { { 3, 60, 18 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 73, 61 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 74, 66 } }, {} },
}
},
{ {
{ { { 3, 60, 18 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 73, 61 } }, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 74, 66 } }, {} },
} },
// Ice Cavern
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 71, 59 } }, {} },
{ {}, {} },
{ { { 0, 48, 36 } }, {} },
{ {}, {} },
{ { { 1, 73, 67 } }, {} },
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 71, 59 } }, {} },
{ {}, {} },
{ { { 0, 48, 36 } }, {} },
{ {}, {} },
{ { { 1, 73, 67 } }, {} },
} },
};
// Sets a scene's dungeon map marks based on whether it should be MQ or not
@ -707,138 +700,170 @@ struct MqPauseMapMarkInit {
Floor floors[8];
};
std::vector<MqPauseMapMarkInit> mqPauseMapMarkInit =
{
std::vector<MqPauseMapMarkInit> mqPauseMapMarkInit = {
// Deku Tree
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 40.0f, -33.0f }, { 6, 49.0f, -42.0f } }, {} }, // 3F
{ { { 1, 48.0f, -63.0f } }, {} }, // 2F
{ { { 3, 84.0f, -39.0f } }, {} }, // 1F
{ { { 0, 46.0f, -59.0f }, { 4, 77.0f, -26.0f }, { 5, 65.0f, -61.0f } }, {} }, // B1
{ {}, { { -1, 55.0f, 0.0f } } }, // B2
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 40.0f, -33.0f }, { 6, 49.0f, -42.0f } }, {} }, // 3F
{ { { 1, 48.0f, -63.0f } }, {} }, // 2F
{ { { 3, 84.0f, -39.0f } }, {} }, // 1F
{ { { 0, 46.0f, -59.0f }, { 4, 77.0f, -26.0f }, { 5, 65.0f, -61.0f } }, {} }, // B1
{ {}, { { -1, 55.0f, 0.0f } } }, // B2
} },
// Dodongo's Cavern
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 55.0f, -36.0f }, { 3, 54.0f, -51.0f }, { 5, 13.0f, -61.0f } }, {} }, // 2F
{ { { 0, 47.0f, -40.0f }, { 1, 51.0f, -3.0f }, { 4, 47.0f, -47.0f } }, { { -1, 23.0f, -25.0f } } }, // 1F
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 55.0f, -36.0f }, { 3, 54.0f, -51.0f }, { 5, 13.0f, -61.0f } }, {} }, // 2F
{ { { 0, 47.0f, -40.0f }, { 1, 51.0f, -3.0f }, { 4, 47.0f, -47.0f } }, { { -1, 23.0f, -25.0f } } }, // 1F
} },
// Jabu-Jabu's Belly
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 48.0f, -68.0f }, { 5, 50.0f, -66.0f }, { 7, 55.0f, -50.0f }, { 9, 58.0f, 1.0f }, { 10, 62.0f, -45.0f } }, { { -1, 65.0f, -37.0f } } }, // 1F
{ { { 0, 37.0f, -49.0f }, { 1, 65.0f, -38.0f }, { 2, 52.0f, -48.0f }, { 4, 46.0f, -36.0f }, { 6, 59.0f, -41.0f }, { 8, 52.0f, -26.0f } }, {} }, // B1
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 48.0f, -68.0f },
{ 5, 50.0f, -66.0f },
{ 7, 55.0f, -50.0f },
{ 9, 58.0f, 1.0f },
{ 10, 62.0f, -45.0f } },
{ { -1, 65.0f, -37.0f } } }, // 1F
{ { { 0, 37.0f, -49.0f },
{ 1, 65.0f, -38.0f },
{ 2, 52.0f, -48.0f },
{ 4, 46.0f, -36.0f },
{ 6, 59.0f, -41.0f },
{ 8, 52.0f, -26.0f } },
{} }, // B1
} },
// Forest Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 53.0f, -64.0f }, { 5, 65.0f, -9.0f }, { 12, 49.0f, -1.0f }, { 13, 40.0f, 0.0f }, { 14, 18.0f, -2.0f }, { 15, 59.0f, 0.0f } }, {} }, // 2F
{ { { 0, 49.0f, -1.0f }, { 1, 71.0f, -13.0f }, { 2, 11.0f, -25.0f }, { 6, 84.0f, -16.0f } }, {} }, // 1F
{ { { 9, 65.0f, -30.0f } }, {} }, // B1
{ { { 11, 41.0f, -24.0f } }, { { -1, 50.0f, -11.0f } } }, // B2
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 3, 53.0f, -64.0f },
{ 5, 65.0f, -9.0f },
{ 12, 49.0f, -1.0f },
{ 13, 40.0f, 0.0f },
{ 14, 18.0f, -2.0f },
{ 15, 59.0f, 0.0f } },
{} }, // 2F
{ { { 0, 49.0f, -1.0f }, { 1, 71.0f, -13.0f }, { 2, 11.0f, -25.0f }, { 6, 84.0f, -16.0f } }, {} }, // 1F
{ { { 9, 65.0f, -30.0f } }, {} }, // B1
{ { { 11, 41.0f, -24.0f } }, { { -1, 50.0f, -11.0f } } }, // B2
} },
// Fire Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 24.0f, -40.0f } }, {} }, // 5F
{ {}, {} }, // 4F
{ { { 3, 75.0f, -47.0f }, { 6, 72.0f, -51.0f }, { 8, 65.0f, -12.0f } }, {} }, // 3F
{ { { 11, 78.0f, -35.0f } }, {} }, // 2F
{ { { 1, 67.0f, -58.0f }, { 2, 48.0f, -30.0f }, { 4, 63.0f, -14.0f }, { 7, 36.0f, -45.0f }, { 12, 47.0f, -26.0f } }, { { -1, 26.0f, -34.0f } } }, // 1F
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 5, 24.0f, -40.0f } }, {} }, // 5F
{ {}, {} }, // 4F
{ { { 3, 75.0f, -47.0f }, { 6, 72.0f, -51.0f }, { 8, 65.0f, -12.0f } }, {} }, // 3F
{ { { 11, 78.0f, -35.0f } }, {} }, // 2F
{ { { 1, 67.0f, -58.0f },
{ 2, 48.0f, -30.0f },
{ 4, 63.0f, -14.0f },
{ 7, 36.0f, -45.0f },
{ 12, 47.0f, -26.0f } },
{ { -1, 26.0f, -34.0f } } }, // 1F
} },
// Water Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 88.0f, -60.0f } }, { { -1, 62.0f, -23.0f } } }, // 3F
{ { { 0, 88.0f, -60.0f } }, {} }, // 2F
{ { { 1, 88.0f, -60.0f }, { 5, 49.0f, -43.0f } }, {} }, // 1F
{ { { 6, 75.0f, -65.0f } }, {} }, // B1
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 88.0f, -60.0f } }, { { -1, 62.0f, -23.0f } } }, // 3F
{ { { 0, 88.0f, -60.0f } }, {} }, // 2F
{ { { 1, 88.0f, -60.0f }, { 5, 49.0f, -43.0f } }, {} }, // 1F
{ { { 6, 75.0f, -65.0f } }, {} }, // B1
} },
// Spirit Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 18, 46.0f, -30.0f } }, {} }, // 4F
{ { { 1, 23.0f, -33.0f }, { 2, 56.0f, -11.0f }, { 5, 83.0f, -25.0f }, { 24, 84.0f, -39.0f }, { 25, 74.0f, -37.0f } }, { { -1, 47.0f, 0.0f } } }, // 3F
{ { { 3, 46.0f, -20.0f }, { 6, 28.0f, -19.0f }, { 12, 25.0f, -25.0f }, { 15, 50.0f, -13.0f }, { 28, 48.0f, -29.0f } }, {} }, // 2F
{ { { 0, 14.0f, -24.0f }, { 4, 55.0f, -14.0f }, { 7, 78.0f, -2.0f }, { 8, 14.0f, -16.0f }, { 26, 42.0f, -43.0f }, { 27, 50.0f, -43.0f }, { 29, 25.0f, -35.0f }, { 30, 42.0f, -36.0f }, { 31, 50.0f, -36.0f } }, {} }, // 1F
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 18, 46.0f, -30.0f } }, {} }, // 4F
{ { { 1, 23.0f, -33.0f },
{ 2, 56.0f, -11.0f },
{ 5, 83.0f, -25.0f },
{ 24, 84.0f, -39.0f },
{ 25, 74.0f, -37.0f } },
{ { -1, 47.0f, 0.0f } } }, // 3F
{ { { 3, 46.0f, -20.0f },
{ 6, 28.0f, -19.0f },
{ 12, 25.0f, -25.0f },
{ 15, 50.0f, -13.0f },
{ 28, 48.0f, -29.0f } },
{} }, // 2F
{ { { 0, 14.0f, -24.0f },
{ 4, 55.0f, -14.0f },
{ 7, 78.0f, -2.0f },
{ 8, 14.0f, -16.0f },
{ 26, 42.0f, -43.0f },
{ 27, 50.0f, -43.0f },
{ 29, 25.0f, -35.0f },
{ 30, 42.0f, -36.0f },
{ 31, 50.0f, -36.0f } },
{} }, // 1F
} },
// Shadow Temple
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 41.0f, -17.0f }, { 7, 27.0f, -24.0f } }, {} }, // B1
{ { { 2, 81.0f, -20.0f }, { 3, 74.0f, -37.0f } }, {} }, // B2
{ { { 12, 96.0f, -51.0f }, { 16, 46.0f, -42.0f }, { 22, 96.0f, -55.0f } }, {} }, // B3
{ { { 4, 43.0f, -66.0f }, { 5, 37.0f, -66.0f }, { 6, 33.0f, -72.0f }, { 8, 85.0f, -18.0f }, { 9, 61.0f, -42.0f }, { 10, 15.0f, -4.0f }, { 11, 25.0f, -4.0f }, { 13, 19.0f, -29.0f }, { 14, 78.0f, -15.0f }, { 15, 60.0f, -70.0f }, { 21, 92.0f, -29.0f }, { 20, 87.0f, -20.0f } }, { { -1, 31.0f, -45.0f } } }, // B4
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 1, 41.0f, -17.0f }, { 7, 27.0f, -24.0f } }, {} }, // B1
{ { { 2, 81.0f, -20.0f }, { 3, 74.0f, -37.0f } }, {} }, // B2
{ { { 12, 96.0f, -51.0f }, { 16, 46.0f, -42.0f }, { 22, 96.0f, -55.0f } }, {} }, // B3
{ { { 4, 43.0f, -66.0f },
{ 5, 37.0f, -66.0f },
{ 6, 33.0f, -72.0f },
{ 8, 85.0f, -18.0f },
{ 9, 61.0f, -42.0f },
{ 10, 15.0f, -4.0f },
{ 11, 25.0f, -4.0f },
{ 13, 19.0f, -29.0f },
{ 14, 78.0f, -15.0f },
{ 15, 60.0f, -70.0f },
{ 21, 92.0f, -29.0f },
{ 20, 87.0f, -20.0f } },
{ { -1, 31.0f, -45.0f } } }, // B4
} },
// Bottom of the Well
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 84.0f, -38.0f }, { 3, 57.0f, -18.0f } }, {} }, // B1
{ {}, {} }, // B2
{ { { 1, 72.0f, -32.0f } }, {} }, // B3
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 2, 84.0f, -38.0f }, { 3, 57.0f, -18.0f } }, {} }, // B1
{ {}, {} }, // B2
{ { { 1, 72.0f, -32.0f } }, {} }, // B3
} },
// Ice Cavern
{
{
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 66.0f, -2.0f }, { 1, 77.0f, -46.0f }, { 2, 27.0f, -45.0f } }, {} }, // 1F
}
},
{ {
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ {}, {} },
{ { { 0, 66.0f, -2.0f }, { 1, 77.0f, -46.0f }, { 2, 27.0f, -45.0f } }, {} }, // 1F
} },
};
// Sets a scene's pause map marks based on whether it should be MQ or not
@ -879,20 +904,12 @@ bool SceneDB::Entry::isOverworld() {
return SCENEDB_ISOVERWORLD(&this->entry);
}
EntranceDB::EntranceDB() {
db.reserve(ENTR_MAX); // reserve size for all initial entries so we don't do it for each
for (const EntranceTableInit& init : entranceDBInit) {
Init nativeInit{
init.name,
init.desc,
SceneDB::Instance->RetrieveEntry(init.scene).name,
init.spawn,
init.continueBgm,
init.displayTitleCard,
init.endTransition,
init.startTransition
};
Init nativeInit{ init.name, init.desc, SceneDB::Instance->RetrieveEntry(init.scene).name,
init.spawn, init.continueBgm, init.displayTitleCard,
init.endTransition, init.startTransition };
AddEntry(nativeInit);
}
@ -987,9 +1004,9 @@ s32 EntranceDB::CalcId(const s32 entrance, const s32 newLayer) {
void EntranceDB::ResetVanillaEntrances() {
// Erase all instances of vanilla entrances in the lookup tables
for (size_t i = 0; i < ENTR_MAX; i++) {
// For this entrance, reset the next layer. This will cause problems with mods that add a new layer (like for a cutscene)
// However, we will treat this as fine for now because we don't have such mods
// A more robust solution is to use a local nextLayerLookupTable to reestablish the vanilla layers
// For this entrance, reset the next layer. This will cause problems with mods that add a new layer (like for a
// cutscene) However, we will treat this as fine for now because we don't have such mods A more robust solution
// is to use a local nextLayerLookupTable to reestablish the vanilla layers
NextLayerLookupKey nextLayerKey{ entranceDBInit[i].scene, entranceDBInit[i].spawn };
nextLayerLookupTable.erase(nextLayerKey);

View file

@ -120,7 +120,7 @@ typedef struct {
#include <map>
class SceneDB {
public:
public:
static SceneDB* Instance;
struct Init {
@ -230,13 +230,18 @@ public:
void SetTitleCard(const std::string& newTitleCard);
void SetEponaSpawnPos(const std::vector<Vec3s>& newSpawnPos);
void SetDungeonPalettes(const std::vector<s16>& newDungeonPalettes);
void SetDungeonNameTextures(const std::string& newNameEngTexture, const std::string& newNameGerTexture, const std::string& newNameFraTexture);
void SetDungeonNameTextures(const std::string& newNameEngTexture, const std::string& newNameGerTexture,
const std::string& newNameFraTexture);
void SetDungeonFloors(const std::vector<Init::FloorInit>& newDungeonFloors);
void SetDungeonFloors(const std::vector<SceneDBFloor>& newDungeonFloors, const std::vector<FloorInfo>& newDungeonFloorInfo);
void SetDungeonFloors(const std::vector<SceneDBFloor>& newDungeonFloors,
const std::vector<FloorInfo>& newDungeonFloorInfo);
void SetDungeonRooms(const std::vector<Init::RoomInit>& newDungeonRooms);
void SetDungeonRooms(const std::vector<SceneDBRoom>& newDungeonRooms, const std::vector<RoomInfo>& newDungeonRoomInfo);
void SetDungeonIntraRoomTransitions(const std::vector<Init::IntraRoomTransitionInit>& newDungeonIntraRoomTransitions);
void SetDungeonIntraRoomTransitions(const std::vector<SceneDBIntraRoomTransition>& newDungeonIntraRoomTransitions);
void SetDungeonRooms(const std::vector<SceneDBRoom>& newDungeonRooms,
const std::vector<RoomInfo>& newDungeonRoomInfo);
void SetDungeonIntraRoomTransitions(
const std::vector<Init::IntraRoomTransitionInit>& newDungeonIntraRoomTransitions);
void
SetDungeonIntraRoomTransitions(const std::vector<SceneDBIntraRoomTransition>& newDungeonIntraRoomTransitions);
void SetWorldMinimapTexture(const std::string& newWorldMinimapTexture);
void SetMapMarkData(const bool isMQ);
void SetPauseMapMarkData(const bool isMQ);
@ -268,7 +273,7 @@ public:
size_t GetNumEntries();
private:
private:
Entry& AddEntry(const std::string& name, const std::string& desc, size_t index);
std::vector<Entry> db;
@ -277,7 +282,7 @@ private:
};
class EntranceDB {
public:
public:
static EntranceDB* Instance;
struct Init {
@ -320,14 +325,16 @@ public:
s32 CalcId(s32 entrance, s32 newLayer);
void Copy(s32 from, s32 to);
private:
private:
Entry& AddEntry(const std::string& name, const std::string& desc, size_t index);
std::vector<Entry> db;
std::unordered_map<std::string, int> nameTable;
size_t nextFreeId = 0;
// This keeps a mapping of a scene, spawn, and layer to the resulting entrance ID, since we can assume no order about them
// This keeps a mapping of a scene, spawn, and layer to the resulting entrance ID, since we can assume no order
// about them
struct IdLookupKey {
s32 sceneId;
s32 spawn;

File diff suppressed because it is too large Load diff

View file

@ -34,7 +34,8 @@ extern "C" void OTRPlay_SpawnScene(PlayState* play, s32 sceneId, s32 spawn) {
if (inNonSharedScene) {
sceneVersion = ResourceMgr_IsGameMasterQuest() ? "mq" : "nonmq";
}
std::string scenePath = StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), entry.name.c_str(), entry.name.c_str());
std::string scenePath =
StringHelper::Sprintf("scenes/%s/%s/%s", sceneVersion.c_str(), entry.name.c_str(), entry.name.c_str());
play->sceneSegment = OTRPlay_LoadFile(play, scenePath.c_str());

View file

@ -874,8 +874,8 @@ void TitleCard_InitBossName(PlayState* play, TitleCardContext* titleCtx, void* t
}
// SceneDB TODO: this needs to be parameterized with a good multi-language solution for the textures
void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* texture, s32 x, s32 y,
s32 width, s32 height, s32 delay) {
void TitleCard_InitPlaceName(PlayState* play, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, s32 width,
s32 height, s32 delay) {
SceneTableEntry* loadedScene = play->loadedScene;
// size_t size = loadedScene->titleFile.vromEnd - loadedScene->titleFile.vromStart;
switch (play->sceneNum) {

View file

@ -2220,8 +2220,10 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
}
s32 scene = EntranceDB_Retrieve(gSaveContext.entranceIndex)->sceneId;
if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.respawnFlag <= 0) && (gSaveContext.cutsceneIndex < 0xFFF0)) {
if ((gSaveContext.entranceIndex == ENTR_DESERT_COLOSSUS_OUTSIDE_TEMPLE) && !Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) {
if ((gSaveContext.gameMode == GAMEMODE_NORMAL) && (gSaveContext.respawnFlag <= 0) &&
(gSaveContext.cutsceneIndex < 0xFFF0)) {
if ((gSaveContext.entranceIndex == ENTR_DESERT_COLOSSUS_OUTSIDE_TEMPLE) &&
!Flags_GetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT)) {
Flags_SetEventChkInf(EVENTCHKINF_LEARNED_REQUIEM_OF_SPIRIT);
gSaveContext.entranceIndex = ENTR_DESERT_COLOSSUS_EAST_EXIT;
gSaveContext.cutsceneIndex = 0xFFF0;
@ -2242,13 +2244,12 @@ void Cutscene_HandleConditionalTriggers(PlayState* play) {
}
gSaveContext.entranceIndex = ENTR_LOST_WOODS_SOUTH_EXIT;
gSaveContext.cutsceneIndex = 0xFFF0;
} else if (GameInteractor_Should(VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS, (
CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) &&
CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
LINK_IS_ADULT &&
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
(scene == SCENE_TEMPLE_OF_TIME)
))) {
} else if (GameInteractor_Should(
VB_BE_ELIGIBLE_FOR_LIGHT_ARROWS,
(CHECK_QUEST_ITEM(QUEST_MEDALLION_SPIRIT) && CHECK_QUEST_ITEM(QUEST_MEDALLION_SHADOW) &&
LINK_IS_ADULT &&
!Flags_GetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS) &&
(scene == SCENE_TEMPLE_OF_TIME)))) {
Flags_SetEventChkInf(EVENTCHKINF_RETURNED_TO_TEMPLE_OF_TIME_WITH_ALL_MEDALLIONS);
gSaveContext.entranceIndex = ENTR_TEMPLE_OF_TIME_ENTRANCE;
gSaveContext.cutsceneIndex = 0xFFF8;

View file

@ -114,7 +114,7 @@ void func_8006D0EC(PlayState* play, Player* player) {
SceneDBEntry* entry = SceneDB_Retrieve(play->sceneNum);
Actor* horseActor =
Actor_Spawn(&play->actorCtx, play, ACTOR_EN_HORSE, entry->epona.startingPos.x, entry->epona.startingPos.y,
entry->epona.startingPos.z, 0, entry->epona.angle, 0, 2, true);
entry->epona.startingPos.z, 0, entry->epona.angle, 0, 2, true);
assert(horseActor != NULL);
if (play->sceneNum == SCENE_GERUDOS_FORTRESS) {
horseActor->room = -1;

View file

@ -132,25 +132,32 @@ static s16 sPaletteRoom[10][8][14] = {
},
};
static s16 sRoomCompassOffsetX[10][44] = {
{ 1090, 1390, 1560, 1220, 1200, 1390, 1770, 1610, 2000, 1290, 1420,
1110, 1040, 470, 790, 1570, 720, 1000, 1580, 70 },
{ 940, 320, 1500, 240, 580, 1510, 720, 1030, 800, 660, 180, 520, 310, 550, 790, 1650, 1000, 1570, 80, 70 },
{ 1130, 1070, 1090, 1160, 1500, 690, 1540, 920, 1160, 700, 1650, 950, 1380, 1460, 830, 1170, 1620 },
{ 1130, 1170, 965, 890, 1170, 1460, 1170, 800, 1320, 880, 1130, 1590, 1390, 830, 610, 580, 710,
980, 1640, 1510, 590, 1610, 1130, 1130, 820, 1320, 1620, 0, 0, 0, 0, 1300, 1270 },
{ 1160, 620, 1330, 1280, 440, 600, 810, 830, 720, 1170, 1490, 1640, 1870, 1800, 1610, 1130, 860, 1310, 1140,
850, 760, 380, 800, 800, 1930, 1410, 640, 845, 810, 810, 850, 1390, 1540, 1650, 1880, 1530, 420, 1950 },
{ 1120, 1290, 1120, 1380, 930, 1520, 1980, 2010, 1590, 1510, 1500, 1300, 1240, 1800, 1290,
1450, 1560, 880, 820, 820, 1060, 1670, 1120, 1130, 1130, 1290, 1290, 1280, 1390, 940,
1520, 1520, 1980, 1620, 1510, 1490, 1240, 1290, 1450, 880, 880, 1060, 1670, 1520 },
{ 800, 1500, 1370, 1730, 1590, 1020, 1060, 1470, 1600, 1830, 1630, 2000, 650, 660, 1020, 880,
940, 720, 570, 620, 570, 550, 970, 920, 1040, 1150, 1200, 1550, 1520, 1020, 820, 1010 },
{ 1320, 1320, 1090, 1510, 1480, 940, 920, 910, 800, 820, 1150, 1000, 1800, 1660,
1090, 1630, 710, 1670, 830, 770, 800, 850, 830, 820, 1800, 1090, 850 },
{ 1080, 1420, 1620, 1040, 940, 1190, 1310, 1090, 1380, 1080 },
{ 1070, 1180, 1270, 990, 1280, 1450, 1680, 1530, 760, 860, 1500, 800 },
};
static s16 sRoomCompassOffsetX[10]
[44] = {
{ 1090, 1390, 1560, 1220, 1200, 1390, 1770, 1610, 2000, 1290,
1420, 1110, 1040, 470, 790, 1570, 720, 1000, 1580, 70 },
{ 940, 320, 1500, 240, 580, 1510, 720, 1030, 800, 660,
180, 520, 310, 550, 790, 1650, 1000, 1570, 80, 70 },
{ 1130, 1070, 1090, 1160, 1500, 690, 1540, 920, 1160, 700, 1650, 950, 1380, 1460, 830,
1170, 1620 },
{ 1130, 1170, 965, 890, 1170, 1460, 1170, 800, 1320, 880, 1130,
1590, 1390, 830, 610, 580, 710, 980, 1640, 1510, 590, 1610,
1130, 1130, 820, 1320, 1620, 0, 0, 0, 0, 1300, 1270 },
{ 1160, 620, 1330, 1280, 440, 600, 810, 830, 720, 1170, 1490, 1640, 1870,
1800, 1610, 1130, 860, 1310, 1140, 850, 760, 380, 800, 800, 1930, 1410,
640, 845, 810, 810, 850, 1390, 1540, 1650, 1880, 1530, 420, 1950 },
{ 1120, 1290, 1120, 1380, 930, 1520, 1980, 2010, 1590, 1510, 1500,
1300, 1240, 1800, 1290, 1450, 1560, 880, 820, 820, 1060, 1670,
1120, 1130, 1130, 1290, 1290, 1280, 1390, 940, 1520, 1520, 1980,
1620, 1510, 1490, 1240, 1290, 1450, 880, 880, 1060, 1670, 1520 },
{ 800, 1500, 1370, 1730, 1590, 1020, 1060, 1470, 1600, 1830, 1630,
2000, 650, 660, 1020, 880, 940, 720, 570, 620, 570, 550,
970, 920, 1040, 1150, 1200, 1550, 1520, 1020, 820, 1010 },
{ 1320, 1320, 1090, 1510, 1480, 940, 920, 910, 800, 820, 1150, 1000, 1800, 1660,
1090, 1630, 710, 1670, 830, 770, 800, 850, 830, 820, 1800, 1090, 850 },
{ 1080, 1420, 1620, 1040, 940, 1190, 1310, 1090, 1380, 1080 },
{ 1070, 1180, 1270, 990, 1280, 1450, 1680, 1530, 760, 860, 1500, 800 },
};
static s16 sRoomCompassOffsetY[10][44] = {
{ -660, -570, -410, -690, -500, -380, -470, -630, -990, -870,

View file

@ -360,17 +360,18 @@ void Map_InitData(PlayState* play, s16 room) {
sOwEntranceIconPosY = -825;
play->interfaceCtx.mapSegmentName[0] = gExploredShadowGraveyardMinimapTex;
} else if (play->sceneNum == SCENE_LAKE_HYLIA && (LINK_AGE_IN_YEARS == YEARS_ADULT) &&
((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) ||
((!IS_RANDO && !CHECK_QUEST_ITEM(QUEST_MEDALLION_WATER)) ||
(IS_RANDO && !Flags_GetEventChkInf(EVENTCHKINF_USED_WATER_TEMPLE_BLUE_WARP)))) {
sOwEntranceIconPosX = 259;
sOwEntranceIconPosY = -829;
play->interfaceCtx.mapSegmentName[0] = gDrainedLakeHyliaMinimapTex;
} else if (play->sceneNum == SCENE_GERUDO_VALLEY && (LINK_AGE_IN_YEARS == YEARS_ADULT) && !GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
} else if (play->sceneNum == SCENE_GERUDO_VALLEY && (LINK_AGE_IN_YEARS == YEARS_ADULT) &&
!GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) {
sOwEntranceIconPosX = 1;
sOwEntranceIconPosY = 0;
play->interfaceCtx.mapSegmentName[0] = gGerudoValleyWithBrokenBridgeMinimapTex;
} else if (play->sceneNum == SCENE_GERUDOS_FORTRESS && (!IS_RANDO && GET_EVENTCHKINF_CARPENTERS_FREE_ALL()) ||
(IS_RANDO && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) {
(IS_RANDO && CHECK_QUEST_ITEM(QUEST_GERUDO_CARD))) {
sOwEntranceIconPosX = 243;
sOwEntranceIconPosY = -833;
play->interfaceCtx.mapSegmentName[0] = gGerudosFortressMinimapTex;
@ -385,8 +386,8 @@ void Map_InitData(PlayState* play, s16 room) {
} else if (SCENEDB_ISDUNGEON(entry)) {
osSyncPrintf(VT_FGCOL(YELLOW));
// "Deku Tree Dungeon MAP Texture DMA"
osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room,
mapIndex, VREG(30));
osSyncPrintf("デクの樹ダンジョンMAP テクスチャDMA(%x) scene_id_offset=%d VREG(30)=%d\n", room, mapIndex,
VREG(30));
osSyncPrintf(VT_RST);
play->interfaceCtx.mapSegmentName[0] = entry->dungeonData.rooms[room].minimapTexture;
@ -446,7 +447,6 @@ void Map_Init(PlayState* play) {
interfaceCtx->mapSegment, play);
assert(interfaceCtx->mapSegment != NULL);
SceneDBEntry* entry = SceneDB_Retrieve(play->sceneNum);
if (SCENEDB_ISBOSS(entry)) {
@ -640,7 +640,7 @@ void Minimap_Draw(PlayState* play) {
InterfaceContext* interfaceCtx = &play->interfaceCtx;
s32 mapIndex = gSaveContext.mapIndex;
SceneDBEntry* entry = SceneDB_Retrieve(play->sceneNum);
Color_RGB8 minimapColor = {0, 255, 255};
Color_RGB8 minimapColor = { 0, 255, 255 };
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.Changed"), 0)) {
minimapColor = CVarGetColor24(CVAR_COSMETIC("HUD.Minimap.Value"), minimapColor);
}
@ -667,42 +667,44 @@ void Minimap_Draw(PlayState* play) {
}
if (SCENEDB_ISDUNGEON(entry)) {
if (!R_MINIMAP_DISABLED && CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != HIDDEN) { // Not Hidden
if (!R_MINIMAP_DISABLED &&
CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != HIDDEN) { // Not Hidden
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
gDPSetCombineLERP(OVERLAY_DISP++, 1, 0, PRIMITIVE, 0, TEXEL0, 0, PRIMITIVE, 0, 1, 0, PRIMITIVE, 0,
TEXEL0, 0, PRIMITIVE, 0);
TEXEL0, 0, PRIMITIVE, 0);
if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) {
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b, interfaceCtx->minimapAlpha);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b,
interfaceCtx->minimapAlpha);
u8 mirrorMode = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? G_TX_MIRROR : G_TX_NOMIRROR;
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegmentName[0], G_IM_FMT_I, 96, 85, 0,
mirrorMode | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
mirrorMode | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + X_Margins_Minimap);
s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
dgnMiniMapY = R_DGN_MINIMAP_Y + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0) +
Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Left_MM_Margin;
};
dgnMiniMapX = OTRGetDimensionFromLeftEdge(
R_DGN_MINIMAP_X + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Right_MM_Margin;
};
dgnMiniMapX = OTRGetDimensionFromRightEdge(
R_DGN_MINIMAP_X + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
dgnMiniMapX = CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0);
}
s16 dgnMiniMapX = OTRGetRectDimensionFromRightEdge(R_DGN_MINIMAP_X + X_Margins_Minimap);
s16 dgnMiniMapY = R_DGN_MINIMAP_Y + Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
dgnMiniMapY =
R_DGN_MINIMAP_Y + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0) + Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Left_MM_Margin;
};
dgnMiniMapX = OTRGetDimensionFromLeftEdge(
R_DGN_MINIMAP_X + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Right_MM_Margin;
};
dgnMiniMapX = OTRGetDimensionFromRightEdge(
R_DGN_MINIMAP_X + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
dgnMiniMapX = CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0);
}
}
s32 sValue = 0;
if (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)) {
@ -710,10 +712,9 @@ void Minimap_Draw(PlayState* play) {
sValue = 96 << 5;
}
gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, dgnMiniMapY << 2,
(dgnMiniMapX + 96) << 2, (dgnMiniMapY + 85) << 2, G_TX_RENDERTILE,
sValue, 0, 1 << 10, 1 << 10);
}
gSPWideTextureRectangle(OVERLAY_DISP++, dgnMiniMapX << 2, dgnMiniMapY << 2, (dgnMiniMapX + 96) << 2,
(dgnMiniMapY + 85) << 2, G_TX_RENDERTILE, sValue, 0, 1 << 10, 1 << 10);
}
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, mapIndex)) {
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
@ -737,24 +738,34 @@ void Minimap_Draw(PlayState* play) {
Gfx_SetupDL_39Overlay(play->state.gfxCtx);
gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b, interfaceCtx->minimapAlpha);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b,
interfaceCtx->minimapAlpha);
u8 mirrorMode = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? G_TX_MIRROR : G_TX_NOMIRROR;
gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegmentName[0], G_IM_FMT_IA,
entry->worldData.minimapWidth, entry->worldData.minimapHeight, 0,
mirrorMode | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK,
G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
entry->worldData.minimapWidth, entry->worldData.minimapHeight, 0,
mirrorMode | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
G_TX_NOLOD, G_TX_NOLOD);
s16 oWMiniMapX = OTRGetRectDimensionFromRightEdge(entry->worldData.minimapX + X_Margins_Minimap);
s16 oWMiniMapY = entry->worldData.minimapY + Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
oWMiniMapY = entry->worldData.minimapY + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0) + Y_Margins_Minimap;
oWMiniMapY = entry->worldData.minimapY + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0) +
Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Left_MM_Margin; };
oWMiniMapX = OTRGetDimensionFromLeftEdge(entry->worldData.minimapX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + X_Margins_Minimap);
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Left_MM_Margin;
};
oWMiniMapX = OTRGetDimensionFromLeftEdge(entry->worldData.minimapX +
CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Right_MM_Margin; };
oWMiniMapX = OTRGetDimensionFromRightEdge(entry->worldData.minimapX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + X_Margins_Minimap);
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Right_MM_Margin;
};
oWMiniMapX = OTRGetDimensionFromRightEdge(entry->worldData.minimapX +
CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) +
X_Margins_Minimap);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
oWMiniMapX = CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0);
}
@ -766,31 +777,34 @@ void Minimap_Draw(PlayState* play) {
sValue = entry->worldData.minimapWidth << 5;
}
gSPWideTextureRectangle(OVERLAY_DISP++, oWMiniMapX << 2, oWMiniMapY << 2,
(oWMiniMapX + entry->worldData.minimapWidth) << 2,
(oWMiniMapY + entry->worldData.minimapHeight) << 2, G_TX_RENDERTILE, sValue,
0, 1 << 10, 1 << 10);
gSPWideTextureRectangle(
OVERLAY_DISP++, oWMiniMapX << 2, oWMiniMapY << 2, (oWMiniMapX + entry->worldData.minimapWidth) << 2,
(oWMiniMapY + entry->worldData.minimapHeight) << 2, G_TX_RENDERTILE, sValue, 0, 1 << 10, 1 << 10);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b, interfaceCtx->minimapAlpha);
gDPSetPrimColor(OVERLAY_DISP++, 0, 0, minimapColor.r, minimapColor.g, minimapColor.b,
interfaceCtx->minimapAlpha);
s16 iconSize = 8;
if (((play->sceneNum != SCENE_KAKARIKO_VILLAGE) && (play->sceneNum != SCENE_KOKIRI_FOREST) &&
(play->sceneNum != SCENE_ZORAS_FOUNTAIN)) ||
(play->sceneNum != SCENE_ZORAS_FOUNTAIN)) ||
(LINK_AGE_IN_YEARS != YEARS_ADULT)) {
s16 origX = R_OW_MINIMAP_X;
// Compute the distance of the center of the original texture location to the center of the map
// Then duplicate that and right-align the texture (extra 2 pixels are due to the texture being a 6px left-aligned in a 8px tex)
s16 distFromCenter = (entry->worldData.minimapX + (entry->worldData.minimapWidth / 2)) - (origX + (iconSize / 2));
// Then duplicate that and right-align the texture (extra 2 pixels are due to the texture being a
// 6px left-aligned in a 8px tex)
s16 distFromCenter =
(entry->worldData.minimapX + (entry->worldData.minimapWidth / 2)) - (origX + (iconSize / 2));
s16 mirrorOffset = distFromCenter * 2 + (iconSize / 2) - 2;
s16 newX = origX + (CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? mirrorOffset : 0);
// The game authentically uses larger negative values for the entrance icon Y pos value. Normally only the first 12 bits
// would be read when the final value is passed into `gSPTextureRectangle`, but our cosmetic hud placements requires using
// `gSPWideTextureRectangle` which reads the first 24 bits instead. This caused the icon to be placed off screen.
// To address this, we take only the first 10 bits (which are later left-shifted by 2 to get our final 12 bits)
// to fix the entrance icon position when used with `gSPWideTextureRectangle`
// The game authentically uses larger negative values for the entrance icon Y pos value. Normally
// only the first 12 bits would be read when the final value is passed into `gSPTextureRectangle`,
// but our cosmetic hud placements requires using `gSPWideTextureRectangle` which reads the first 24
// bits instead. This caused the icon to be placed off screen. To address this, we take only the
// first 10 bits (which are later left-shifted by 2 to get our final 12 bits) to fix the entrance
// icon position when used with `gSPWideTextureRectangle`
s16 newY = R_OW_MINIMAP_Y & 0x3FF;
s16 entranceX = OTRGetRectDimensionFromRightEdge(newX + X_Margins_Minimap);
@ -798,11 +812,17 @@ void Minimap_Draw(PlayState* play) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
entranceY = newY + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0) + Y_Margins_Minimap;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Left_MM_Margin; };
entranceX = OTRGetRectDimensionFromLeftEdge(newX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Left_MM_Margin;
};
entranceX = OTRGetRectDimensionFromLeftEdge(
newX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Right_MM_Margin; };
entranceX = OTRGetRectDimensionFromRightEdge(newX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Right_MM_Margin;
};
entranceX = OTRGetRectDimensionFromRightEdge(
newX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
entranceX = newX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0);
}
@ -812,18 +832,21 @@ void Minimap_Draw(PlayState* play) {
// or hide them entirely if the fix is applied
if (R_OW_MINIMAP_Y == 0) {
entranceY = 0;
entranceX = CVarGetInteger(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 0) ? -9999 : OTRGetRectDimensionFromLeftEdge(0);
entranceX = CVarGetInteger(CVAR_ENHANCEMENT("FixDungeonMinimapIcon"), 0)
? -9999
: OTRGetRectDimensionFromLeftEdge(0);
}
if ((entry->worldData.entranceFlag == -1) ||
((entry->worldData.entranceFlag != -1) &&
((gSaveContext.infTable[26] & gBitFlags[entry->worldData.entranceFlag]) ||
CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0)))) {
((gSaveContext.infTable[26] & gBitFlags[entry->worldData.entranceFlag]) ||
CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0)))) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b,
iconSize, iconSize, 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 + iconSize) << 2,
(entranceY + iconSize) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
iconSize, iconSize, 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 + iconSize) << 2, (entranceY + iconSize) << 2,
G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
}
@ -833,24 +856,31 @@ void Minimap_Draw(PlayState* play) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
entranceY = 154 + Y_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0);
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Left_MM_Margin; };
entranceX = OTRGetRectDimensionFromLeftEdge(origX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Left_MM_Margin;
};
entranceX = OTRGetRectDimensionFromLeftEdge(
origX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) { X_Margins_Minimap = Right_MM_Margin; };
entranceX = OTRGetRectDimensionFromRightEdge(origX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap = Right_MM_Margin;
};
entranceX = OTRGetRectDimensionFromRightEdge(
origX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0));
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
entranceX = origX + X_Margins_Minimap + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0);
}
}
// Ice Cavern entrance icon
if ((play->sceneNum == SCENE_ZORAS_FOUNTAIN) && ((gSaveContext.infTable[26] & gBitFlags[9]) ||
CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0))) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, iconSize,
iconSize, 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 ((play->sceneNum == SCENE_ZORAS_FOUNTAIN) &&
((gSaveContext.infTable[26] & gBitFlags[9]) ||
CVarGetInteger(CVAR_ENHANCEMENT("AlwaysShowDungeonMinimapIcon"), 0))) {
gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b,
iconSize, iconSize, 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 + iconSize) << 2,
(entranceY + iconSize) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
(entranceY + iconSize) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10);
}
Minimap_DrawCompassIcons(play); // Draw icons for the player spawn and current position
@ -910,7 +940,7 @@ void Map_Update(PlayState* play) {
if (interfaceCtx->mapRoomNum != sLastRoomNum) {
// "Current floor = %d Current room = %x Number of rooms = %d"
osSyncPrintf("現在階=%d 現在部屋=%x 部屋数=%d\n", floor, interfaceCtx->mapRoomNum,
entry->dungeonData.numRooms);
entry->dungeonData.numRooms);
sLastRoomNum = interfaceCtx->mapRoomNum;
}

View file

@ -107,7 +107,9 @@ void MapMark_DrawForDungeon(PlayState* play) {
s32 X_Margins_Minimap_ic;
s32 Y_Margins_Minimap_ic;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ORIGINAL_LOCATION) { X_Margins_Minimap_ic = Right_MC_Margin; };
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ORIGINAL_LOCATION) {
X_Margins_Minimap_ic = Right_MC_Margin;
};
Y_Margins_Minimap_ic = Bottom_MC_Margin;
} else {
X_Margins_Minimap_ic = 0;
@ -135,22 +137,24 @@ void MapMark_DrawForDungeon(PlayState* play) {
markInfo = &sMapMarkInfoTable[MAP_MARK_BOSS];
}
int height = markInfo->textureHeight * 1.0f; //Adjust Height with scale
int width = markInfo->textureWidth * 1.0f; //Adjust Width with scale
int height = markInfo->textureHeight * 1.0f; // Adjust Height with scale
int width = markInfo->textureWidth * 1.0f; // Adjust Width with scale
int height_factor = (1 << 10) * markInfo->textureHeight / height;
int width_factor = (1 << 10) * markInfo->textureWidth / width;
// The original mark point X originates from the left edge of the map
// For mirror mode, we compute the new mark point X by subtracting it from the right side of the
// dungeon map and the textures width
s16 markPointX = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? 96 - markPoint->x - width : markPoint->x;
s16 markPointX =
CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? 96 - markPoint->x - width : markPoint->x;
//Minimap chest / boss icon
const s32 PosX_Minimap_ori = GREG(94) + OTRGetRectDimensionFromRightEdge(markPointX + X_Margins_Minimap_ic) + 204;
// Minimap chest / boss icon
const s32 PosX_Minimap_ori =
GREG(94) + OTRGetRectDimensionFromRightEdge(markPointX + X_Margins_Minimap_ic) + 204;
const s32 PosY_Minimap_ori = GREG(95) + markPoint->y + Y_Margins_Minimap_ic + 140;
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) != ORIGINAL_LOCATION) {
rectTop = (markPoint->y + Y_Margins_Minimap_ic + 140 +
CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0));
rectTop =
(markPoint->y + Y_Margins_Minimap_ic + 140 + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosY"), 0));
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_LEFT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap_ic = Left_MC_Margin;
@ -161,23 +165,20 @@ void MapMark_DrawForDungeon(PlayState* play) {
play->sceneNum == SCENE_SPIRIT_TEMPLE || play->sceneNum == SCENE_SHADOW_TEMPLE ||
play->sceneNum == SCENE_BOTTOM_OF_THE_WELL || play->sceneNum == SCENE_ICE_CAVERN) {
rectLeft = OTRGetRectDimensionFromLeftEdge(
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 +
X_Margins_Minimap_ic);
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 + X_Margins_Minimap_ic);
} else {
rectLeft = OTRGetRectDimensionFromLeftEdge(
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 +
X_Margins_Minimap_ic);
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 + X_Margins_Minimap_ic);
}
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_RIGHT) {
if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.UseMargins"), 0) != 0) {
X_Margins_Minimap_ic = Right_MC_Margin;
};
rectLeft = OTRGetRectDimensionFromRightEdge(
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 +
X_Margins_Minimap_ic);
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 + X_Margins_Minimap_ic);
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == ANCHOR_NONE) {
rectLeft = markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 +
X_Margins_Minimap_ic;
rectLeft =
markPointX + CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosX"), 0) + 204 + X_Margins_Minimap_ic;
} else if (CVarGetInteger(CVAR_COSMETIC("HUD.Minimap.PosType"), 0) == HIDDEN) {
rectLeft = -9999;
}
@ -189,12 +190,11 @@ void MapMark_DrawForDungeon(PlayState* play) {
gDPPipeSync(OVERLAY_DISP++);
gDPLoadTextureBlock(OVERLAY_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
markInfo->textureWidth, markInfo->textureHeight, 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);
//Changed to a Wide texture to support Left anchor.
markInfo->textureWidth, markInfo->textureHeight, 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);
// Changed to a Wide texture to support Left anchor.
gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, rectLeft + width << 2,
rectTop + height << 2, G_TX_RENDERTILE, 0, 0, width_factor,
height_factor);
rectTop + height << 2, G_TX_RENDERTILE, 0, 0, width_factor, height_factor);
}
CLOSE_DISPS(play->state.gfxCtx);

View file

@ -1434,94 +1434,95 @@ void Inventory_DoBA(u8 cRight) {
// ITEM_SONG_NOCTURNE and ITEM_SONG_PRELUDE land in padding bytes
gSaveContext.equips.buttonItems[0] = 0;
} else if (cRight >= ITEM_SONG_LULLABY) {
// The rest of the items fall into the saved scene flags. Let's calculate the scene and which field it pulls from
// The rest of the items fall into the saved scene flags. Let's calculate the scene and which field it pulls
// from
u32 offset = cRight - ITEM_SONG_LULLABY;
u32 scene = offset / sizeof(SavedSceneFlags);
switch (offset % sizeof(SavedSceneFlags)) {
case 0:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 24) & 0xFF;
break;
case 1:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 16) & 0xFF;
break;
case 2:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 8) & 0xFF;
break;
case 3:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].chest & 0xFF;
break;
case 4:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 24) & 0xFF;
break;
case 5:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 16) & 0xFF;
break;
case 6:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 8) & 0xFF;
break;
case 7:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].swch & 0xFF;
break;
case 8:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 24) & 0xFF;
break;
case 9:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 16) & 0xFF;
break;
case 10:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 8) & 0xFF;
break;
case 11:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].clear & 0xFF;
break;
case 12:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 24) & 0xFF;
break;
case 13:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 16) & 0xFF;
break;
case 14:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 8) & 0xFF;
break;
case 15:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].collect & 0xFF;
break;
case 16:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 24) & 0xFF;
break;
case 17:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 16) & 0xFF;
break;
case 18:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 8) & 0xFF;
break;
case 19:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].unk & 0xFF;
break;
case 20:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 24) & 0xFF;
break;
case 21:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 16) & 0xFF;
break;
case 22:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 8) & 0xFF;
break;
case 23:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].rooms & 0xFF;
break;
case 24:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 24) & 0xFF;
break;
case 25:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 16) & 0xFF;
break;
case 26:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 8) & 0xFF;
break;
case 27:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].floors & 0xFF;
break;
case 0:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 24) & 0xFF;
break;
case 1:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 16) & 0xFF;
break;
case 2:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].chest >> 8) & 0xFF;
break;
case 3:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].chest & 0xFF;
break;
case 4:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 24) & 0xFF;
break;
case 5:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 16) & 0xFF;
break;
case 6:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].swch >> 8) & 0xFF;
break;
case 7:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].swch & 0xFF;
break;
case 8:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 24) & 0xFF;
break;
case 9:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 16) & 0xFF;
break;
case 10:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].clear >> 8) & 0xFF;
break;
case 11:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].clear & 0xFF;
break;
case 12:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 24) & 0xFF;
break;
case 13:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 16) & 0xFF;
break;
case 14:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].collect >> 8) & 0xFF;
break;
case 15:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].collect & 0xFF;
break;
case 16:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 24) & 0xFF;
break;
case 17:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 16) & 0xFF;
break;
case 18:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].unk >> 8) & 0xFF;
break;
case 19:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].unk & 0xFF;
break;
case 20:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 24) & 0xFF;
break;
case 21:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 16) & 0xFF;
break;
case 22:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].rooms >> 8) & 0xFF;
break;
case 23:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].rooms & 0xFF;
break;
case 24:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 24) & 0xFF;
break;
case 25:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 16) & 0xFF;
break;
case 26:
gSaveContext.equips.buttonItems[0] = (gSaveContext.sceneFlags[scene].floors >> 8) & 0xFF;
break;
case 27:
gSaveContext.equips.buttonItems[0] = gSaveContext.sceneFlags[scene].floors & 0xFF;
break;
}
}
}

View file

@ -491,7 +491,8 @@ void Play_Init(GameState* thisx) {
gSaveContext.sceneSetupIndex = (Flags_GetEventChkInf(EVENTCHKINF_USED_FOREST_TEMPLE_BLUE_WARP)) ? 3 : 2;
}
EntranceDBEntry* adjustedEntrance = EntranceDB_RetrieveLayer(gSaveContext.entranceIndex, gSaveContext.sceneSetupIndex);
EntranceDBEntry* adjustedEntrance =
EntranceDB_RetrieveLayer(gSaveContext.entranceIndex, gSaveContext.sceneSetupIndex);
Play_SpawnScene(play, adjustedEntrance->sceneId, adjustedEntrance->spawn);
osSyncPrintf("\nSCENE_NO=%d COUNTER=%d\n", ((void)0, gSaveContext.entranceIndex), gSaveContext.sceneSetupIndex);

View file

@ -689,10 +689,13 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
player = GET_PLAYER(play);
if (play->sceneNum != SCENE_LON_LON_RANCH ||
//! Same flag checked twice
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) && ((gSaveContext.eventInf[0] & 0xF) != 6 || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) ||
(Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED) &&
((gSaveContext.eventInf[0] & 0xF) != 6 || Flags_GetEventChkInf(EVENTCHKINF_EPONA_OBTAINED))) ||
// always load two spawns inside lon lon
((entry->epona.spawnPos[i].x == 856 && entry->epona.spawnPos[i].y == 0 && entry->epona.spawnPos[i].z == -918) ||
(entry->epona.spawnPos[i].x == -1003 && entry->epona.spawnPos[i].y == 0 && entry->epona.spawnPos[i].z == -755))) {
((entry->epona.spawnPos[i].x == 856 && entry->epona.spawnPos[i].y == 0 &&
entry->epona.spawnPos[i].z == -918) ||
(entry->epona.spawnPos[i].x == -1003 && entry->epona.spawnPos[i].y == 0 &&
entry->epona.spawnPos[i].z == -755))) {
spawnPos.x = entry->epona.spawnPos[i].x;
spawnPos.y = entry->epona.spawnPos[i].y;
@ -709,7 +712,7 @@ s32 EnHorse_Spawn(EnHorse* this, PlayState* play) {
this->actor.shape.rot.y = Actor_WorldYawTowardActor(&this->actor, &GET_PLAYER(play)->actor);
spawn = true;
SkinMatrix_Vec3fMtxFMultXYZW(&play->viewProjectionMtxF, &this->actor.world.pos,
&this->actor.projectedPos, &this->actor.projectedW);
&this->actor.projectedPos, &this->actor.projectedW);
}
}
}

View file

@ -10870,10 +10870,11 @@ void Player_Init(Actor* thisx, PlayState* play2) {
if (GameInteractor_Should(VB_SHOW_TITLE_CARD, gSaveContext.showTitleCard)) {
if ((gSaveContext.sceneSetupIndex < 4) &&
EntranceDB_RetrieveLayer(gSaveContext.entranceIndex, gSaveContext.sceneSetupIndex)->displayTitleCard &&
((play->sceneNum != SCENE_DODONGOS_CAVERN) || (Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) &&
((play->sceneNum != SCENE_BOMBCHU_SHOP) || (Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)))) {
TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144,
24, 20);
((play->sceneNum != SCENE_DODONGOS_CAVERN) ||
(Flags_GetEventChkInf(EVENTCHKINF_ENTERED_DODONGOS_CAVERN))) &&
((play->sceneNum != SCENE_BOMBCHU_SHOP) ||
(Flags_GetEventChkInf(EVENTCHKINF_USED_DODONGOS_CAVERN_BLUE_WARP)))) {
TitleCard_InitPlaceName(play, &play->actorCtx.titleCtx, this->giObjectSegment, 160, 120, 144, 24, 20);
}
}
gSaveContext.showTitleCard = true;

View file

@ -1213,7 +1213,8 @@ void Better_Select_UpdateMenu(SelectContext* this) {
BetterSceneSelectEntrancePair entrancePair =
this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex];
// Update the MQ status to match the new scene
if (entrancePair.canBeMQ && ResourceMgr_IsSceneMasterQuest(EntranceDB_Retrieve(entrancePair.entranceIndex)->sceneId)) {
if (entrancePair.canBeMQ &&
ResourceMgr_IsSceneMasterQuest(EntranceDB_Retrieve(entrancePair.entranceIndex)->sceneId)) {
this->opt = 1;
} else {
this->opt = 0;
@ -1793,8 +1794,10 @@ void Select_SwitchBetterWarpMode(SelectContext* this, u8 isBetterWarpMode) {
this->topDisplayedScene = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenTopDisplayedScene"), 0);
this->pageDownIndex = CVarGetInteger(CVAR_GENERAL("BetterDebugWarpScreenPageDownIndex"), 0);
BetterSceneSelectEntrancePair entrancePair = this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex];
if (entrancePair.canBeMQ && ResourceMgr_IsSceneMasterQuest(EntranceDB_Retrieve(entrancePair.entranceIndex)->sceneId)) {
BetterSceneSelectEntrancePair entrancePair =
this->betterScenes[this->currentScene].entrancePairs[this->pageDownIndex];
if (entrancePair.canBeMQ &&
ResourceMgr_IsSceneMasterQuest(EntranceDB_Retrieve(entrancePair.entranceIndex)->sceneId)) {
this->opt = 1;
}
}

View file

@ -254,9 +254,9 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) ||
CHECK_DUNGEON_ITEM(DUNGEON_MAP, gSaveContext.mapIndex)) {
if (i != (pauseCtx->dungeonMapSlot - 3)) {
gDPLoadTextureBlock(POLY_OPA_DISP++, floorIconTexs[entry->dungeonData.floors[i].id],
G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gDPLoadTextureBlock(POLY_OPA_DISP++, floorIconTexs[entry->dungeonData.floors[i].id], G_IM_FMT_IA,
G_IM_SIZ_8b, 24, 16, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
gSP1Quadrangle(POLY_OPA_DISP++, j, j + 2, j + 3, j + 1, 0);
}
@ -268,8 +268,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
gDPPipeSync(POLY_OPA_DISP++);
gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 150, 150, 255, pauseCtx->alpha);
gDPLoadTextureBlock(POLY_OPA_DISP++,
floorIconTexs[entry->dungeonData.floors[pauseCtx->dungeonMapSlot - 3].id],
gDPLoadTextureBlock(POLY_OPA_DISP++, floorIconTexs[entry->dungeonData.floors[pauseCtx->dungeonMapSlot - 3].id],
G_IM_FMT_IA, G_IM_SIZ_8b, 24, 16, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR,
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
@ -294,8 +293,7 @@ void KaleidoScope_DrawDungeonMap(PlayState* play, GraphicsContext* gfxCtx) {
gSP1Quadrangle(POLY_OPA_DISP++, 0, 2, 3, 1, 0);
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.mapIndex) &&
(entry->dungeonData.bossFloor != -1)) {
if (CHECK_DUNGEON_ITEM(DUNGEON_COMPASS, gSaveContext.mapIndex) && (entry->dungeonData.bossFloor != -1)) {
s16 skullFloorIconY = 51 - 14 * entry->dungeonData.bossFloor;
pauseCtx->mapPageVtx[120].v.ob[1] = pauseCtx->mapPageVtx[121].v.ob[1] = skullFloorIconY + pauseCtx->offsetY;
pauseCtx->mapPageVtx[122].v.ob[1] = pauseCtx->mapPageVtx[123].v.ob[1] = pauseCtx->mapPageVtx[120].v.ob[1] - 16;

View file

@ -100,8 +100,8 @@ void PauseMapMark_DrawForDungeon(PlayState* play) {
markInfo = &sMapMarkInfoTable[MAP_MARK_CHEST];
gDPLoadTextureBlock(POLY_OPA_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
markInfo->textureWidth, markInfo->textureHeight, 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);
markInfo->textureWidth, markInfo->textureHeight, 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);
for (s32 i = 0; i < floor->numChestMarks; i++) {
s32 display;
@ -113,13 +113,14 @@ void PauseMapMark_DrawForDungeon(PlayState* play) {
if (display) {
// Compute the offset to mirror icons over the map center (48) as an axis line
s16 mirrorOffset = CVarGetInteger("gMirroredWorld", 0) ? mirrorOffset = (48 - floor->chestMarks[i].x) * 2 + 1 : 0;
s16 mirrorOffset =
CVarGetInteger("gMirroredWorld", 0) ? mirrorOffset = (48 - floor->chestMarks[i].x) * 2 + 1 : 0;
Matrix_Push();
Matrix_Translate(GREG(92) + floor->chestMarks[i].x + mirrorOffset, GREG(93) + floor->chestMarks[i].y, 0.0f, MTXMODE_APPLY);
Matrix_Translate(GREG(92) + floor->chestMarks[i].x + mirrorOffset, GREG(93) + floor->chestMarks[i].y, 0.0f,
MTXMODE_APPLY);
Matrix_Scale(1.0f, 1.0f, 1.0f, MTXMODE_APPLY);
gSPMatrix(POLY_KAL_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_KAL_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_Pop();
gSPVertex(POLY_KAL_DISP++, sMarkChestVtx, 4, 0);
@ -129,17 +130,19 @@ void PauseMapMark_DrawForDungeon(PlayState* play) {
markInfo = &sMapMarkInfoTable[MAP_MARK_BOSS];
gDPLoadTextureBlock(POLY_OPA_DISP++, markInfo->texture, markInfo->imageFormat, G_IM_SIZ_MARK,
markInfo->textureWidth, markInfo->textureHeight, 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);
markInfo->textureWidth, markInfo->textureHeight, 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);
for (s32 i = 0; i < floor->numBossMarks; i++) {
// Compute the offset to mirror icons over the map center (48) as an axis line
s16 mirrorOffset = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0) ? mirrorOffset = (48 - floor->bossMarks[i].x) * 2 + 1 : 0;
s16 mirrorOffset = CVarGetInteger(CVAR_ENHANCEMENT("MirroredWorld"), 0)
? mirrorOffset = (48 - floor->bossMarks[i].x) * 2 + 1
: 0;
Matrix_Push();
Matrix_Translate(GREG(92) + floor->bossMarks[i].x + mirrorOffset, GREG(93) + floor->bossMarks[i].y, 0.0f, MTXMODE_APPLY);
Matrix_Translate(GREG(92) + floor->bossMarks[i].x + mirrorOffset, GREG(93) + floor->bossMarks[i].y, 0.0f,
MTXMODE_APPLY);
Matrix_Scale(scale, scale, scale, MTXMODE_APPLY);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(play->state.gfxCtx), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
Matrix_Pop();
gSPVertex(POLY_OPA_DISP++, sMarkBossVtx, 4, 0);
@ -154,7 +157,8 @@ void PauseMapMark_DrawForDungeon(PlayState* play) {
void PauseMapMark_Draw(PlayState* play) {
PauseMapMark_Init(play);
if (SceneDB_IsDungeon(play->sceneNum) || (CVarGetInteger(CVAR_ENHANCEMENT("PulsateBossIcon"), 0) != 0 && SceneDB_IsBoss(play->sceneNum))) {
if (SceneDB_IsDungeon(play->sceneNum) ||
(CVarGetInteger(CVAR_ENHANCEMENT("PulsateBossIcon"), 0) != 0 && SceneDB_IsBoss(play->sceneNum))) {
PauseMapMark_DrawForDungeon(play);
}