mirror of https://github.com/AxioDL/metaforce.git
Initial HINT support
This commit is contained in:
parent
9b436b4b23
commit
f5db2527e4
|
@ -16,6 +16,7 @@ make_dnalist(liblist
|
||||||
SCAN
|
SCAN
|
||||||
FRME
|
FRME
|
||||||
SAVW
|
SAVW
|
||||||
|
HINT
|
||||||
Tweaks/CTweakGame
|
Tweaks/CTweakGame
|
||||||
Tweaks/CTweakParticle
|
Tweaks/CTweakParticle
|
||||||
Tweaks/CTweakPlayer
|
Tweaks/CTweakPlayer
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "../DNACommon/DPSC.hpp"
|
#include "../DNACommon/DPSC.hpp"
|
||||||
#include "../DNACommon/FONT.hpp"
|
#include "../DNACommon/FONT.hpp"
|
||||||
#include "../DNACommon/DGRP.hpp"
|
#include "../DNACommon/DGRP.hpp"
|
||||||
|
#include "HINT.hpp"
|
||||||
#include "CMDL.hpp"
|
#include "CMDL.hpp"
|
||||||
#include "AFSM.hpp"
|
#include "AFSM.hpp"
|
||||||
#include "SAVW.hpp"
|
#include "SAVW.hpp"
|
||||||
|
@ -282,6 +283,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK& pak, const PAK::En
|
||||||
return {STRG::Extract, nullptr, {_S(".yaml")}};
|
return {STRG::Extract, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('SCAN'):
|
case SBIG('SCAN'):
|
||||||
return {SCAN::Extract, nullptr, {_S(".yaml")}, 0, SCAN::Name};
|
return {SCAN::Extract, nullptr, {_S(".yaml")}, 0, SCAN::Name};
|
||||||
|
case SBIG('HINT'):
|
||||||
|
return {HINT::Extract, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('SAVW'):
|
case SBIG('SAVW'):
|
||||||
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
|
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('TXTR'):
|
case SBIG('TXTR'):
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
#ifndef _DNAMP1_HINT_HPP_
|
||||||
|
#define _DNAMP1_HINT_HPP_
|
||||||
|
|
||||||
|
#include "../DNACommon/DNACommon.hpp"
|
||||||
|
#include "../DNACommon/PAK.hpp"
|
||||||
|
|
||||||
|
namespace DataSpec
|
||||||
|
{
|
||||||
|
namespace DNAMP1
|
||||||
|
{
|
||||||
|
struct HINT : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
Value<atUint32> magic;
|
||||||
|
Value<atUint32> version;
|
||||||
|
|
||||||
|
struct Hint : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
String<-1> name;
|
||||||
|
Value<float> unknown1;
|
||||||
|
Value<float> fadeInTime;
|
||||||
|
UniqueID32 stringID;
|
||||||
|
Value<atUint32> unknown2;
|
||||||
|
struct Location : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
UniqueID32 worldAssetID;
|
||||||
|
UniqueID32 areaAssetID;
|
||||||
|
Value<atUint32> areaID;
|
||||||
|
UniqueID32 stringID;
|
||||||
|
};
|
||||||
|
|
||||||
|
Value<atUint32> locationCount;
|
||||||
|
Vector<Location, DNA_COUNT(locationCount)> locations;
|
||||||
|
};
|
||||||
|
Value<atUint32> hintCount;
|
||||||
|
Vector<Hint, DNA_COUNT(hintCount)> hints;
|
||||||
|
|
||||||
|
|
||||||
|
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
|
||||||
|
{
|
||||||
|
HINT hint;
|
||||||
|
hint.read(rs);
|
||||||
|
athena::io::FileWriter writer(outPath.getAbsolutePath());
|
||||||
|
hint.toYAMLStream(writer);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // _DNAMP1_HINT_HPP_
|
|
@ -8,6 +8,7 @@
|
||||||
#include "MAPA.hpp"
|
#include "MAPA.hpp"
|
||||||
#include "AFSM.hpp"
|
#include "AFSM.hpp"
|
||||||
#include "SAVW.hpp"
|
#include "SAVW.hpp"
|
||||||
|
#include "../DNAMP1/HINT.hpp"
|
||||||
#include "../DNACommon/FSM2.hpp"
|
#include "../DNACommon/FSM2.hpp"
|
||||||
#include "../DNACommon/TXTR.hpp"
|
#include "../DNACommon/TXTR.hpp"
|
||||||
#include "../DNACommon/FONT.hpp"
|
#include "../DNACommon/FONT.hpp"
|
||||||
|
@ -217,6 +218,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const DNAMP1::PAK& pak, const
|
||||||
{
|
{
|
||||||
switch (entry.type)
|
switch (entry.type)
|
||||||
{
|
{
|
||||||
|
case SBIG('HINT'):
|
||||||
|
return {DNAMP1::HINT::Extract, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('STRG'):
|
case SBIG('STRG'):
|
||||||
return {STRG::Extract, nullptr, {_S(".yaml")}};
|
return {STRG::Extract, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('TXTR'):
|
case SBIG('TXTR'):
|
||||||
|
|
|
@ -8,7 +8,8 @@ make_dnalist(liblist
|
||||||
CSKR
|
CSKR
|
||||||
MREA
|
MREA
|
||||||
SAVW
|
SAVW
|
||||||
CAUD)
|
CAUD
|
||||||
|
HINT)
|
||||||
add_library(DNAMP3
|
add_library(DNAMP3
|
||||||
DNAMP3.hpp DNAMP3.cpp
|
DNAMP3.hpp DNAMP3.cpp
|
||||||
${liblist}
|
${liblist}
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "MREA.hpp"
|
#include "MREA.hpp"
|
||||||
#include "MAPA.hpp"
|
#include "MAPA.hpp"
|
||||||
#include "SAVW.hpp"
|
#include "SAVW.hpp"
|
||||||
|
#include "HINT.hpp"
|
||||||
#include "../DNACommon/TXTR.hpp"
|
#include "../DNACommon/TXTR.hpp"
|
||||||
#include "../DNACommon/FONT.hpp"
|
#include "../DNACommon/FONT.hpp"
|
||||||
#include "../DNACommon/FSM2.hpp"
|
#include "../DNACommon/FSM2.hpp"
|
||||||
|
@ -236,6 +237,8 @@ ResExtractor<PAKBridge> PAKBridge::LookupExtractor(const PAK& pak, const PAK::En
|
||||||
return {TXTR::Extract, nullptr, {_S(".png")}};
|
return {TXTR::Extract, nullptr, {_S(".png")}};
|
||||||
case SBIG('SAVW'):
|
case SBIG('SAVW'):
|
||||||
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
|
return {SAVWCommon::ExtractSAVW<SAVW>, nullptr, {_S(".yaml")}};
|
||||||
|
case SBIG('HINT'):
|
||||||
|
return {HINT::Extract, nullptr, {_S(".yaml")}};
|
||||||
case SBIG('CMDL'):
|
case SBIG('CMDL'):
|
||||||
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
return {nullptr, CMDL::Extract, {_S(".blend")}, 1};
|
||||||
case SBIG('CHAR'):
|
case SBIG('CHAR'):
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
#ifndef _DNAMP3_HINT_HPP_
|
||||||
|
#define _DNAMP3_HINT_HPP_
|
||||||
|
|
||||||
|
#include "../DNACommon/DNACommon.hpp"
|
||||||
|
#include "PAK.hpp"
|
||||||
|
|
||||||
|
namespace DataSpec
|
||||||
|
{
|
||||||
|
namespace DNAMP3
|
||||||
|
{
|
||||||
|
struct HINT : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
Value<atUint32> magic;
|
||||||
|
Value<atUint32> version;
|
||||||
|
|
||||||
|
struct Hint : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
String<-1> name;
|
||||||
|
Value<float> unknown1;
|
||||||
|
Value<float> fadeInTime;
|
||||||
|
UniqueID64 stringID;
|
||||||
|
Value<atUint32> unknown2;
|
||||||
|
struct Location : BigYAML
|
||||||
|
{
|
||||||
|
DECL_YAML
|
||||||
|
UniqueID64 worldAssetID;
|
||||||
|
UniqueID64 areaAssetID;
|
||||||
|
Value<atUint32> areaID;
|
||||||
|
UniqueID64 stringID;
|
||||||
|
Value<atUint32> unknown[3];
|
||||||
|
};
|
||||||
|
|
||||||
|
Value<atUint32> locationCount;
|
||||||
|
Vector<Location, DNA_COUNT(locationCount)> locations;
|
||||||
|
};
|
||||||
|
Value<atUint32> hintCount;
|
||||||
|
Vector<Hint, DNA_COUNT(hintCount)> hints;
|
||||||
|
|
||||||
|
static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
|
||||||
|
{
|
||||||
|
HINT hint;
|
||||||
|
hint.read(rs);
|
||||||
|
athena::io::FileWriter writer(outPath.getAbsolutePath());
|
||||||
|
hint.toYAMLStream(writer);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // _DNAMP1_HINT_HPP_
|
|
@ -0,0 +1,43 @@
|
||||||
|
#include "CGameHintInfo.hpp"
|
||||||
|
#include "CToken.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
|
||||||
|
CGameHintInfo::CGameHintInfo(CInputStream& in, s32 version)
|
||||||
|
{
|
||||||
|
u32 hintCount = in.readUint32Big();
|
||||||
|
x0_hints.reserve(hintCount);
|
||||||
|
for (u32 i = 0; i < hintCount; ++i)
|
||||||
|
x0_hints.emplace_back(in, version);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGameHintInfo::CGameHint::CGameHint(CInputStream& in, s32 version)
|
||||||
|
: x0_name(in.readString())
|
||||||
|
, x10_(in.readFloatBig())
|
||||||
|
, x14_fadeInTime(in.readFloatBig())
|
||||||
|
, x18_stringId(in.readUint32Big())
|
||||||
|
, x1c_(3.f * float(version <= 0 ? 1 : in.readUint32Big()))
|
||||||
|
{
|
||||||
|
u32 locationCount = in.readUint32Big();
|
||||||
|
x20_locations.reserve(locationCount);
|
||||||
|
for (u32 i = 0; i < locationCount; ++i)
|
||||||
|
x20_locations.emplace_back(in, version);
|
||||||
|
}
|
||||||
|
|
||||||
|
CGameHintInfo::SHintLocation::SHintLocation(CInputStream& in, s32)
|
||||||
|
: x0_mlvlId(in.readUint32Big())
|
||||||
|
, x4_mreaId(in.readUint32Big())
|
||||||
|
, x8_areaId(in.readUint32Big())
|
||||||
|
, xc_stringId(in.readUint32Big())
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CFactoryFnReturn FHintFactory(const SObjectTag&, CInputStream& in, const CVParamTransfer, CObjectReference*)
|
||||||
|
{
|
||||||
|
in.readUint32Big();
|
||||||
|
s32 version = in.readInt32Big();
|
||||||
|
|
||||||
|
return TToken<CGameHintInfo>::GetIObjObjectFor(std::make_unique<CGameHintInfo>(in, version));
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
#ifndef __URDE_CGAMEHINTINFO_HPP__
|
||||||
|
#define __URDE_CGAMEHINTINFO_HPP__
|
||||||
|
|
||||||
|
#include "RetroTypes.hpp"
|
||||||
|
#include "IFactory.hpp"
|
||||||
|
|
||||||
|
namespace urde
|
||||||
|
{
|
||||||
|
class CGameHintInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
struct SHintLocation
|
||||||
|
{
|
||||||
|
ResId x0_mlvlId = -1;
|
||||||
|
ResId x4_mreaId = -1;
|
||||||
|
TAreaId x8_areaId = kInvalidAreaId;
|
||||||
|
ResId xc_stringId = -1;
|
||||||
|
SHintLocation(CInputStream&, s32);
|
||||||
|
};
|
||||||
|
|
||||||
|
class CGameHint
|
||||||
|
{
|
||||||
|
std::string x0_name;
|
||||||
|
float x10_;
|
||||||
|
float x14_fadeInTime;
|
||||||
|
ResId x18_stringId;
|
||||||
|
float x1c_;
|
||||||
|
std::vector<SHintLocation> x20_locations;
|
||||||
|
public:
|
||||||
|
CGameHint(CInputStream&, s32);
|
||||||
|
};
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::vector<CGameHint> x0_hints;
|
||||||
|
public:
|
||||||
|
CGameHintInfo(CInputStream&, s32);
|
||||||
|
};
|
||||||
|
|
||||||
|
CFactoryFnReturn FHintFactory(const SObjectTag&, CInputStream&, const CVParamTransfer, CObjectReference*);
|
||||||
|
}
|
||||||
|
#endif // __URDE_CGAMEHINTINFO_HPP__
|
|
@ -36,11 +36,8 @@ class CGameState
|
||||||
std::vector<CWorldState> x88_worldStates;
|
std::vector<CWorldState> x88_worldStates;
|
||||||
std::shared_ptr<CPlayerState> x98_playerState;
|
std::shared_ptr<CPlayerState> x98_playerState;
|
||||||
std::shared_ptr<CWorldTransManager> x9c_transManager;
|
std::shared_ptr<CWorldTransManager> x9c_transManager;
|
||||||
CGameOptions m_gameOpts;
|
|
||||||
double xa0_playTime;
|
double xa0_playTime;
|
||||||
u32 xa4_;
|
CGameOptions x17c_gameOptions;
|
||||||
|
|
||||||
/* x17c_ */
|
|
||||||
/* x1f8_ */
|
/* x1f8_ */
|
||||||
|
|
||||||
union
|
union
|
||||||
|
|
|
@ -95,6 +95,7 @@ add_library(RuntimeCommon
|
||||||
CInGameTweakManagerBase.hpp
|
CInGameTweakManagerBase.hpp
|
||||||
CPlayMovieBase.hpp
|
CPlayMovieBase.hpp
|
||||||
CGameDebug.hpp CGameDebug.cpp
|
CGameDebug.hpp CGameDebug.cpp
|
||||||
|
CGameHintInfo.hpp CGameHintInfo.cpp
|
||||||
rstl.hpp rstl.cpp
|
rstl.hpp rstl.cpp
|
||||||
GameGlobalObjects.hpp GameGlobalObjects.cpp
|
GameGlobalObjects.hpp GameGlobalObjects.cpp
|
||||||
RetroTypes.hpp
|
RetroTypes.hpp
|
||||||
|
|
Loading…
Reference in New Issue