mirror of https://github.com/AxioDL/metaforce.git
Rename CSavwWorld to CWorldSaveGameInfo
This commit is contained in:
parent
354d3a0199
commit
95f44be694
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace metaforce {
|
||||
|
||||
CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CSaveWorld& savw, CAssetId mlvlId) {
|
||||
CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CWorldSaveGameInfo& savw, CAssetId mlvlId) {
|
||||
const CSaveWorldMemory& worldMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId);
|
||||
|
||||
x4_visitedAreas.reserve((worldMem.GetAreaCount() + 31) / 32);
|
||||
|
@ -27,7 +27,7 @@ CMapWorldInfo::CMapWorldInfo(CBitStreamReader& reader, const CSaveWorld& savw, C
|
|||
x38_mapStationUsed = reader.ReadEncoded(1) != 0;
|
||||
}
|
||||
|
||||
void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CSaveWorld& savw, CAssetId mlvlId) const {
|
||||
void CMapWorldInfo::PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const {
|
||||
const CSaveWorldMemory& worldMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId);
|
||||
|
||||
for (u32 i = 0; i < worldMem.GetAreaCount(); ++i) {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include "Runtime/RetroTypes.hpp"
|
||||
|
||||
namespace metaforce {
|
||||
class CSaveWorld;
|
||||
class CWorldSaveGameInfo;
|
||||
|
||||
class CMapWorldInfo {
|
||||
mutable u32 x0_visitedAreasAllocated = 0;
|
||||
|
@ -18,8 +18,8 @@ class CMapWorldInfo {
|
|||
|
||||
public:
|
||||
CMapWorldInfo() = default;
|
||||
explicit CMapWorldInfo(CBitStreamReader& reader, const CSaveWorld& saveWorld, CAssetId mlvlId);
|
||||
void PutTo(CBitStreamWriter& writer, const CSaveWorld& savw, CAssetId mlvlId) const;
|
||||
explicit CMapWorldInfo(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld, CAssetId mlvlId);
|
||||
void PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw, CAssetId mlvlId) const;
|
||||
bool IsMapped(TAreaId aid) const;
|
||||
void SetIsMapped(TAreaId aid, bool mapped);
|
||||
void SetDoorVisited(TEditorId eid, bool val);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include "Runtime/CGameHintInfo.hpp"
|
||||
#include "Runtime/CGameState.hpp"
|
||||
#include "Runtime/CMemoryCardSys.hpp"
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CSimplePool.hpp"
|
||||
#include "Runtime/CStateManager.hpp"
|
||||
#include "Runtime/GameGlobalObjects.hpp"
|
||||
|
@ -120,7 +120,7 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) {
|
|||
const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds();
|
||||
size_t cinematicCount = 0;
|
||||
for (const auto& world : memWorlds) {
|
||||
TLockedToken<CSaveWorld> saveWorld =
|
||||
TLockedToken<CWorldSaveGameInfo> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.second.GetSaveWorldAssetId()});
|
||||
cinematicCount += saveWorld->GetCinematicCount();
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ CPersistentOptions::CPersistentOptions(CBitStreamReader& stream) {
|
|||
}
|
||||
|
||||
for (const auto& world : memWorlds) {
|
||||
TLockedToken<CSaveWorld> saveWorld =
|
||||
TLockedToken<CWorldSaveGameInfo> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.second.GetSaveWorldAssetId()});
|
||||
|
||||
auto stateIt = cinematicStates.cbegin();
|
||||
|
@ -164,7 +164,7 @@ void CPersistentOptions::PutTo(CBitStreamWriter& w) const {
|
|||
|
||||
const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds();
|
||||
for (const auto& world : memWorlds) {
|
||||
const TLockedToken<CSaveWorld> saveWorld =
|
||||
const TLockedToken<CWorldSaveGameInfo> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), world.second.GetSaveWorldAssetId()});
|
||||
|
||||
for (const auto& cineId : saveWorld->GetCinematics()) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
#include "Runtime/Audio/CAudioSys.hpp"
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "Runtime/CGameState.hpp"
|
||||
|
||||
#include "Runtime/CMemoryCardSys.hpp"
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CSimplePool.hpp"
|
||||
#include "Runtime/GameGlobalObjects.hpp"
|
||||
#include "Runtime/IOStreams.hpp"
|
||||
|
@ -23,7 +23,7 @@ union BitsToDouble {
|
|||
double doub;
|
||||
};
|
||||
|
||||
CScriptLayerManager::CScriptLayerManager(CBitStreamReader& reader, const CSaveWorld& saveWorld) {
|
||||
CScriptLayerManager::CScriptLayerManager(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld) {
|
||||
const u32 bitCount = reader.ReadEncoded(10);
|
||||
x10_saveLayers.reserve(bitCount);
|
||||
|
||||
|
@ -81,7 +81,7 @@ CWorldState::CWorldState(CAssetId id) : x0_mlvlId(id), x4_areaId(0) {
|
|||
x14_layerState = std::make_shared<CScriptLayerManager>();
|
||||
}
|
||||
|
||||
CWorldState::CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CSaveWorld& saveWorld) : x0_mlvlId(mlvlId) {
|
||||
CWorldState::CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld) : x0_mlvlId(mlvlId) {
|
||||
x4_areaId = TAreaId(reader.ReadEncoded(32));
|
||||
x10_desiredAreaAssetId = u32(reader.ReadEncoded(32));
|
||||
x8_mailbox = std::make_shared<CScriptMailbox>(reader, saveWorld);
|
||||
|
@ -89,7 +89,7 @@ CWorldState::CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CSaveW
|
|||
x14_layerState = std::make_shared<CScriptLayerManager>(reader, saveWorld);
|
||||
}
|
||||
|
||||
void CWorldState::PutTo(CBitStreamWriter& writer, const CSaveWorld& savw) const {
|
||||
void CWorldState::PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw) const {
|
||||
writer.WriteEncoded(x4_areaId, 32);
|
||||
writer.WriteEncoded(u32(x10_desiredAreaAssetId.Value()), 32);
|
||||
x8_mailbox->PutTo(writer, savw);
|
||||
|
@ -175,7 +175,7 @@ CGameState::CGameState(CBitStreamReader& stream, u32 saveIdx) : x20c_saveFileIdx
|
|||
const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds();
|
||||
x88_worldStates.reserve(memWorlds.size());
|
||||
for (const auto& memWorld : memWorlds) {
|
||||
TLockedToken<CSaveWorld> saveWorld =
|
||||
TLockedToken<CWorldSaveGameInfo> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), memWorld.second.GetSaveWorldAssetId()});
|
||||
x88_worldStates.emplace_back(stream, memWorld.first, *saveWorld);
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ void CGameState::PutTo(CBitStreamWriter& writer) {
|
|||
|
||||
const auto& memWorlds = g_MemoryCardSys->GetMemoryWorlds();
|
||||
for (const auto& memWorld : memWorlds) {
|
||||
TLockedToken<CSaveWorld> saveWorld =
|
||||
TLockedToken<CWorldSaveGameInfo> saveWorld =
|
||||
g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), memWorld.second.GetSaveWorldAssetId()});
|
||||
const CWorldState& wld = StateForWorld(memWorld.first);
|
||||
wld.PutTo(writer, *saveWorld);
|
||||
|
|
|
@ -24,7 +24,7 @@ class CScriptLayerManager {
|
|||
|
||||
public:
|
||||
CScriptLayerManager() = default;
|
||||
CScriptLayerManager(CBitStreamReader& reader, const CSaveWorld& saveWorld);
|
||||
CScriptLayerManager(CBitStreamReader& reader, const CWorldSaveGameInfo& saveWorld);
|
||||
|
||||
bool IsLayerActive(int areaIdx, int layerIdx) const { return ((x0_areaLayers[areaIdx].m_layerBits >> layerIdx) & 1); }
|
||||
|
||||
|
@ -53,7 +53,7 @@ class CWorldState {
|
|||
|
||||
public:
|
||||
explicit CWorldState(CAssetId id);
|
||||
CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CSaveWorld& saveWorld);
|
||||
CWorldState(CBitStreamReader& reader, CAssetId mlvlId, const CWorldSaveGameInfo& saveWorld);
|
||||
CAssetId GetWorldAssetId() const { return x0_mlvlId; }
|
||||
void SetAreaId(TAreaId aid) { x4_areaId = aid; }
|
||||
TAreaId GetCurrentAreaId() const { return x4_areaId; }
|
||||
|
@ -62,7 +62,7 @@ public:
|
|||
const std::shared_ptr<CScriptMailbox>& Mailbox() const { return x8_mailbox; }
|
||||
const std::shared_ptr<CMapWorldInfo>& MapWorldInfo() const { return xc_mapWorldInfo; }
|
||||
const std::shared_ptr<CScriptLayerManager>& GetLayerState() const { return x14_layerState; }
|
||||
void PutTo(CBitStreamWriter& writer, const CSaveWorld& savw) const;
|
||||
void PutTo(CBitStreamWriter& writer, const CWorldSaveGameInfo& savw) const;
|
||||
};
|
||||
|
||||
class CGameState {
|
||||
|
|
|
@ -76,7 +76,7 @@ set(RUNTIME_SOURCES_B
|
|||
CGameAllocator.hpp CGameAllocator.cpp
|
||||
CMemoryCardSys.hpp CMemoryCardSys.cpp
|
||||
CScannableObjectInfo.hpp CScannableObjectInfo.cpp
|
||||
CSaveWorld.hpp CSaveWorld.cpp
|
||||
CWorldSaveGameInfo.hpp CWorldSaveGameInfo.cpp
|
||||
CDependencyGroup.hpp CDependencyGroup.cpp
|
||||
CBasics.hpp CBasicsPC.cpp
|
||||
CIOWin.hpp
|
||||
|
|
|
@ -128,11 +128,11 @@ bool CMemoryCardSys::InitializePump() {
|
|||
wldMemOut.xc_areaIds = world.xc_areaIds;
|
||||
wldMemOut.x1c_defaultLayerStates = world.x1c_defaultLayerStates;
|
||||
|
||||
CSaveWorld& savw = *world.x34_saveWorld;
|
||||
CWorldSaveGameInfo& savw = *world.x34_saveWorld;
|
||||
wldMemOut.x8_areaCount = savw.GetAreaCount();
|
||||
|
||||
x20_scanStates.reserve(x20_scanStates.size() + savw.GetScans().size());
|
||||
for (const CSaveWorld::SScanState& scan : savw.GetScans()) {
|
||||
for (const CWorldSaveGameInfo::SScanState& scan : savw.GetScans()) {
|
||||
const auto scanStateIter = std::find_if(x20_scanStates.cbegin(), x20_scanStates.cend(), [&](const auto& test) {
|
||||
return test.first == scan.x0_id && test.second == scan.x4_category;
|
||||
});
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <vector>
|
||||
|
||||
#include "Runtime/CGameHintInfo.hpp"
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CToken.hpp"
|
||||
#include "Runtime/rstl.hpp"
|
||||
#include "Runtime/GuiSys/CStringTable.hpp"
|
||||
|
@ -27,7 +27,7 @@ class CSaveWorldMemory {
|
|||
std::vector<s32> xc_areaIds;
|
||||
std::vector<CWorldLayers::Area> x1c_defaultLayerStates;
|
||||
TLockedToken<CStringTable> x2c_worldName; /* used to be optional */
|
||||
TLockedToken<CSaveWorld> x3c_saveWorld; /* used to be optional */
|
||||
TLockedToken<CWorldSaveGameInfo> x3c_saveWorld; /* used to be optional */
|
||||
|
||||
public:
|
||||
CAssetId GetWorldNameId() const { return x0_strgId; }
|
||||
|
@ -35,7 +35,7 @@ public:
|
|||
u32 GetAreaCount() const { return x8_areaCount; }
|
||||
const std::vector<CWorldLayers::Area>& GetDefaultLayerStates() const { return x1c_defaultLayerStates; }
|
||||
const TLockedToken<CStringTable>& GetWorldName() const { return x2c_worldName; }
|
||||
const TLockedToken<CSaveWorld>& GetSaveWorld() const { return x3c_saveWorld; }
|
||||
const TLockedToken<CWorldSaveGameInfo>& GetSaveWorld() const { return x3c_saveWorld; }
|
||||
const char16_t* GetFrontEndName() const {
|
||||
if (!x2c_worldName)
|
||||
return u"";
|
||||
|
@ -51,7 +51,7 @@ class CSaveWorldIntermediate {
|
|||
std::vector<s32> xc_areaIds;
|
||||
std::vector<CWorldLayers::Area> x1c_defaultLayerStates;
|
||||
std::unique_ptr<CDummyWorld> x2c_dummyWorld;
|
||||
TLockedToken<CSaveWorld> x34_saveWorld; /* Used to be auto_ptr */
|
||||
TLockedToken<CWorldSaveGameInfo> x34_saveWorld; /* Used to be auto_ptr */
|
||||
|
||||
public:
|
||||
CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw);
|
||||
|
@ -63,7 +63,7 @@ class CMemoryCardSys {
|
|||
TLockedToken<CGameHintInfo> x0_hints;
|
||||
std::vector<std::pair<CAssetId, CSaveWorldMemory>> xc_memoryWorlds; /* MLVL as key */
|
||||
std::optional<std::vector<CSaveWorldIntermediate>> x1c_worldInter; /* used to be auto_ptr of vector */
|
||||
std::vector<std::pair<CAssetId, CSaveWorld::EScanCategory>> x20_scanStates;
|
||||
std::vector<std::pair<CAssetId, CWorldSaveGameInfo::EScanCategory>> x20_scanStates;
|
||||
rstl::reserved_vector<u32, 6> x30_scanCategoryCounts;
|
||||
|
||||
public:
|
||||
|
@ -92,12 +92,12 @@ public:
|
|||
using CardStat = kabufuda::CardStat;
|
||||
const std::vector<CGameHintInfo::CGameHint>& GetHints() const { return x0_hints->GetHints(); }
|
||||
const std::vector<std::pair<CAssetId, CSaveWorldMemory>>& GetMemoryWorlds() const { return xc_memoryWorlds; }
|
||||
const std::vector<std::pair<CAssetId, CSaveWorld::EScanCategory>>& GetScanStates() const { return x20_scanStates; }
|
||||
u32 GetScanCategoryCount(CSaveWorld::EScanCategory cat) const { return x30_scanCategoryCounts[int(cat)]; }
|
||||
const std::vector<std::pair<CAssetId, CWorldSaveGameInfo::EScanCategory>>& GetScanStates() const { return x20_scanStates; }
|
||||
u32 GetScanCategoryCount(CWorldSaveGameInfo::EScanCategory cat) const { return x30_scanCategoryCounts[int(cat)]; }
|
||||
|
||||
std::vector<std::pair<CAssetId, CSaveWorld::EScanCategory>>::const_iterator LookupScanState(CAssetId id) const {
|
||||
std::vector<std::pair<CAssetId, CWorldSaveGameInfo::EScanCategory>>::const_iterator LookupScanState(CAssetId id) const {
|
||||
return rstl::binary_find(x20_scanStates.cbegin(), x20_scanStates.cend(), id,
|
||||
[](const std::pair<CAssetId, CSaveWorld::EScanCategory>& p) { return p.first; });
|
||||
[](const std::pair<CAssetId, CWorldSaveGameInfo::EScanCategory>& p) { return p.first; });
|
||||
}
|
||||
|
||||
bool HasSaveWorldMemory(CAssetId wldId) const;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "Runtime/CScriptMailbox.hpp"
|
||||
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CStateManager.hpp"
|
||||
#include "Runtime/World/CWorld.hpp"
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
|||
|
||||
namespace metaforce {
|
||||
|
||||
CScriptMailbox::CScriptMailbox(CBitStreamReader& in, const CSaveWorld& saveWorld) {
|
||||
CScriptMailbox::CScriptMailbox(CBitStreamReader& in, const CWorldSaveGameInfo& saveWorld) {
|
||||
const u32 relayCount = saveWorld.GetRelayCount();
|
||||
if (saveWorld.GetRelayCount()) {
|
||||
std::vector<bool> relayStates(saveWorld.GetRelayCount());
|
||||
|
@ -79,7 +79,7 @@ void CScriptMailbox::SendMsgs(TAreaId areaId, CStateManager& stateMgr) {
|
|||
}
|
||||
}
|
||||
|
||||
void CScriptMailbox::PutTo(CBitStreamWriter& out, const CSaveWorld& saveWorld) {
|
||||
void CScriptMailbox::PutTo(CBitStreamWriter& out, const CWorldSaveGameInfo& saveWorld) {
|
||||
const u32 relayCount = saveWorld.GetRelayCount();
|
||||
std::vector<bool> relays(relayCount);
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
#include "Runtime/World/ScriptObjectSupport.hpp"
|
||||
|
||||
namespace metaforce {
|
||||
class CSaveWorld;
|
||||
class CWorldSaveGameInfo;
|
||||
class CStateManager;
|
||||
|
||||
#if 0
|
||||
|
@ -29,13 +29,13 @@ class CScriptMailbox {
|
|||
|
||||
public:
|
||||
CScriptMailbox() = default;
|
||||
CScriptMailbox(CBitStreamReader& in, const CSaveWorld& saveWorld);
|
||||
CScriptMailbox(CBitStreamReader& in, const CWorldSaveGameInfo& saveWorld);
|
||||
|
||||
bool HasMsg(TEditorId id) const;
|
||||
void AddMsg(TEditorId id);
|
||||
void RemoveMsg(TEditorId id);
|
||||
void SendMsgs(TAreaId areaId, CStateManager& stateMgr);
|
||||
void PutTo(CBitStreamWriter& out, const CSaveWorld& saveWorld);
|
||||
void PutTo(CBitStreamWriter& out, const CWorldSaveGameInfo& saveWorld);
|
||||
};
|
||||
|
||||
} // namespace metaforce
|
||||
|
|
|
@ -2870,7 +2870,7 @@ std::pair<u32, u32> CStateManager::CalculateScanCompletionRate() const {
|
|||
int idx = 0;
|
||||
for (const std::pair<CAssetId, float>& scan : x8b8_playerState->GetScanTimes()) {
|
||||
const auto category = g_MemoryCardSys->GetScanStates()[idx++].second;
|
||||
if (category != CSaveWorld::EScanCategory::None && category != CSaveWorld::EScanCategory::Research) {
|
||||
if (category != CWorldSaveGameInfo::EScanCategory::None && category != CWorldSaveGameInfo::EScanCategory::Research) {
|
||||
++denom;
|
||||
if (scan.second == 1.f) {
|
||||
++num;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
|
||||
#include "Runtime/CToken.hpp"
|
||||
|
||||
namespace metaforce {
|
||||
CSaveWorld::CSaveWorld(CInputStream& in) {
|
||||
CWorldSaveGameInfo::CWorldSaveGameInfo(CInputStream& in) {
|
||||
in.readUint32Big();
|
||||
const u32 version = in.readUint32Big();
|
||||
if (version > 1) {
|
||||
|
@ -51,41 +51,41 @@ CSaveWorld::CSaveWorld(CInputStream& in) {
|
|||
}
|
||||
}
|
||||
|
||||
u32 CSaveWorld::GetAreaCount() const { return x0_areaCount; }
|
||||
u32 CWorldSaveGameInfo::GetAreaCount() const { return x0_areaCount; }
|
||||
|
||||
u32 CSaveWorld::GetCinematicCount() const { return x4_cinematics.size(); }
|
||||
u32 CWorldSaveGameInfo::GetCinematicCount() const { return x4_cinematics.size(); }
|
||||
|
||||
s32 CSaveWorld::GetCinematicIndex(const TEditorId& id) const {
|
||||
s32 CWorldSaveGameInfo::GetCinematicIndex(const TEditorId& id) const {
|
||||
auto it = std::find(x4_cinematics.begin(), x4_cinematics.end(), id);
|
||||
if (it == x4_cinematics.end())
|
||||
return -1;
|
||||
return it - x4_cinematics.begin();
|
||||
}
|
||||
|
||||
u32 CSaveWorld::GetRelayCount() const { return x14_relays.size(); }
|
||||
u32 CWorldSaveGameInfo::GetRelayCount() const { return x14_relays.size(); }
|
||||
|
||||
s32 CSaveWorld::GetRelayIndex(const TEditorId& id) const {
|
||||
s32 CWorldSaveGameInfo::GetRelayIndex(const TEditorId& id) const {
|
||||
auto it = std::find(x14_relays.begin(), x14_relays.end(), id);
|
||||
if (it == x14_relays.end())
|
||||
return -1;
|
||||
return it - x14_relays.begin();
|
||||
}
|
||||
|
||||
TEditorId CSaveWorld::GetRelayEditorId(u32 idx) const { return x14_relays[idx]; }
|
||||
TEditorId CWorldSaveGameInfo::GetRelayEditorId(u32 idx) const { return x14_relays[idx]; }
|
||||
|
||||
u32 CSaveWorld::GetDoorCount() const { return x34_doors.size(); }
|
||||
u32 CWorldSaveGameInfo::GetDoorCount() const { return x34_doors.size(); }
|
||||
|
||||
s32 CSaveWorld::GetDoorIndex(const TEditorId& id) const {
|
||||
s32 CWorldSaveGameInfo::GetDoorIndex(const TEditorId& id) const {
|
||||
auto it = std::find(x34_doors.begin(), x34_doors.end(), id);
|
||||
if (it == x34_doors.end())
|
||||
return -1;
|
||||
return it - x34_doors.begin();
|
||||
}
|
||||
|
||||
CFactoryFnReturn FSaveWorldFactory([[maybe_unused]] const SObjectTag& tag, CInputStream& in,
|
||||
CFactoryFnReturn FWorldSaveGameInfoFactory([[maybe_unused]] const SObjectTag& tag, CInputStream& in,
|
||||
[[maybe_unused]] const CVParamTransfer& param,
|
||||
[[maybe_unused]] CObjectReference* selfRef) {
|
||||
return TToken<CSaveWorld>::GetIObjObjectFor(std::make_unique<CSaveWorld>(in));
|
||||
return TToken<CWorldSaveGameInfo>::GetIObjObjectFor(std::make_unique<CWorldSaveGameInfo>(in));
|
||||
}
|
||||
|
||||
} // namespace metaforce
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace metaforce {
|
||||
|
||||
class CSaveWorld {
|
||||
class CWorldSaveGameInfo {
|
||||
public:
|
||||
using EScanCategory = DataSpec::SAVWCommon::EScanCategory;
|
||||
struct SScanState {
|
||||
|
@ -31,7 +31,7 @@ private:
|
|||
std::vector<SScanState> x44_scans;
|
||||
|
||||
public:
|
||||
explicit CSaveWorld(CInputStream& in);
|
||||
explicit CWorldSaveGameInfo(CInputStream& in);
|
||||
u32 GetAreaCount() const;
|
||||
u32 GetCinematicCount() const;
|
||||
s32 GetCinematicIndex(const TEditorId& id) const;
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
s32 GetDoorIndex(const TEditorId& id) const;
|
||||
};
|
||||
|
||||
CFactoryFnReturn FSaveWorldFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& param,
|
||||
CFactoryFnReturn FWorldSaveGameInfoFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& param,
|
||||
CObjectReference* selfRef);
|
||||
|
||||
} // namespace metaforce
|
|
@ -5,7 +5,7 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CToken.hpp"
|
||||
#include "Runtime/RetroTypes.hpp"
|
||||
#include "Runtime/GuiSys/CGuiWidget.hpp"
|
||||
|
|
|
@ -32,7 +32,7 @@ class CGuiTableGroup;
|
|||
class CGuiTextPane;
|
||||
class CGuiWidget;
|
||||
class CMoviePlayer;
|
||||
class CSaveWorld;
|
||||
class CWorldSaveGameInfo;
|
||||
class CStringTable;
|
||||
class CTexture;
|
||||
struct SObjectTag;
|
||||
|
|
|
@ -29,10 +29,10 @@ CLogBookScreen::~CLogBookScreen() {
|
|||
CMain::EnsureWorldPakReady(g_GameState->CurrentWorldAssetId());
|
||||
}
|
||||
|
||||
bool CLogBookScreen::IsScanComplete(CSaveWorld::EScanCategory category, CAssetId scan,
|
||||
bool CLogBookScreen::IsScanComplete(CWorldSaveGameInfo::EScanCategory category, CAssetId scan,
|
||||
const CPlayerState& playerState) {
|
||||
const float time = playerState.GetScanTime(scan);
|
||||
if (category == CSaveWorld::EScanCategory::Artifact) {
|
||||
if (category == CWorldSaveGameInfo::EScanCategory::Artifact) {
|
||||
return time >= 0.5f;
|
||||
} else {
|
||||
return time >= 1.f;
|
||||
|
@ -41,12 +41,12 @@ bool CLogBookScreen::IsScanComplete(CSaveWorld::EScanCategory category, CAssetId
|
|||
|
||||
void CLogBookScreen::InitializeLogBook() {
|
||||
for (size_t i = 0; i < x19c_scanCompletes.size(); ++i) {
|
||||
x19c_scanCompletes[i].reserve(g_MemoryCardSys->GetScanCategoryCount(CSaveWorld::EScanCategory(i + 1)));
|
||||
x19c_scanCompletes[i].reserve(g_MemoryCardSys->GetScanCategoryCount(CWorldSaveGameInfo::EScanCategory(i + 1)));
|
||||
}
|
||||
|
||||
CPlayerState& playerState = *x4_mgr.GetPlayerState();
|
||||
for (const auto& [scanId, scanCategory] : g_MemoryCardSys->GetScanStates()) {
|
||||
if (scanCategory == CSaveWorld::EScanCategory::None) {
|
||||
if (scanCategory == CWorldSaveGameInfo::EScanCategory::None) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -164,7 +164,7 @@ void CLogBookScreen::PumpArticleLoad() {
|
|||
}
|
||||
}
|
||||
|
||||
bool CLogBookScreen::IsScanCategoryReady(CSaveWorld::EScanCategory category) const {
|
||||
bool CLogBookScreen::IsScanCategoryReady(CWorldSaveGameInfo::EScanCategory category) const {
|
||||
const CPlayerState& playerState = *x4_mgr.GetPlayerState();
|
||||
const auto& scanState = g_MemoryCardSys->GetScanStates();
|
||||
|
||||
|
@ -381,7 +381,7 @@ bool CLogBookScreen::VReady() const { return true; }
|
|||
|
||||
void CLogBookScreen::VActivate() {
|
||||
for (int i = 0; i < int(xa8_textpane_categories.size()); ++i) {
|
||||
if (IsScanCategoryReady(CSaveWorld::EScanCategory(i + 1))) {
|
||||
if (IsScanCategoryReady(CWorldSaveGameInfo::EScanCategory(i + 1))) {
|
||||
xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 1));
|
||||
} else {
|
||||
xa8_textpane_categories[i]->TextSupport().SetText(u"??????");
|
||||
|
@ -430,7 +430,7 @@ void CLogBookScreen::UpdateRightTable() {
|
|||
bool CLogBookScreen::ShouldLeftTableAdvance() const {
|
||||
if (!x260_24_loaded || x1f0_curViewScans.empty())
|
||||
return false;
|
||||
return IsScanCategoryReady(CSaveWorld::EScanCategory(x70_tablegroup_leftlog->GetUserSelection() + 1));
|
||||
return IsScanCategoryReady(CWorldSaveGameInfo::EScanCategory(x70_tablegroup_leftlog->GetUserSelection() + 1));
|
||||
}
|
||||
|
||||
bool CLogBookScreen::ShouldRightTableAdvance() const {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CToken.hpp"
|
||||
#include "Runtime/rstl.hpp"
|
||||
#include "Runtime/MP1/CPauseScreenBase.hpp"
|
||||
|
@ -37,13 +37,13 @@ class CLogBookScreen : public CPauseScreenBase {
|
|||
void InitializeLogBook();
|
||||
void UpdateRightTitles();
|
||||
void PumpArticleLoad();
|
||||
bool IsScanCategoryReady(CSaveWorld::EScanCategory category) const;
|
||||
bool IsScanCategoryReady(CWorldSaveGameInfo::EScanCategory category) const;
|
||||
void UpdateBodyText();
|
||||
void UpdateBodyImagesAndText();
|
||||
int NextSurroundingArticleIndex(int cur) const;
|
||||
bool IsArtifactCategorySelected() const;
|
||||
int GetSelectedArtifactHeadScanIndex() const;
|
||||
static bool IsScanComplete(CSaveWorld::EScanCategory category, CAssetId scan, const CPlayerState& playerState);
|
||||
static bool IsScanComplete(CWorldSaveGameInfo::EScanCategory category, CAssetId scan, const CPlayerState& playerState);
|
||||
|
||||
public:
|
||||
CLogBookScreen(const CStateManager& mgr, CGuiFrame& frame, const CStringTable& pauseStrg);
|
||||
|
|
|
@ -99,7 +99,7 @@ bool CSaveGameScreen::PumpLoad() {
|
|||
if (!x38_strgMemoryCard.IsLoaded()) {
|
||||
return false;
|
||||
}
|
||||
for (TLockedToken<CSaveWorld>& savw : x70_saveWorlds) {
|
||||
for (TLockedToken<CWorldSaveGameInfo>& savw : x70_saveWorlds) {
|
||||
if (!savw.IsLoaded()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
namespace metaforce {
|
||||
class CGuiTableGroup;
|
||||
class CGuiTextPane;
|
||||
class CSaveWorld;
|
||||
class CWorldSaveGameInfo;
|
||||
class CStringTable;
|
||||
class CTexture;
|
||||
struct CFinalInput;
|
||||
|
@ -75,7 +75,7 @@ private:
|
|||
CGuiTextPane* x64_textpane_choice2{};
|
||||
CGuiTextPane* x68_textpane_choice3{};
|
||||
std::unique_ptr<CMemoryCardDriver> x6c_cardDriver;
|
||||
std::vector<TLockedToken<CSaveWorld>> x70_saveWorlds;
|
||||
std::vector<TLockedToken<CWorldSaveGameInfo>> x70_saveWorlds;
|
||||
CIOWin::EMessageReturn x80_iowRet = CIOWin::EMessageReturn::Normal;
|
||||
u32 x84_navConfirmSfx = SFXui_frontend_save_confirm;
|
||||
u32 x88_navMoveSfx = SFXui_frontend_save_move;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include "Runtime/CDependencyGroup.hpp"
|
||||
#include "Runtime/CGameHintInfo.hpp"
|
||||
#include "Runtime/CSaveWorld.hpp"
|
||||
#include "Runtime/CWorldSaveGameInfo.hpp"
|
||||
#include "Runtime/CScannableObjectInfo.hpp"
|
||||
#include "Runtime/CStateManager.hpp"
|
||||
#include "Runtime/CStopwatch.hpp"
|
||||
|
@ -311,7 +311,7 @@ void CGameGlobalObjects::AddPaksAndFactories() {
|
|||
fmgr->AddFactory(FOURCC('ATBL'), FFactoryFunc(FAudioTranslationTableFactory));
|
||||
fmgr->AddFactory(FOURCC('STRG'), FFactoryFunc(FStringTableFactory));
|
||||
fmgr->AddFactory(FOURCC('HINT'), FFactoryFunc(FHintFactory));
|
||||
fmgr->AddFactory(FOURCC('SAVW'), FFactoryFunc(FSaveWorldFactory));
|
||||
fmgr->AddFactory(FOURCC('SAVW'), FFactoryFunc(FWorldSaveGameInfoFactory));
|
||||
fmgr->AddFactory(FOURCC('MAPW'), FFactoryFunc(FMapWorldFactory));
|
||||
fmgr->AddFactory(FOURCC('SCAN'), FFactoryFunc(FScannableObjectInfoFactory));
|
||||
fmgr->AddFactory(FOURCC('CRSC'), FFactoryFunc(FCollisionResponseDataFactory));
|
||||
|
|
|
@ -1245,9 +1245,9 @@ static bool IsDataLoreResearchScan(CAssetId id) {
|
|||
}
|
||||
|
||||
switch (it->second) {
|
||||
case CSaveWorld::EScanCategory::Data:
|
||||
case CSaveWorld::EScanCategory::Lore:
|
||||
case CSaveWorld::EScanCategory::Research:
|
||||
case CWorldSaveGameInfo::EScanCategory::Data:
|
||||
case CWorldSaveGameInfo::EScanCategory::Lore:
|
||||
case CWorldSaveGameInfo::EScanCategory::Research:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue