mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-04 15:55:51 +00:00
General resource handling bug fixes
This commit is contained in:
parent
8cef6ce5e0
commit
2df95c01cf
@ -531,6 +531,21 @@ struct ANCS : BigYAML
|
|||||||
trans->enumeratePrimitives(func);
|
trans->enumeratePrimitives(func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gatherDependencies(std::vector<hecl::ProjectPath>& pathsOut) const
|
||||||
|
{
|
||||||
|
for (const CharacterSet::CharacterInfo& ci : characterSet.characters)
|
||||||
|
{
|
||||||
|
for (const auto& id : ci.partResData.part)
|
||||||
|
g_curSpec->flattenDependencies(id, pathsOut);
|
||||||
|
for (const auto& id : ci.partResData.swhc)
|
||||||
|
g_curSpec->flattenDependencies(id, pathsOut);
|
||||||
|
for (const auto& id : ci.partResData.unk)
|
||||||
|
g_curSpec->flattenDependencies(id, pathsOut);
|
||||||
|
for (const auto& id : ci.partResData.elsc)
|
||||||
|
g_curSpec->flattenDependencies(id, pathsOut);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static bool Extract(const SpecBase& dataSpec,
|
static bool Extract(const SpecBase& dataSpec,
|
||||||
PAKEntryReadStream& rs,
|
PAKEntryReadStream& rs,
|
||||||
const hecl::ProjectPath& outPath,
|
const hecl::ProjectPath& outPath,
|
||||||
|
@ -400,6 +400,14 @@ void SpecBase::flattenDependencies(const hecl::ProjectPath& path,
|
|||||||
if (evntPath.isFile())
|
if (evntPath.isFile())
|
||||||
pathsOut.push_back(evntPath);
|
pathsOut.push_back(evntPath);
|
||||||
}
|
}
|
||||||
|
ds.close();
|
||||||
|
|
||||||
|
hecl::ProjectPath yamlPath = asGlob.getWithExtension(_S(".yaml"), true);
|
||||||
|
if (yamlPath.isFile())
|
||||||
|
{
|
||||||
|
athena::io::FileReader reader(yamlPath.getAbsolutePath());
|
||||||
|
flattenDependenciesANCSYAML(reader, pathsOut);
|
||||||
|
}
|
||||||
|
|
||||||
pathsOut.push_back(asGlob);
|
pathsOut.push_back(asGlob);
|
||||||
return;
|
return;
|
||||||
|
@ -106,6 +106,7 @@ struct SpecBase : hecl::Database::IDataSpec
|
|||||||
void flattenDependencies(const class UniqueID32& id, std::vector<hecl::ProjectPath>& pathsOut);
|
void flattenDependencies(const class UniqueID32& id, std::vector<hecl::ProjectPath>& pathsOut);
|
||||||
void flattenDependencies(const class UniqueID64& id, std::vector<hecl::ProjectPath>& pathsOut);
|
void flattenDependencies(const class UniqueID64& id, std::vector<hecl::ProjectPath>& pathsOut);
|
||||||
virtual void flattenDependenciesYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)=0;
|
virtual void flattenDependenciesYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)=0;
|
||||||
|
virtual void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)=0;
|
||||||
|
|
||||||
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
virtual void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
||||||
const hecl::ProjectPath& worldPathCooked,
|
const hecl::ProjectPath& worldPathCooked,
|
||||||
|
@ -1132,6 +1132,21 @@ struct SpecMP1 : SpecBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||||
|
{
|
||||||
|
athena::io::YAMLDocReader reader;
|
||||||
|
if (reader.parse(&fin))
|
||||||
|
{
|
||||||
|
std::string classStr = reader.readString("DNAType");
|
||||||
|
if (!classStr.compare(DNAMP1::ANCS::DNAType()))
|
||||||
|
{
|
||||||
|
DNAMP1::ANCS ancs;
|
||||||
|
ancs.read(reader);
|
||||||
|
ancs.gatherDependencies(pathsOut);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
void buildWorldPakList(const hecl::ProjectPath& worldPath,
|
||||||
const hecl::ProjectPath& worldPathCooked,
|
const hecl::ProjectPath& worldPathCooked,
|
||||||
hecl::BlenderToken& btok,
|
hecl::BlenderToken& btok,
|
||||||
@ -1168,8 +1183,13 @@ struct SpecMP1 : SpecBase
|
|||||||
nameEnt.write(w);
|
nameEnt.write(w);
|
||||||
|
|
||||||
for (const auto& area : mlvl.areas)
|
for (const auto& area : mlvl.areas)
|
||||||
|
{
|
||||||
|
urde::SObjectTag nameTag(FOURCC('STRG'), area.areaNameId.toUint32());
|
||||||
|
if (nameTag)
|
||||||
|
listOut.push_back(nameTag);
|
||||||
for (const auto& dep : area.deps)
|
for (const auto& dep : area.deps)
|
||||||
listOut.push_back({dep.type, dep.id.toUint32()});
|
listOut.push_back({dep.type, dep.id.toUint32()});
|
||||||
|
}
|
||||||
|
|
||||||
urde::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint32());
|
urde::SObjectTag nameTag(FOURCC('STRG'), mlvl.worldNameId.toUint32());
|
||||||
if (nameTag)
|
if (nameTag)
|
||||||
|
@ -370,6 +370,10 @@ struct SpecMP2 : SpecBase
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
||||||
FCookProgress progress)
|
FCookProgress progress)
|
||||||
{
|
{
|
||||||
|
@ -564,6 +564,10 @@ struct SpecMP3 : SpecBase
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void flattenDependenciesANCSYAML(athena::io::IStreamReader& fin, std::vector<hecl::ProjectPath>& pathsOut)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
void cookAudioGroup(const hecl::ProjectPath& out, const hecl::ProjectPath& in,
|
||||||
FCookProgress progress)
|
FCookProgress progress)
|
||||||
{
|
{
|
||||||
|
@ -1339,13 +1339,13 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr)
|
|||||||
if (mwInfo.IsMapped(xa0_curAreaId) || mwInfo.IsAreaVisted(xa0_curAreaId))
|
if (mwInfo.IsMapped(xa0_curAreaId) || mwInfo.IsAreaVisted(xa0_curAreaId))
|
||||||
stringId = area->IGetStringTableAssetId();
|
stringId = area->IGetStringTableAssetId();
|
||||||
else
|
else
|
||||||
stringId = -1;
|
stringId = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x88_mapAreaStringId != stringId)
|
if (x88_mapAreaStringId != stringId)
|
||||||
{
|
{
|
||||||
x88_mapAreaStringId = stringId;
|
x88_mapAreaStringId = stringId;
|
||||||
if (x88_mapAreaStringId != -1)
|
if (x88_mapAreaStringId.IsValid())
|
||||||
x8c_mapAreaString = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), x88_mapAreaStringId});
|
x8c_mapAreaString = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), x88_mapAreaStringId});
|
||||||
else
|
else
|
||||||
x8c_mapAreaString = TLockedToken<CStringTable>();
|
x8c_mapAreaString = TLockedToken<CStringTable>();
|
||||||
@ -1370,7 +1370,7 @@ void CAutoMapper::Update(float dt, const CStateManager& mgr)
|
|||||||
if (hintDesc != x74_areaHintDescId)
|
if (hintDesc != x74_areaHintDescId)
|
||||||
{
|
{
|
||||||
x74_areaHintDescId = hintDesc;
|
x74_areaHintDescId = hintDesc;
|
||||||
if (x74_areaHintDescId != -1)
|
if (x74_areaHintDescId.IsValid())
|
||||||
x78_areaHintDesc = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), x74_areaHintDescId});
|
x78_areaHintDesc = g_SimplePool->GetObj(SObjectTag{FOURCC('STRG'), x74_areaHintDescId});
|
||||||
else
|
else
|
||||||
x78_areaHintDesc = TLockedToken<CStringTable>();
|
x78_areaHintDesc = TLockedToken<CStringTable>();
|
||||||
|
@ -149,10 +149,10 @@ private:
|
|||||||
TLockedToken<CTexture> x3c_hintBeacon;
|
TLockedToken<CTexture> x3c_hintBeacon;
|
||||||
std::vector<CTexturedQuadFilter> m_hintBeaconFilters;
|
std::vector<CTexturedQuadFilter> m_hintBeaconFilters;
|
||||||
rstl::reserved_vector<TLockedToken<CTexture>, 5> x48_mapIcons;
|
rstl::reserved_vector<TLockedToken<CTexture>, 5> x48_mapIcons;
|
||||||
CAssetId x74_areaHintDescId = -1;
|
CAssetId x74_areaHintDescId;
|
||||||
TLockedToken<CStringTable> x78_areaHintDesc;
|
TLockedToken<CStringTable> x78_areaHintDesc;
|
||||||
u32 x84_ = 0;
|
u32 x84_ = 0;
|
||||||
CAssetId x88_mapAreaStringId = -1;
|
CAssetId x88_mapAreaStringId;
|
||||||
TLockedToken<CStringTable> x8c_mapAreaString; // Used to be optional
|
TLockedToken<CStringTable> x8c_mapAreaString; // Used to be optional
|
||||||
u32 x9c_worldIdx = 0;
|
u32 x9c_worldIdx = 0;
|
||||||
TAreaId xa0_curAreaId;
|
TAreaId xa0_curAreaId;
|
||||||
|
@ -11,10 +11,10 @@ class CGameHintInfo
|
|||||||
public:
|
public:
|
||||||
struct SHintLocation
|
struct SHintLocation
|
||||||
{
|
{
|
||||||
CAssetId x0_mlvlId = -1;
|
CAssetId x0_mlvlId;
|
||||||
CAssetId x4_mreaId = -1;
|
CAssetId x4_mreaId;
|
||||||
TAreaId x8_areaId = kInvalidAreaId;
|
TAreaId x8_areaId = kInvalidAreaId;
|
||||||
CAssetId xc_stringId = -1;
|
CAssetId xc_stringId;
|
||||||
SHintLocation(CInputStream&, s32);
|
SHintLocation(CInputStream&, s32);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ CWorldState::CWorldState(CAssetId id)
|
|||||||
{
|
{
|
||||||
x8_relayTracker = std::make_shared<CRelayTracker>();
|
x8_relayTracker = std::make_shared<CRelayTracker>();
|
||||||
xc_mapWorldInfo = std::make_shared<CMapWorldInfo>();
|
xc_mapWorldInfo = std::make_shared<CMapWorldInfo>();
|
||||||
x10_desiredAreaAssetId = -1;
|
x10_desiredAreaAssetId = {};
|
||||||
x14_layerState = std::make_shared<CWorldLayerState>();
|
x14_layerState = std::make_shared<CWorldLayerState>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ static kabufuda::ECardResult g_OpResults[2] = {};
|
|||||||
CSaveWorldIntermediate::CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw)
|
CSaveWorldIntermediate::CSaveWorldIntermediate(CAssetId mlvl, CAssetId savw)
|
||||||
: x0_mlvlId(mlvl), x8_savwId(savw)
|
: x0_mlvlId(mlvl), x8_savwId(savw)
|
||||||
{
|
{
|
||||||
if (savw == -1)
|
if (!savw.IsValid())
|
||||||
x2c_dummyWorld = std::make_unique<CDummyWorld>(mlvl, false);
|
x2c_dummyWorld = std::make_unique<CDummyWorld>(mlvl, false);
|
||||||
else
|
else
|
||||||
x34_saveWorld = g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), savw});
|
x34_saveWorld = g_SimplePool->GetObj(SObjectTag{FOURCC('SAVW'), savw});
|
||||||
@ -198,7 +198,7 @@ void CMemoryCardSys::CCardFileInfo::LockIconToken(CAssetId iconTxtr, kabufuda::E
|
|||||||
u32 CMemoryCardSys::CCardFileInfo::CalculateBannerDataSize() const
|
u32 CMemoryCardSys::CCardFileInfo::CalculateBannerDataSize() const
|
||||||
{
|
{
|
||||||
u32 ret = 68;
|
u32 ret = 68;
|
||||||
if (x3c_bannerTex != -1)
|
if (x3c_bannerTex.IsValid())
|
||||||
{
|
{
|
||||||
if ((*x40_bannerTok)->GetMemoryCardTexelFormat() == ETexelFormat::RGB5A3)
|
if ((*x40_bannerTok)->GetMemoryCardTexelFormat() == ETexelFormat::RGB5A3)
|
||||||
ret = 6212;
|
ret = 6212;
|
||||||
@ -250,7 +250,7 @@ void CMemoryCardSys::CCardFileInfo::BuildCardBuffer()
|
|||||||
|
|
||||||
void CMemoryCardSys::CCardFileInfo::WriteBannerData(CMemoryOutStream& out) const
|
void CMemoryCardSys::CCardFileInfo::WriteBannerData(CMemoryOutStream& out) const
|
||||||
{
|
{
|
||||||
if (x3c_bannerTex != -1)
|
if (x3c_bannerTex.IsValid())
|
||||||
{
|
{
|
||||||
const TLockedToken<CTexture>& tex = *x40_bannerTok;
|
const TLockedToken<CTexture>& tex = *x40_bannerTok;
|
||||||
u32 bufSz;
|
u32 bufSz;
|
||||||
@ -326,7 +326,7 @@ ECardResult CMemoryCardSys::CCardFileInfo::GetStatus(kabufuda::CardStat& stat) c
|
|||||||
stat.SetIconAddr(68);
|
stat.SetIconAddr(68);
|
||||||
|
|
||||||
kabufuda::EImageFormat bannerFmt;
|
kabufuda::EImageFormat bannerFmt;
|
||||||
if (x3c_bannerTex != -1)
|
if (x3c_bannerTex.IsValid())
|
||||||
{
|
{
|
||||||
if ((*x40_bannerTok)->GetMemoryCardTexelFormat() == ETexelFormat::RGB5A3)
|
if ((*x40_bannerTok)->GetMemoryCardTexelFormat() == ETexelFormat::RGB5A3)
|
||||||
bannerFmt = kabufuda::EImageFormat::RGB5A3;
|
bannerFmt = kabufuda::EImageFormat::RGB5A3;
|
||||||
|
@ -18,8 +18,8 @@ class CSimplePool;
|
|||||||
class CSaveWorldMemory
|
class CSaveWorldMemory
|
||||||
{
|
{
|
||||||
friend class CMemoryCardSys;
|
friend class CMemoryCardSys;
|
||||||
CAssetId x0_strgId = -1;
|
CAssetId x0_strgId;
|
||||||
CAssetId x4_savwId = -1;
|
CAssetId x4_savwId;
|
||||||
u32 x8_areaCount;
|
u32 x8_areaCount;
|
||||||
std::vector<CAssetId> xc_areaIds;
|
std::vector<CAssetId> xc_areaIds;
|
||||||
std::vector<CWorldLayers::Area> x1c_defaultLayerStates;
|
std::vector<CWorldLayers::Area> x1c_defaultLayerStates;
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
CardFileHandle m_handle;
|
CardFileHandle m_handle;
|
||||||
std::string x18_fileName;
|
std::string x18_fileName;
|
||||||
std::string x28_comment;
|
std::string x28_comment;
|
||||||
CAssetId x3c_bannerTex = -1;
|
CAssetId x3c_bannerTex;
|
||||||
std::experimental::optional<TLockedToken<CTexture>> x40_bannerTok;
|
std::experimental::optional<TLockedToken<CTexture>> x40_bannerTok;
|
||||||
rstl::reserved_vector<Icon, 8> x50_iconToks;
|
rstl::reserved_vector<Icon, 8> x50_iconToks;
|
||||||
std::vector<u8> xf4_saveBuffer;
|
std::vector<u8> xf4_saveBuffer;
|
||||||
|
@ -164,7 +164,7 @@ bool CResLoader::ResourceExists(const SObjectTag& tag)
|
|||||||
|
|
||||||
FourCC CResLoader::GetResourceTypeById(CAssetId id) const
|
FourCC CResLoader::GetResourceTypeById(CAssetId id) const
|
||||||
{
|
{
|
||||||
if (FindResource(id))
|
if (id.IsValid() && FindResource(id))
|
||||||
return x50_cachedResInfo->GetType();
|
return x50_cachedResInfo->GetType();
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public:
|
|||||||
|
|
||||||
struct SBucket
|
struct SBucket
|
||||||
{
|
{
|
||||||
CAssetId x0_texture = -1;
|
CAssetId x0_texture;
|
||||||
float x4_appearanceRange = 0.f;
|
float x4_appearanceRange = 0.f;
|
||||||
u32 x8_imagePos = 0;
|
u32 x8_imagePos = 0;
|
||||||
zeus::CVector2i xc_size;
|
zeus::CVector2i xc_size;
|
||||||
@ -29,7 +29,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void Load(CInputStream&, u32);
|
void Load(CInputStream&, u32);
|
||||||
CAssetId x0_scannableObjectId;
|
CAssetId x0_scannableObjectId;
|
||||||
u32 x4_stringId = -1;
|
CAssetId x4_stringId;
|
||||||
float x8_totalDownloadTime = 0.f;
|
float x8_totalDownloadTime = 0.f;
|
||||||
u32 xc_category = 0;
|
u32 xc_category = 0;
|
||||||
bool x10_important = false;
|
bool x10_important = false;
|
||||||
|
@ -1821,7 +1821,7 @@ void CStateManager::Update(float dt)
|
|||||||
if (xf14_curTimeMod900 > 900.f)
|
if (xf14_curTimeMod900 > 900.f)
|
||||||
xf14_curTimeMod900 -= 900.f;
|
xf14_curTimeMod900 -= 900.f;
|
||||||
|
|
||||||
xf08_pauseHudMessage = -1;
|
xf08_pauseHudMessage = {};
|
||||||
|
|
||||||
CScriptEffect::ResetParticleCounts();
|
CScriptEffect::ResetParticleCounts();
|
||||||
UpdateThermalVisor();
|
UpdateThermalVisor();
|
||||||
|
@ -62,7 +62,7 @@ struct SScriptObjectStream
|
|||||||
|
|
||||||
struct SOnScreenTex
|
struct SOnScreenTex
|
||||||
{
|
{
|
||||||
CAssetId x0_id = -1;
|
CAssetId x0_id;
|
||||||
zeus::CVector2i x4_origin;
|
zeus::CVector2i x4_origin;
|
||||||
zeus::CVector2i xc_extent;
|
zeus::CVector2i xc_extent;
|
||||||
};
|
};
|
||||||
|
@ -28,7 +28,7 @@ void CCameraFilterPass<S>::Update(float dt)
|
|||||||
if (x0_curType == EFilterType::Passthru)
|
if (x0_curType == EFilterType::Passthru)
|
||||||
{
|
{
|
||||||
x24_texObj = TLockedToken<CTexture>();
|
x24_texObj = TLockedToken<CTexture>();
|
||||||
x20_nextTxtr = -1;
|
x20_nextTxtr = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,11 +47,11 @@ void CCameraFilterPass<S>::SetFilter(EFilterType type, EFilterShape shape,
|
|||||||
xc_duration = 0.f;
|
xc_duration = 0.f;
|
||||||
x10_remTime = 0.f;
|
x10_remTime = 0.f;
|
||||||
|
|
||||||
if (txtr != -1)
|
if (txtr.IsValid())
|
||||||
x24_texObj = g_SimplePool->GetObj({FOURCC('TXTR'), txtr});
|
x24_texObj = g_SimplePool->GetObj({FOURCC('TXTR'), txtr});
|
||||||
if (type == EFilterType::Passthru)
|
if (type == EFilterType::Passthru)
|
||||||
m_shader = std::experimental::nullopt;
|
m_shader = std::experimental::nullopt;
|
||||||
else if (x0_curType != type || (x20_nextTxtr != txtr && txtr != -1))
|
else if (x0_curType != type || (x20_nextTxtr != txtr && txtr.IsValid()))
|
||||||
m_shader.emplace(type, x24_texObj);
|
m_shader.emplace(type, x24_texObj);
|
||||||
|
|
||||||
x4_nextType = type;
|
x4_nextType = type;
|
||||||
@ -71,7 +71,7 @@ void CCameraFilterPass<S>::SetFilter(EFilterType type, EFilterShape shape,
|
|||||||
x14_prevColor = x18_curColor;
|
x14_prevColor = x18_curColor;
|
||||||
x8_shape = shape;
|
x8_shape = shape;
|
||||||
x20_nextTxtr = txtr;
|
x20_nextTxtr = txtr;
|
||||||
if (txtr != -1)
|
if (txtr.IsValid())
|
||||||
x24_texObj = g_SimplePool->GetObj({FOURCC('TXTR'), txtr});
|
x24_texObj = g_SimplePool->GetObj({FOURCC('TXTR'), txtr});
|
||||||
x10_remTime = time;
|
x10_remTime = time;
|
||||||
xc_duration = time;
|
xc_duration = time;
|
||||||
@ -104,7 +104,7 @@ void CCameraFilterPass<S>::SetFilter(EFilterType type, EFilterShape shape,
|
|||||||
|
|
||||||
if (x0_curType == EFilterType::Passthru)
|
if (x0_curType == EFilterType::Passthru)
|
||||||
m_shader = std::experimental::nullopt;
|
m_shader = std::experimental::nullopt;
|
||||||
else if (x0_curType != origType || (x20_nextTxtr != origTxtr && x20_nextTxtr != -1))
|
else if (x0_curType != origType || (x20_nextTxtr != origTxtr && x20_nextTxtr.IsValid()))
|
||||||
m_shader.emplace(x0_curType, x24_texObj);
|
m_shader.emplace(x0_curType, x24_texObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ void CCameraFilterPassPoly::SetFilter(EFilterType type, EFilterShape shape,
|
|||||||
case EFilterShape::FullscreenHalvesLeftRight:
|
case EFilterShape::FullscreenHalvesLeftRight:
|
||||||
case EFilterShape::FullscreenHalvesTopBottom:
|
case EFilterShape::FullscreenHalvesTopBottom:
|
||||||
case EFilterShape::FullscreenQuarters:
|
case EFilterShape::FullscreenQuarters:
|
||||||
if (txtr != -1)
|
if (txtr.IsValid())
|
||||||
m_filter = std::make_unique<CCameraFilterPass<CTexturedQuadFilterAlpha>>();
|
m_filter = std::make_unique<CCameraFilterPass<CTexturedQuadFilterAlpha>>();
|
||||||
else
|
else
|
||||||
m_filter = std::make_unique<CCameraFilterPass<CColoredQuadFilter>>();
|
m_filter = std::make_unique<CCameraFilterPass<CColoredQuadFilter>>();
|
||||||
|
@ -46,7 +46,7 @@ protected:
|
|||||||
zeus::CColor x14_prevColor;
|
zeus::CColor x14_prevColor;
|
||||||
zeus::CColor x18_curColor;
|
zeus::CColor x18_curColor;
|
||||||
zeus::CColor x1c_nextColor;
|
zeus::CColor x1c_nextColor;
|
||||||
CAssetId x20_nextTxtr = -1;
|
CAssetId x20_nextTxtr;
|
||||||
TLockedToken<CTexture> x24_texObj; // Used to be auto_ptr
|
TLockedToken<CTexture> x24_texObj; // Used to be auto_ptr
|
||||||
float GetT(bool invert) const;
|
float GetT(bool invert) const;
|
||||||
public:
|
public:
|
||||||
|
@ -32,11 +32,12 @@ BOO_GLSL_BINDING_HEAD
|
|||||||
"SBINDING(0) out VertToFrag vtf;\n"
|
"SBINDING(0) out VertToFrag vtf;\n"
|
||||||
"void main()\n"
|
"void main()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
" vec3 pos = posIn[gl_VertexID].xyz;\n"
|
||||||
|
" vtf.uv = uvIn[gl_VertexID].xyz;\n"
|
||||||
" vtf.fontColor = color * fontColorIn;\n"
|
" vtf.fontColor = color * fontColorIn;\n"
|
||||||
" vtf.outlineColor = color * outlineColorIn;\n"
|
" vtf.outlineColor = color * outlineColorIn;\n"
|
||||||
" vtf.mulColor = mulColorIn;\n"
|
" vtf.mulColor = mulColorIn;\n"
|
||||||
" vtf.uv = uvIn[gl_VertexID].xyz;\n"
|
" gl_Position = mtx * vec4(pos, 1.0);\n"
|
||||||
" gl_Position = mtx * vec4(posIn[gl_VertexID].xyz, 1.0);\n"
|
|
||||||
"}\n";
|
"}\n";
|
||||||
|
|
||||||
static const char* TextFS =
|
static const char* TextFS =
|
||||||
|
@ -249,7 +249,7 @@ void CScanDisplay::StartScan(TUniqueId id, const CScannableObjectInfo& scanInfo,
|
|||||||
}
|
}
|
||||||
|
|
||||||
CAssetId strId = x14_scannableInfo->GetStringTableId();
|
CAssetId strId = x14_scannableInfo->GetStringTableId();
|
||||||
if (strId != -1)
|
if (strId.IsValid())
|
||||||
x194_scanStr = g_SimplePool->GetObj({FOURCC('STRG'), strId});
|
x194_scanStr = g_SimplePool->GetObj({FOURCC('STRG'), strId});
|
||||||
|
|
||||||
for (int i=0 ; i<4 ; ++i)
|
for (int i=0 ; i<4 ; ++i)
|
||||||
|
@ -113,7 +113,7 @@ void CArtifactDoll::Draw(float alpha, const CStateManager& mgr,
|
|||||||
zeus::CColor color = ArtifactPreColor;
|
zeus::CColor color = ArtifactPreColor;
|
||||||
if (playerState.HasPowerUp(CPlayerState::EItemType(i + 29)))
|
if (playerState.HasPowerUp(CPlayerState::EItemType(i + 29)))
|
||||||
{
|
{
|
||||||
if (ArtifactHeadScans[i] != -1)
|
if (ArtifactHeadScans[i].IsValid())
|
||||||
{
|
{
|
||||||
CAssetId newId = g_ResFactory->TranslateOriginalToNew(ArtifactHeadScans[i]);
|
CAssetId newId = g_ResFactory->TranslateOriginalToNew(ArtifactHeadScans[i]);
|
||||||
float interp = (playerState.GetScanTime(newId) - 0.5f) * 2.f;
|
float interp = (playerState.GetScanTime(newId) - 0.5f) * 2.f;
|
||||||
|
@ -15,7 +15,7 @@ CFaceplateDecoration::CFaceplateDecoration(CStateManager& stateMgr) {}
|
|||||||
void CFaceplateDecoration::Update(float dt, CStateManager& stateMgr)
|
void CFaceplateDecoration::Update(float dt, CStateManager& stateMgr)
|
||||||
{
|
{
|
||||||
CAssetId txtrId = stateMgr.GetPlayer().GetVisorSteam().GetTextureId();
|
CAssetId txtrId = stateMgr.GetPlayer().GetVisorSteam().GetTextureId();
|
||||||
if (txtrId == -1)
|
if (!txtrId.IsValid())
|
||||||
{
|
{
|
||||||
if (xc_ready)
|
if (xc_ready)
|
||||||
{
|
{
|
||||||
@ -26,7 +26,7 @@ void CFaceplateDecoration::Update(float dt, CStateManager& stateMgr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x0_id != txtrId && txtrId != -1)
|
if (x0_id != txtrId && txtrId.IsValid())
|
||||||
{
|
{
|
||||||
if (m_texFilter)
|
if (m_texFilter)
|
||||||
m_texFilter = std::experimental::nullopt;
|
m_texFilter = std::experimental::nullopt;
|
||||||
|
@ -391,7 +391,7 @@ void CInGameGuiManager::Update(CStateManager& stateMgr, float dt, CArchitectureQ
|
|||||||
if (!x1dc_onScreenTexTok)
|
if (!x1dc_onScreenTexTok)
|
||||||
{
|
{
|
||||||
x1c4_onScreenTex = stateMgr.GetPendingScreenTex();
|
x1c4_onScreenTex = stateMgr.GetPendingScreenTex();
|
||||||
if (x1c4_onScreenTex.x0_id != -1)
|
if (x1c4_onScreenTex.x0_id.IsValid())
|
||||||
{
|
{
|
||||||
x1dc_onScreenTexTok = g_SimplePool->GetObj({FOURCC('TXTR'), x1c4_onScreenTex.x0_id});
|
x1dc_onScreenTexTok = g_SimplePool->GetObj({FOURCC('TXTR'), x1c4_onScreenTex.x0_id});
|
||||||
x1d8_onScreenTexAlpha = FLT_EPSILON;
|
x1d8_onScreenTexAlpha = FLT_EPSILON;
|
||||||
@ -399,11 +399,11 @@ void CInGameGuiManager::Update(CStateManager& stateMgr, float dt, CArchitectureQ
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (stateMgr.GetPendingScreenTex().x0_id == -1 &&
|
if (!stateMgr.GetPendingScreenTex().x0_id.IsValid() &&
|
||||||
stateMgr.GetPendingScreenTex().x4_origin == zeus::CVector2i(0, 0))
|
stateMgr.GetPendingScreenTex().x4_origin == zeus::CVector2i(0, 0))
|
||||||
{
|
{
|
||||||
x1c4_onScreenTex.x4_origin = stateMgr.GetPendingScreenTex().x4_origin;
|
x1c4_onScreenTex.x4_origin = stateMgr.GetPendingScreenTex().x4_origin;
|
||||||
x1c4_onScreenTex.x0_id = -1;
|
x1c4_onScreenTex.x0_id = {};
|
||||||
x1d8_onScreenTexAlpha = 0.f;
|
x1d8_onScreenTexAlpha = 0.f;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -412,7 +412,7 @@ void CInGameGuiManager::Update(CStateManager& stateMgr, float dt, CArchitectureQ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (x1c4_onScreenTex.x0_id != -1 && x1dc_onScreenTexTok.IsLoaded())
|
else if (x1c4_onScreenTex.x0_id.IsValid() && x1dc_onScreenTexTok.IsLoaded())
|
||||||
{
|
{
|
||||||
x1d8_onScreenTexAlpha = std::min(x1d8_onScreenTexAlpha + dt, 1.f);
|
x1d8_onScreenTexAlpha = std::min(x1d8_onScreenTexAlpha + dt, 1.f);
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ private:
|
|||||||
std::vector<u32> xd8_;
|
std::vector<u32> xd8_;
|
||||||
std::vector<CToken> xe8_pauseResources;
|
std::vector<CToken> xe8_pauseResources;
|
||||||
CCameraFilterPass<CColoredQuadFilter> xf8_camFilter;
|
CCameraFilterPass<CColoredQuadFilter> xf8_camFilter;
|
||||||
CAssetId x124_pauseGameHudMessage = -1;
|
CAssetId x124_pauseGameHudMessage;
|
||||||
float x128_pauseGameHudTime = 0.f;
|
float x128_pauseGameHudTime = 0.f;
|
||||||
std::list<CToken> x12c_;
|
std::list<CToken> x12c_;
|
||||||
u32 x140_ = 0;
|
u32 x140_ = 0;
|
||||||
|
@ -91,7 +91,7 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch
|
|||||||
{
|
{
|
||||||
x14_stateManager->SetInSaveUI(x18_guiManager->IsInSaveUI());
|
x14_stateManager->SetInSaveUI(x18_guiManager->IsInSaveUI());
|
||||||
UnpauseGame();
|
UnpauseGame();
|
||||||
if (x14_stateManager->GetPauseHUDMessage() != -1)
|
if (x14_stateManager->GetPauseHUDMessage().IsValid())
|
||||||
x14_stateManager->IncrementHUDMessageFrameCounter();
|
x14_stateManager->IncrementHUDMessageFrameCounter();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -287,7 +287,7 @@ CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader")
|
|||||||
if (g_MemoryCardSys->HasSaveWorldMemory(mlvlId))
|
if (g_MemoryCardSys->HasSaveWorldMemory(mlvlId))
|
||||||
{
|
{
|
||||||
const CSaveWorldMemory& savwMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId);
|
const CSaveWorldMemory& savwMem = g_MemoryCardSys->GetSaveWorldMemory(mlvlId);
|
||||||
if (savwMem.GetWorldNameId() != -1)
|
if (savwMem.GetWorldNameId().IsValid())
|
||||||
{
|
{
|
||||||
CAssetId wtMgrFont = g_ResFactory->TranslateOriginalToNew(0xB7BBD0B4);
|
CAssetId wtMgrFont = g_ResFactory->TranslateOriginalToNew(0xB7BBD0B4);
|
||||||
g_GameState->GetWorldTransitionManager()->EnableTransition(wtMgrFont,
|
g_GameState->GetWorldTransitionManager()->EnableTransition(wtMgrFont,
|
||||||
|
@ -8,7 +8,7 @@ namespace urde
|
|||||||
|
|
||||||
class CAnimationParameters
|
class CAnimationParameters
|
||||||
{
|
{
|
||||||
CAssetId x0_ancs = -1;
|
CAssetId x0_ancs;
|
||||||
u32 x4_charIdx = -1;
|
u32 x4_charIdx = -1;
|
||||||
u32 x8_defaultAnim = -1;
|
u32 x8_defaultAnim = -1;
|
||||||
public:
|
public:
|
||||||
|
@ -1235,7 +1235,7 @@ void CPlayer::FinishNewScan(CStateManager& mgr)
|
|||||||
auto scanCompletion = mgr.CalculateScanCompletionRate();
|
auto scanCompletion = mgr.CalculateScanCompletionRate();
|
||||||
CAssetId message = UpdatePersistentScanPercent(mgr.GetPlayerState()->GetLogScans(),
|
CAssetId message = UpdatePersistentScanPercent(mgr.GetPlayerState()->GetLogScans(),
|
||||||
scanCompletion.first, scanCompletion.second);
|
scanCompletion.first, scanCompletion.second);
|
||||||
if (message != -1)
|
if (message.IsValid())
|
||||||
mgr.ShowPausedHUDMemo(message, 0.f);
|
mgr.ShowPausedHUDMemo(message, 0.f);
|
||||||
mgr.GetPlayerState()->SetScanCompletionRate(scanCompletion);
|
mgr.GetPlayerState()->SetScanCompletionRate(scanCompletion);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@ namespace urde
|
|||||||
|
|
||||||
class CScannableParameters
|
class CScannableParameters
|
||||||
{
|
{
|
||||||
CAssetId x0_scanId = -1;
|
CAssetId x0_scanId;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CScannableParameters() = default;
|
CScannableParameters() = default;
|
||||||
|
@ -11,11 +11,11 @@ std::experimental::optional<CVisorFlare::CFlareDef> CVisorFlare::LoadFlareDef(CI
|
|||||||
if (propCount != 4)
|
if (propCount != 4)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
u32 txtrId = in.readUint32Big();
|
CAssetId txtrId = in.readUint32Big();
|
||||||
float f1 = in.readFloatBig();
|
float f1 = in.readFloatBig();
|
||||||
float f2 = in.readFloatBig();
|
float f2 = in.readFloatBig();
|
||||||
zeus::CColor color = zeus::CColor::ReadRGBABig(in);
|
zeus::CColor color = zeus::CColor::ReadRGBABig(in);
|
||||||
if (txtrId == -1)
|
if (!txtrId.IsValid())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
TToken<CTexture> tex = g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), txtrId});
|
TToken<CTexture> tex = g_SimplePool->GetObj(SObjectTag{FOURCC('TXTR'), txtrId});
|
||||||
|
@ -39,7 +39,7 @@ TAreaId CDummyWorld::IGetCurrentAreaId() const { return x3c_curAreaId; }
|
|||||||
TAreaId CDummyWorld::IGetAreaId(CAssetId id) const
|
TAreaId CDummyWorld::IGetAreaId(CAssetId id) const
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (id == -1)
|
if (!id.IsValid())
|
||||||
return kInvalidAreaId;
|
return kInvalidAreaId;
|
||||||
for (const CDummyGameArea& area : x18_areas)
|
for (const CDummyGameArea& area : x18_areas)
|
||||||
{
|
{
|
||||||
@ -213,7 +213,7 @@ TAreaId CWorld::IGetCurrentAreaId() const { return x68_curAreaId; }
|
|||||||
TAreaId CWorld::IGetAreaId(CAssetId id) const
|
TAreaId CWorld::IGetAreaId(CAssetId id) const
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (id == -1)
|
if (!id.IsValid())
|
||||||
return kInvalidAreaId;
|
return kInvalidAreaId;
|
||||||
for (const std::unique_ptr<CGameArea>& area : x18_areas)
|
for (const std::unique_ptr<CGameArea>& area : x18_areas)
|
||||||
{
|
{
|
||||||
@ -248,7 +248,7 @@ void CWorld::LoadSoundGroups() {}
|
|||||||
|
|
||||||
bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
|
bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
|
||||||
{
|
{
|
||||||
if (mreaId != -1)
|
if (mreaId.IsValid())
|
||||||
{
|
{
|
||||||
x68_curAreaId = 0;
|
x68_curAreaId = 0;
|
||||||
TAreaId aid = 0;
|
TAreaId aid = 0;
|
||||||
@ -281,7 +281,7 @@ bool CWorld::CheckWorldComplete(CStateManager* mgr, TAreaId id, CAssetId mreaId)
|
|||||||
if (version >= 12)
|
if (version >= 12)
|
||||||
{
|
{
|
||||||
CAssetId skyboxId = r.readUint32Big();
|
CAssetId skyboxId = r.readUint32Big();
|
||||||
if (skyboxId != -1 && mgr)
|
if (skyboxId.IsValid() && mgr)
|
||||||
x94_skyboxWorld = g_SimplePool->GetObj(SObjectTag{FOURCC('CMDL'), skyboxId});
|
x94_skyboxWorld = g_SimplePool->GetObj(SObjectTag{FOURCC('CMDL'), skyboxId});
|
||||||
}
|
}
|
||||||
if (version >= 17)
|
if (version >= 17)
|
||||||
|
@ -46,9 +46,9 @@ class CDummyWorld : public IWorld
|
|||||||
} x8_phase = Phase::Loading;
|
} x8_phase = Phase::Loading;
|
||||||
CAssetId xc_mlvlId;
|
CAssetId xc_mlvlId;
|
||||||
CAssetId x10_strgId;
|
CAssetId x10_strgId;
|
||||||
CAssetId x14_savwId = -1;
|
CAssetId x14_savwId;
|
||||||
std::vector<CDummyGameArea> x18_areas;
|
std::vector<CDummyGameArea> x18_areas;
|
||||||
CAssetId x28_mapWorldId = -1;
|
CAssetId x28_mapWorldId;
|
||||||
TLockedToken<CMapWorld> x2c_mapWorld;
|
TLockedToken<CMapWorld> x2c_mapWorld;
|
||||||
std::shared_ptr<IDvdRequest> x30_loadToken;
|
std::shared_ptr<IDvdRequest> x30_loadToken;
|
||||||
std::unique_ptr<uint8_t[]> x34_loadBuf;
|
std::unique_ptr<uint8_t[]> x34_loadBuf;
|
||||||
@ -113,11 +113,11 @@ private:
|
|||||||
LoadingSoundGroups,
|
LoadingSoundGroups,
|
||||||
Done,
|
Done,
|
||||||
} x4_phase = Phase::Loading;
|
} x4_phase = Phase::Loading;
|
||||||
CAssetId x8_mlvlId = -1;
|
CAssetId x8_mlvlId;
|
||||||
CAssetId xc_strgId = -1;
|
CAssetId xc_strgId;
|
||||||
CAssetId x10_savwId = -1;
|
CAssetId x10_savwId;
|
||||||
std::vector<std::unique_ptr<CGameArea>> x18_areas;
|
std::vector<std::unique_ptr<CGameArea>> x18_areas;
|
||||||
CAssetId x24_mapwId = -1;
|
CAssetId x24_mapwId;
|
||||||
TLockedToken<CMapWorld> x28_mapWorld;
|
TLockedToken<CMapWorld> x28_mapWorld;
|
||||||
std::vector<CRelay> x2c_relays;
|
std::vector<CRelay> x2c_relays;
|
||||||
//AsyncTask x3c_loadToken;
|
//AsyncTask x3c_loadToken;
|
||||||
|
@ -403,13 +403,13 @@ void CWorldTransManager::EnableTransition(const CAnimRes& samusRes,
|
|||||||
x4_modelData->x158_suitModel = g_SimplePool->GetObj(SObjectTag{FOURCC('CMDL'), info.GetModelId()});
|
x4_modelData->x158_suitModel = g_SimplePool->GetObj(SObjectTag{FOURCC('CMDL'), info.GetModelId()});
|
||||||
x4_modelData->x164_suitSkin = g_SimplePool->GetObj(SObjectTag{FOURCC('CSKR'), info.GetSkinRulesId()});
|
x4_modelData->x164_suitSkin = g_SimplePool->GetObj(SObjectTag{FOURCC('CSKR'), info.GetSkinRulesId()});
|
||||||
|
|
||||||
if (platRes != -1)
|
if (platRes.IsValid())
|
||||||
{
|
{
|
||||||
x4_modelData->xb4_platformModelData = {CStaticRes(platRes, platScale), 2};
|
x4_modelData->xb4_platformModelData = {CStaticRes(platRes, platScale), 2};
|
||||||
x4_modelData->xb4_platformModelData.Touch(CModelData::EWhichModel::Normal, 0);
|
x4_modelData->xb4_platformModelData.Touch(CModelData::EWhichModel::Normal, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bgRes != -1)
|
if (bgRes.IsValid())
|
||||||
{
|
{
|
||||||
CStaticRes bg(bgRes, bgScale);
|
CStaticRes bg(bgRes, bgScale);
|
||||||
x4_modelData->x100_bgModelData[0] = bg;
|
x4_modelData->x100_bgModelData[0] = bg;
|
||||||
|
@ -1283,11 +1283,11 @@ CEntity* ScriptLoader::LoadWater(CStateManager& mgr, CInputStream& in, int propC
|
|||||||
zeus::CAABox box(-extent * 0.5f, extent * 0.5f);
|
zeus::CAABox box(-extent * 0.5f, extent * 0.5f);
|
||||||
|
|
||||||
CAssetId envBumpMap;
|
CAssetId envBumpMap;
|
||||||
if (bumpMap == -1)
|
if (!bumpMap.IsValid())
|
||||||
envBumpMap = _envBumpMap;
|
envBumpMap = _envBumpMap;
|
||||||
|
|
||||||
CAssetId envMap;
|
CAssetId envMap;
|
||||||
if (bumpMap == -1)
|
if (!bumpMap.IsValid())
|
||||||
envMap = _envMap;
|
envMap = _envMap;
|
||||||
|
|
||||||
return new CScriptWater(mgr, mgr.AllocateUniqueId(), name, info, position, box, dInfo, orientedForce, triggerFlags,
|
return new CScriptWater(mgr, mgr.AllocateUniqueId(), name, info, position, box, dInfo, orientedForce, triggerFlags,
|
||||||
|
2
hecl
2
hecl
@ -1 +1 @@
|
|||||||
Subproject commit 5d4a2ce1bd2545a59f28e889b1819477dd7f4d58
|
Subproject commit 17b0a91e2911d9a88c1128f83f745dd6f88c1db6
|
Loading…
x
Reference in New Issue
Block a user