2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-14 01:26:09 +00:00

Move CVar* into Metaforce to begin removal of hecl's Dataspec

This commit is contained in:
2022-02-20 18:28:07 -08:00
parent 64d4b0388c
commit 6c92f03664
45 changed files with 712 additions and 571 deletions

View File

@@ -6,8 +6,8 @@
#include "Runtime/GameGlobalObjects.hpp"
#include "Runtime/Graphics/CTexture.hpp"
#include "Runtime/GuiSys/CStringTable.hpp"
#include <hecl/CVar.hpp>
#include <hecl/CVarManager.hpp>
#include "ConsoleVariables/CVar.hpp"
#include "ConsoleVariables/CVarManager.hpp"
namespace metaforce {
namespace {
@@ -16,8 +16,8 @@ using ECardResult = kabufuda::ECardResult;
static std::string g_CardImagePaths[2] = {};
static kabufuda::Card g_CardStates[2] = {kabufuda::Card{"GM8E", "01"}, kabufuda::Card{"GM8E", "01"}};
// static kabufuda::ECardResult g_OpResults[2] = {};
hecl::CVar* mc_dolphinAPath = nullptr;
hecl::CVar* mc_dolphinBPath = nullptr;
CVar* mc_dolphinAPath = nullptr;
CVar* mc_dolphinBPath = nullptr;
} // namespace
CSaveWorldIntermediate::CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw) : x0_mlvlId(mlvl), x8_savwId(savw) {
if (!savw.IsValid())
@@ -71,12 +71,12 @@ const CSaveWorldMemory& CMemoryCardSys::GetSaveWorldMemory(CAssetId wldId) const
}
CMemoryCardSys::CMemoryCardSys() {
mc_dolphinAPath = hecl::CVarManager::instance()->findOrMakeCVar(
mc_dolphinAPath = CVarManager::instance()->findOrMakeCVar(
"memcard.PathA"sv, "Path to the memory card image for SlotA"sv, ""sv,
(hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::System | hecl::CVar::EFlags::ModifyRestart));
mc_dolphinBPath = hecl::CVarManager::instance()->findOrMakeCVar(
(CVar::EFlags::Archive | CVar::EFlags::System | CVar::EFlags::ModifyRestart));
mc_dolphinBPath = CVarManager::instance()->findOrMakeCVar(
"memcard.PathB"sv, "Path to the memory card image for SlotB"sv, ""sv,
(hecl::CVar::EFlags::Archive | hecl::CVar::EFlags::System | hecl::CVar::EFlags::ModifyRestart));
(CVar::EFlags::Archive | CVar::EFlags::System | CVar::EFlags::ModifyRestart));
x0_hints = g_SimplePool->GetObj("HINT_Hints");
xc_memoryWorlds.reserve(16);
x1c_worldInter.emplace();
@@ -340,7 +340,7 @@ std::string CMemoryCardSys::_GetDolphinCardPath(kabufuda::ECardSlot slot) {
return g_CardImagePaths[static_cast<u32>(slot)];
}
void CMemoryCardSys::_ResolveDolphinCardPath(const hecl::CVar* cv, kabufuda::ECardSlot slot) {
void CMemoryCardSys::_ResolveDolphinCardPath(const CVar* cv, kabufuda::ECardSlot slot) {
if (cv != nullptr && cv->toLiteral().empty()) {
g_CardImagePaths[int(slot)] = ResolveDolphinCardPath(slot);
} else if (cv != nullptr) {