mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-04-28 13:17:58 +03:00
Remove region discovery as its not needed anymore.
This commit is contained in:
parent
c40a761227
commit
e88949506d
7 changed files with 6 additions and 56 deletions
|
@ -1694,41 +1694,4 @@ extern "C" {
|
|||
EntranceOverride* Randomizer_GetEntranceOverrides() {
|
||||
return Rando::Context::GetInstance()->GetEntranceShuffler()->entranceOverrides.data();
|
||||
}
|
||||
|
||||
void Randomizer_DiscoverRegion(Region* region, std::unordered_set<RandomizerRegion>& visitedRegions) {
|
||||
region->IsDiscovered = true;
|
||||
|
||||
for (const auto& exit : region->exits) {
|
||||
if (!exit.IsShuffled()) {
|
||||
RandomizerRegion connectedRegionKey = exit.GetConnectedRegionKey();
|
||||
if (visitedRegions.contains(connectedRegionKey)) {
|
||||
continue;
|
||||
}
|
||||
visitedRegions.insert(connectedRegionKey);
|
||||
|
||||
Randomizer_DiscoverRegion(exit.GetConnectedRegion(), visitedRegions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Randomizer_RegionDiscovered(RandomizerRegion region) {
|
||||
std::unordered_set<RandomizerRegion> visitedRegions;
|
||||
Randomizer_DiscoverRegion(&areaTable[region], visitedRegions);
|
||||
}
|
||||
|
||||
void Randomizer_EntranceDiscovered(s16 index, bool recalculateAvailableChecks) {
|
||||
auto entranceEntry = Rando::entranceMap.find(index);
|
||||
if (entranceEntry == Rando::entranceMap.end()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Rando::Entrance* entrance = entranceEntry->second;
|
||||
RandomizerRegion connectedRegionKey = entrance->GetConnectedRegionKey();
|
||||
|
||||
Randomizer_RegionDiscovered(connectedRegionKey);
|
||||
|
||||
if (recalculateAvailableChecks) {
|
||||
CheckTracker::RecalculateAvailableChecks();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -153,8 +153,6 @@ class EntranceShuffler {
|
|||
extern "C" {
|
||||
#endif
|
||||
EntranceOverride* Randomizer_GetEntranceOverrides();
|
||||
void Randomizer_RegionDiscovered(RandomizerRegion region);
|
||||
void Randomizer_EntranceDiscovered(s16 index, bool recalculateAvailableChecks);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -137,8 +137,6 @@ class Region {
|
|||
bool adultNight = false;
|
||||
bool addedToPool = false;
|
||||
|
||||
bool IsDiscovered = false;
|
||||
|
||||
void ApplyTimePass();
|
||||
|
||||
bool UpdateEvents();
|
||||
|
|
|
@ -585,12 +585,6 @@ void CheckTrackerLoadGame(int32_t fileNum) {
|
|||
|
||||
if (Rando::Context::GetInstance()->GetOption(RSK_SHUFFLE_ENTRANCES).Get()) {
|
||||
Rando::Context::GetInstance()->GetEntranceShuffler()->ApplyEntranceOverrides();
|
||||
|
||||
for (s16 entranceIndex = 0; entranceIndex < MAX_ENTRANCE_RANDO_USED_INDEX; entranceIndex++) {
|
||||
if (IsEntranceDiscovered(entranceIndex)) {
|
||||
Randomizer_EntranceDiscovered(entranceIndex, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RecalculateAvailableChecks();
|
||||
|
@ -2150,13 +2144,6 @@ void CheckTrackerSettingsWindow::DrawElement() {
|
|||
"with your current progress.")
|
||||
.Color(THEME_COLOR))) {
|
||||
enableAvailableChecks = CVarGetInteger(CVAR_TRACKER_CHECK("EnableAvailableChecks"), 0);
|
||||
|
||||
for (s16 entranceIndex = 0; entranceIndex < ENTR_MAX; entranceIndex++) {
|
||||
if (IsEntranceDiscovered(entranceIndex)) {
|
||||
Randomizer_EntranceDiscovered(entranceIndex, false);
|
||||
}
|
||||
}
|
||||
|
||||
RecalculateAvailableChecks();
|
||||
}
|
||||
ImGui::EndDisabled();
|
||||
|
|
|
@ -809,7 +809,7 @@ void Entrance_SetEntranceDiscovered(u16 entranceIndex, u8 isReversedEntrance) {
|
|||
if (idx < SAVEFILE_ENTRANCES_DISCOVERED_IDX_COUNT) {
|
||||
u32 entranceBit = 1 << (entranceIndex - (idx * bitsPerIndex));
|
||||
gSaveContext.ship.stats.entrancesDiscovered[idx] |= entranceBit;
|
||||
Randomizer_EntranceDiscovered(entranceIndex, true);
|
||||
CheckTracker_RecalculateAvailableChecks();
|
||||
|
||||
// Set reverse entrance when not decoupled
|
||||
if (!Randomizer_GetSettingValue(RSK_DECOUPLED_ENTRANCES) && !isReversedEntrance) {
|
||||
|
|
|
@ -2608,4 +2608,7 @@ void SoH_ProcessDroppedFiles(std::string filePath) {
|
|||
return;
|
||||
}
|
||||
}
|
||||
// #endregion
|
||||
|
||||
extern "C" void CheckTracker_RecalculateAvailableChecks() {
|
||||
CheckTracker::RecalculateAvailableChecks();
|
||||
}
|
||||
|
|
|
@ -163,6 +163,7 @@ void Gfx_UnregisterBlendedTexture(const char* name);
|
|||
void Gfx_TextureCacheDelete(const uint8_t* addr);
|
||||
void SaveManager_ThreadPoolWait();
|
||||
void CheckTracker_OnMessageClose();
|
||||
void CheckTracker_RecalculateAvailableChecks();
|
||||
|
||||
GetItemID RetrieveGetItemIDFromItemID(ItemID itemID);
|
||||
RandomizerGet RetrieveRandomizerGetFromItemID(ItemID itemID);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue