mirror of https://github.com/AxioDL/metaforce.git
New atdna YAML handling
This commit is contained in:
parent
f638b97810
commit
1884f89f53
|
@ -90,11 +90,7 @@ public:
|
||||||
if (!g_PakRouter)
|
if (!g_PakRouter)
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
LogDNACommon.report(LogVisor::FatalError,
|
||||||
"UniqueIDBridge::setPakRouter must be called before translatePakIdToPath");
|
"UniqueIDBridge::setPakRouter must be called before translatePakIdToPath");
|
||||||
HECL::ProjectPath res = g_PakRouter->getWorking(id);
|
return g_PakRouter->getWorking(id);
|
||||||
if (!res)
|
|
||||||
LogDNACommon.report(LogVisor::FatalError,
|
|
||||||
"unable to translate %s to path", id.toString().c_str());
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
static HECL::ProjectPath MakePathFromString(const std::string& str)
|
static HECL::ProjectPath MakePathFromString(const std::string& str)
|
||||||
{
|
{
|
||||||
|
@ -126,7 +122,10 @@ public:
|
||||||
{
|
{
|
||||||
if (!operator bool())
|
if (!operator bool())
|
||||||
return;
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
HECL::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(*this);
|
||||||
|
if (!path)
|
||||||
|
return;
|
||||||
|
writer.writeString(nullptr, path.getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
{return __isz + 4;}
|
{return __isz + 4;}
|
||||||
|
@ -186,7 +185,10 @@ public:
|
||||||
{
|
{
|
||||||
if (!operator bool())
|
if (!operator bool())
|
||||||
return;
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
HECL::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(*this);
|
||||||
|
if (!path)
|
||||||
|
return;
|
||||||
|
writer.writeString(nullptr, path.getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
{return __isz + 8;}
|
{return __isz + 8;}
|
||||||
|
@ -267,7 +269,10 @@ public:
|
||||||
{
|
{
|
||||||
if (!operator bool())
|
if (!operator bool())
|
||||||
return;
|
return;
|
||||||
writer.writeString(nullptr, UniqueIDBridge::TranslatePakIdToPath(*this).getRelativePathUTF8());
|
HECL::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(*this);
|
||||||
|
if (!path)
|
||||||
|
return;
|
||||||
|
writer.writeString(nullptr, path.getRelativePathUTF8());
|
||||||
}
|
}
|
||||||
size_t binarySize(size_t __isz) const
|
size_t binarySize(size_t __isz) const
|
||||||
{return __isz + 16;}
|
{return __isz + 16;}
|
||||||
|
|
|
@ -498,9 +498,11 @@ const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(co
|
||||||
|
|
||||||
if (currentPAK)
|
if (currentPAK)
|
||||||
{
|
{
|
||||||
|
#ifndef NDEBUG
|
||||||
if (!silenceWarnings)
|
if (!silenceWarnings)
|
||||||
LogDNACommon.report(LogVisor::Warning,
|
LogDNACommon.report(LogVisor::Warning,
|
||||||
"unable to find PAK entry %s in current PAK", entry.toString().c_str());
|
"unable to find PAK entry %s in current PAK", entry.toString().c_str());
|
||||||
|
#endif
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -516,9 +518,11 @@ const typename BRIDGETYPE::PAKType::Entry* PAKRouter<BRIDGETYPE>::lookupEntry(co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef NDEBUG
|
||||||
if (!silenceWarnings)
|
if (!silenceWarnings)
|
||||||
LogDNACommon.report(LogVisor::Warning,
|
LogDNACommon.report(LogVisor::Warning,
|
||||||
"unable to find PAK entry %s", entry.toString().c_str());
|
"unable to find PAK entry %s", entry.toString().c_str());
|
||||||
|
#endif
|
||||||
if (nodeOut)
|
if (nodeOut)
|
||||||
*nodeOut = nullptr;
|
*nodeOut = nullptr;
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -1416,18 +1416,20 @@ struct SpawnSystemKeyframeData : BigYAML
|
||||||
r.leaveSubRecord();
|
r.leaveSubRecord();
|
||||||
}
|
}
|
||||||
spawns.clear();
|
spawns.clear();
|
||||||
if (r.enterSubVector("spawns"))
|
size_t spawnsCount;
|
||||||
|
if (r.enterSubVector("spawns", spawnsCount))
|
||||||
{
|
{
|
||||||
spawns.reserve(r.getCurNode()->m_seqChildren.size());
|
spawns.reserve(spawnsCount);
|
||||||
for (const auto& child : r.getCurNode()->m_seqChildren)
|
for (const auto& child : r.getCurNode()->m_seqChildren)
|
||||||
{
|
{
|
||||||
if (r.enterSubRecord(nullptr))
|
if (r.enterSubRecord(nullptr))
|
||||||
{
|
{
|
||||||
spawns.emplace_back();
|
spawns.emplace_back();
|
||||||
spawns.back().first = r.readUint32("startFrame");
|
spawns.back().first = r.readUint32("startFrame");
|
||||||
if (r.enterSubVector("systems"))
|
size_t systemsCount;
|
||||||
|
if (r.enterSubVector("systems", systemsCount))
|
||||||
{
|
{
|
||||||
spawns.back().second.reserve(r.getCurNode()->m_seqChildren.size());
|
spawns.back().second.reserve(systemsCount);
|
||||||
for (const auto& in : r.getCurNode()->m_seqChildren)
|
for (const auto& in : r.getCurNode()->m_seqChildren)
|
||||||
{
|
{
|
||||||
spawns.back().second.emplace_back();
|
spawns.back().second.emplace_back();
|
||||||
|
|
|
@ -122,12 +122,10 @@ struct AFSM : public BigYAML
|
||||||
|
|
||||||
void read(Athena::io::YAMLDocReader& __dna_docin)
|
void read(Athena::io::YAMLDocReader& __dna_docin)
|
||||||
{
|
{
|
||||||
/* triggerCount */
|
|
||||||
triggerCount = __dna_docin.readUint32("triggerCount");
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
/* triggers */
|
/* triggers */
|
||||||
__dna_docin.enumerate<Trigger>("triggers", triggers, triggerCount,
|
triggerCount = __dna_docin.enumerate<Trigger>("triggers", triggers,
|
||||||
[&](Athena::io::YAMLDocReader& in, Trigger& tr){
|
[&](Athena::io::YAMLDocReader& in, Trigger& tr){
|
||||||
tr.first = i == 0;
|
tr.first = i == 0;
|
||||||
tr.read(in);
|
tr.read(in);
|
||||||
i++;
|
i++;
|
||||||
|
@ -136,8 +134,6 @@ struct AFSM : public BigYAML
|
||||||
|
|
||||||
void write(Athena::io::YAMLDocWriter& __dna_docout) const
|
void write(Athena::io::YAMLDocWriter& __dna_docout) const
|
||||||
{
|
{
|
||||||
/* triggerCount */
|
|
||||||
__dna_docout.writeUint32("triggerCount", triggerCount);
|
|
||||||
/* triggers */
|
/* triggers */
|
||||||
__dna_docout.enumerate("triggers", triggers);
|
__dna_docout.enumerate("triggers", triggers);
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,7 +82,8 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(A
|
||||||
parmType = reader.readUint32("parmType");
|
parmType = reader.readUint32("parmType");
|
||||||
unk1 = reader.readUint32("unk1");
|
unk1 = reader.readUint32("unk1");
|
||||||
unk2 = reader.readFloat("unk2");
|
unk2 = reader.readFloat("unk2");
|
||||||
reader.enterSubVector("parmVals");
|
size_t parmValsCount;
|
||||||
|
reader.enterSubVector("parmVals", parmValsCount);
|
||||||
switch (DataType(parmType))
|
switch (DataType(parmType))
|
||||||
{
|
{
|
||||||
case DataType::Int32:
|
case DataType::Int32:
|
||||||
|
@ -247,17 +248,16 @@ size_t ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::binarySize(siz
|
||||||
void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io::YAMLDocReader& reader)
|
void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
id = reader.readUint32("id");
|
id = reader.readUint32("id");
|
||||||
atUint32 parmInfoCount = reader.readUint32("parmInfoCount");
|
|
||||||
atUint32 animInfoCount = reader.readUint32("animInfoCount");
|
|
||||||
|
|
||||||
reader.enumerate("parmInfos", parmInfos, parmInfoCount);
|
size_t parmInfoCount = reader.enumerate("parmInfos", parmInfos);
|
||||||
|
|
||||||
reader.enumerate<AnimInfo>("animInfos", animInfos, animInfoCount,
|
reader.enumerate<AnimInfo>("animInfos", animInfos,
|
||||||
[this, parmInfoCount](Athena::io::YAMLDocReader& reader, AnimInfo& ai)
|
[this, parmInfoCount](Athena::io::YAMLDocReader& reader, AnimInfo& ai)
|
||||||
{
|
{
|
||||||
ai.id = reader.readUint32("id");
|
ai.id = reader.readUint32("id");
|
||||||
ai.parmVals.reserve(parmInfoCount);
|
ai.parmVals.reserve(parmInfoCount);
|
||||||
reader.enterSubVector("parmVals");
|
size_t parmValsCount;
|
||||||
|
reader.enterSubVector("parmVals", parmValsCount);
|
||||||
for (const ParmInfo& pi : parmInfos)
|
for (const ParmInfo& pi : parmInfos)
|
||||||
{
|
{
|
||||||
switch (ParmInfo::DataType(pi.parmType))
|
switch (ParmInfo::DataType(pi.parmType))
|
||||||
|
@ -285,8 +285,6 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(Athena::io:
|
||||||
void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io::YAMLDocWriter& writer) const
|
void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
writer.writeUint32("id", id);
|
writer.writeUint32("id", id);
|
||||||
writer.writeUint32("parmInfoCount", parmInfos.size());
|
|
||||||
writer.writeUint32("animInfoCount", animInfos.size());
|
|
||||||
|
|
||||||
writer.enumerate("parmInfos", parmInfos);
|
writer.enumerate("parmInfos", parmInfos);
|
||||||
|
|
||||||
|
@ -533,25 +531,20 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
reader.enumerate("cskr", cskr);
|
reader.enumerate("cskr", cskr);
|
||||||
reader.enumerate("cinf", cinf);
|
reader.enumerate("cinf", cinf);
|
||||||
|
|
||||||
atUint32 animationCount = reader.readUint32("animationCount");
|
reader.enumerate("animations", animations);
|
||||||
reader.enumerate("animations", animations, animationCount);
|
|
||||||
|
|
||||||
reader.enumerate("pasDatabase", pasDatabase);
|
reader.enumerate("pasDatabase", pasDatabase);
|
||||||
|
|
||||||
atUint32 partCount = reader.readUint32("partCount");
|
reader.enumerate("part", partResData.part);
|
||||||
reader.enumerate("part", partResData.part, partCount);
|
|
||||||
|
|
||||||
atUint32 swhcCount = reader.readUint32("swhcCount");
|
reader.enumerate("swhc", partResData.swhc);
|
||||||
reader.enumerate("swhc", partResData.swhc, swhcCount);
|
|
||||||
|
|
||||||
atUint32 unkCount = reader.readUint32("unkCount");
|
reader.enumerate("unk", partResData.unk);
|
||||||
reader.enumerate("unk", partResData.unk, unkCount);
|
|
||||||
|
|
||||||
partResData.elsc.clear();
|
partResData.elsc.clear();
|
||||||
if (sectionCount > 5)
|
if (sectionCount > 5)
|
||||||
{
|
{
|
||||||
atUint32 elscCount = reader.readUint32("elscCount");
|
reader.enumerate("elsc", partResData.elsc);
|
||||||
reader.enumerate("elsc", partResData.elsc, elscCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unk1 = reader.readUint32("unk1");
|
unk1 = reader.readUint32("unk1");
|
||||||
|
@ -559,15 +552,13 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
animAABBs.clear();
|
animAABBs.clear();
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
atUint32 aabbCount = reader.readUint32("animAABBCount");
|
reader.enumerate("part", animAABBs);
|
||||||
reader.enumerate("part", animAABBs, aabbCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
effects.clear();
|
effects.clear();
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
atUint32 effectCount = reader.readUint32("effectCount");
|
reader.enumerate("effects", effects);
|
||||||
reader.enumerate("effects", effects, effectCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCount > 3)
|
if (sectionCount > 3)
|
||||||
|
@ -579,8 +570,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
animIdxs.clear();
|
animIdxs.clear();
|
||||||
if (sectionCount > 4)
|
if (sectionCount > 4)
|
||||||
{
|
{
|
||||||
atUint32 animIdxCount = reader.readUint32("animIdxCount");
|
reader.enumerate("animIdxs", animIdxs);
|
||||||
reader.enumerate("animIdxs", animIdxs, animIdxCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,23 +598,18 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
writer.enumerate("cskr", cskr);
|
writer.enumerate("cskr", cskr);
|
||||||
writer.enumerate("cinf", cinf);
|
writer.enumerate("cinf", cinf);
|
||||||
|
|
||||||
writer.writeUint32("animationCount", animations.size());
|
|
||||||
writer.enumerate("animations", animations);
|
writer.enumerate("animations", animations);
|
||||||
|
|
||||||
writer.enumerate("pasDatabase", pasDatabase);
|
writer.enumerate("pasDatabase", pasDatabase);
|
||||||
|
|
||||||
writer.writeUint32("partCount", partResData.part.size());
|
|
||||||
writer.enumerate("part", partResData.part);
|
writer.enumerate("part", partResData.part);
|
||||||
|
|
||||||
writer.writeUint32("swhcCount", partResData.swhc.size());
|
|
||||||
writer.enumerate("swhc", partResData.swhc);
|
writer.enumerate("swhc", partResData.swhc);
|
||||||
|
|
||||||
writer.writeUint32("unkCount", partResData.unk.size());
|
|
||||||
writer.enumerate("unk", partResData.unk);
|
writer.enumerate("unk", partResData.unk);
|
||||||
|
|
||||||
if (sectionCount > 5)
|
if (sectionCount > 5)
|
||||||
{
|
{
|
||||||
writer.writeUint32("elscCount", partResData.elsc.size());
|
|
||||||
writer.enumerate("elsc", partResData.elsc);
|
writer.enumerate("elsc", partResData.elsc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -632,13 +617,11 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
|
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
writer.writeUint32("animAABBCount", animAABBs.size());
|
|
||||||
writer.enumerate("animAABBs", animAABBs);
|
writer.enumerate("animAABBs", animAABBs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
writer.writeUint32("effectCount", effects.size());
|
|
||||||
writer.enumerate("effects", effects);
|
writer.enumerate("effects", effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,7 +633,6 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
|
|
||||||
if (sectionCount > 4)
|
if (sectionCount > 4)
|
||||||
{
|
{
|
||||||
writer.writeUint32("animIdxCount", animIdxs.size());
|
|
||||||
writer.enumerate("animIdxs", animIdxs);
|
writer.enumerate("animIdxs", animIdxs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -961,18 +943,15 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||||
|
|
||||||
atUint32 animationCount = reader.readUint32("animationCount");
|
reader.enumerate("animations", animations);
|
||||||
reader.enumerate("animations", animations, animationCount);
|
|
||||||
|
|
||||||
atUint32 transitionCount = reader.readUint32("transitionCount");
|
reader.enumerate("transitions", transitions);
|
||||||
reader.enumerate("transitions", transitions, transitionCount);
|
|
||||||
reader.enumerate("defaultTransition", defaultTransition);
|
reader.enumerate("defaultTransition", defaultTransition);
|
||||||
|
|
||||||
additiveAnims.clear();
|
additiveAnims.clear();
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
atUint32 additiveAnimCount = reader.readUint32("additiveAnimCount");
|
reader.enumerate("additiveAnims", additiveAnims);
|
||||||
reader.enumerate("additiveAnims", additiveAnims, additiveAnimCount);
|
|
||||||
floatA = reader.readFloat("floatA");
|
floatA = reader.readFloat("floatA");
|
||||||
floatB = reader.readFloat("floatB");
|
floatB = reader.readFloat("floatB");
|
||||||
}
|
}
|
||||||
|
@ -980,15 +959,13 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader)
|
||||||
halfTransitions.clear();
|
halfTransitions.clear();
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
atUint32 halfTransitionCount = reader.readUint32("halfTransitionCount");
|
reader.enumerate("halfTransitions", halfTransitions);
|
||||||
reader.enumerate("halfTransitions", halfTransitions, halfTransitionCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
animResources.clear();
|
animResources.clear();
|
||||||
if (sectionCount > 3)
|
if (sectionCount > 3)
|
||||||
{
|
{
|
||||||
atUint32 animResourcesCount = reader.readUint32("animResourcesCount");
|
reader.enumerate("animResources", animResources);
|
||||||
reader.enumerate("animResources", animResources, animResourcesCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1006,16 +983,13 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const
|
||||||
|
|
||||||
writer.writeUint16("sectionCount", sectionCount);
|
writer.writeUint16("sectionCount", sectionCount);
|
||||||
|
|
||||||
writer.writeUint32("animationCount", animations.size());
|
|
||||||
writer.enumerate("animations", animations);
|
writer.enumerate("animations", animations);
|
||||||
|
|
||||||
writer.writeUint32("transitionCount", transitions.size());
|
|
||||||
writer.enumerate("transitions", transitions);
|
writer.enumerate("transitions", transitions);
|
||||||
writer.enumerate("defaultTransition", defaultTransition);
|
writer.enumerate("defaultTransition", defaultTransition);
|
||||||
|
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
writer.writeUint32("additiveAnimCount", additiveAnims.size());
|
|
||||||
writer.enumerate("additiveAnims", additiveAnims);
|
writer.enumerate("additiveAnims", additiveAnims);
|
||||||
writer.writeFloat("floatA", floatA);
|
writer.writeFloat("floatA", floatA);
|
||||||
writer.writeFloat("floatB", floatB);
|
writer.writeFloat("floatB", floatB);
|
||||||
|
@ -1023,13 +997,11 @@ void ANCS::AnimationSet::write(Athena::io::YAMLDocWriter& writer) const
|
||||||
|
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
writer.writeUint32("halfTransitionCount", halfTransitions.size());
|
|
||||||
writer.enumerate("halfTransitions", halfTransitions);
|
writer.enumerate("halfTransitions", halfTransitions);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCount > 3)
|
if (sectionCount > 3)
|
||||||
{
|
{
|
||||||
writer.writeUint32("animResourcesCount", animResources.size());
|
|
||||||
writer.enumerate("animResources", animResources);
|
writer.enumerate("animResources", animResources);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,20 +50,16 @@ void EVNT::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
version = reader.readUint32("version");
|
version = reader.readUint32("version");
|
||||||
|
|
||||||
atUint32 loopCount = reader.readUint32("loopCount");
|
reader.enumerate("loopEvents", loopEvents);
|
||||||
reader.enumerate("loopEvents", loopEvents, loopCount);
|
|
||||||
|
|
||||||
uevtEvents.clear();
|
uevtEvents.clear();
|
||||||
atUint32 uevtCount = reader.readUint32("uevtCount");
|
reader.enumerate("uevtEvents", uevtEvents);
|
||||||
reader.enumerate("uevtEvents", uevtEvents, uevtCount);
|
|
||||||
|
|
||||||
atUint32 effectCount = reader.readUint32("effectCount");
|
reader.enumerate("effectEvents", effectEvents);
|
||||||
reader.enumerate("effectEvents", effectEvents, effectCount);
|
|
||||||
|
|
||||||
if (version == 2)
|
if (version == 2)
|
||||||
{
|
{
|
||||||
atUint32 sfxCount = reader.readUint32("sfxCount");
|
reader.enumerate("sfxEvents", sfxEvents);
|
||||||
reader.enumerate("sfxEvents", sfxEvents, sfxCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,18 +67,14 @@ void EVNT::write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
writer.writeUint32("version", version);
|
writer.writeUint32("version", version);
|
||||||
|
|
||||||
writer.writeUint32("loopCount", loopEvents.size());
|
|
||||||
writer.enumerate("loopEvents", loopEvents);
|
writer.enumerate("loopEvents", loopEvents);
|
||||||
|
|
||||||
writer.writeUint32("uevtCount", uevtEvents.size());
|
|
||||||
writer.enumerate("uevtEvents", uevtEvents);
|
writer.enumerate("uevtEvents", uevtEvents);
|
||||||
|
|
||||||
writer.writeUint32("effectCount", effectEvents.size());
|
|
||||||
writer.enumerate("effectEvents", effectEvents);
|
writer.enumerate("effectEvents", effectEvents);
|
||||||
|
|
||||||
if (version == 2)
|
if (version == 2)
|
||||||
{
|
{
|
||||||
writer.writeUint32("sfxCount", sfxEvents.size());
|
|
||||||
writer.enumerate("sfxEvents", sfxEvents);
|
writer.enumerate("sfxEvents", sfxEvents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,16 +84,14 @@ void SCLY::read(Athena::io::YAMLDocReader& docin)
|
||||||
{
|
{
|
||||||
fourCC = docin.readUint32("fourCC");
|
fourCC = docin.readUint32("fourCC");
|
||||||
version = docin.readUint32("version");
|
version = docin.readUint32("version");
|
||||||
layerCount = docin.readUint32("layerCount");
|
layerCount = docin.enumerate("layerSizes", layerSizes);
|
||||||
docin.enumerate("layerSizes", layerSizes, layerCount);
|
docin.enumerate("layers", layers);
|
||||||
docin.enumerate("layers", layers, layerCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCLY::write(Athena::io::YAMLDocWriter& docout) const
|
void SCLY::write(Athena::io::YAMLDocWriter& docout) const
|
||||||
{
|
{
|
||||||
docout.writeUint32("fourCC", fourCC);
|
docout.writeUint32("fourCC", fourCC);
|
||||||
docout.writeUint32("version", version);
|
docout.writeUint32("version", version);
|
||||||
docout.writeUint32("layerCount", layerCount);
|
|
||||||
docout.enumerate("layerSizes", layerSizes);
|
docout.enumerate("layerSizes", layerSizes);
|
||||||
docout.enumerate("layers", layers);
|
docout.enumerate("layers", layers);
|
||||||
}
|
}
|
||||||
|
@ -136,29 +134,35 @@ void SCLY::ScriptLayer::read(Athena::io::IStreamReader& rs)
|
||||||
void SCLY::ScriptLayer::read(Athena::io::YAMLDocReader& rs)
|
void SCLY::ScriptLayer::read(Athena::io::YAMLDocReader& rs)
|
||||||
{
|
{
|
||||||
unknown = rs.readUByte("unknown");
|
unknown = rs.readUByte("unknown");
|
||||||
objectCount = rs.readUint32("objectCount");
|
size_t objCount;
|
||||||
objects.reserve(objectCount);
|
objects.clear();
|
||||||
rs.enterSubVector("objects");
|
if (rs.enterSubVector("objects", objCount))
|
||||||
for (atUint32 i = 0; i < objectCount; i++)
|
|
||||||
{
|
{
|
||||||
rs.enterSubRecord(nullptr);
|
objectCount = objCount;
|
||||||
atUint8 type = rs.readUByte("type");
|
objects.reserve(objCount);
|
||||||
auto iter = std::find_if(SCRIPT_OBJECT_DB.begin(), SCRIPT_OBJECT_DB.end(), [&type](const ScriptObjectSpec* obj) -> bool
|
for (atUint32 i = 0; i < objectCount; i++)
|
||||||
{ return obj->type == type; });
|
|
||||||
|
|
||||||
if (iter != SCRIPT_OBJECT_DB.end())
|
|
||||||
{
|
{
|
||||||
std::unique_ptr<IScriptObject> obj((*iter)->a());
|
rs.enterSubRecord(nullptr);
|
||||||
obj->read(rs);
|
atUint8 type = rs.readUByte("type");
|
||||||
obj->type = type;
|
auto iter = std::find_if(SCRIPT_OBJECT_DB.begin(), SCRIPT_OBJECT_DB.end(), [&type](const ScriptObjectSpec* obj) -> bool
|
||||||
objects.push_back(std::move(obj));
|
{ return obj->type == type; });
|
||||||
}
|
|
||||||
else
|
|
||||||
Log.report(LogVisor::FatalError, _S("Unable to find type 0x%X in object database"), (atUint32)type);
|
|
||||||
|
|
||||||
rs.leaveSubRecord();
|
if (iter != SCRIPT_OBJECT_DB.end())
|
||||||
|
{
|
||||||
|
std::unique_ptr<IScriptObject> obj((*iter)->a());
|
||||||
|
obj->read(rs);
|
||||||
|
obj->type = type;
|
||||||
|
objects.push_back(std::move(obj));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Log.report(LogVisor::FatalError, _S("Unable to find type 0x%X in object database"), (atUint32)type);
|
||||||
|
|
||||||
|
rs.leaveSubRecord();
|
||||||
|
}
|
||||||
|
rs.leaveSubVector();
|
||||||
}
|
}
|
||||||
rs.leaveSubVector();
|
else
|
||||||
|
objectCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SCLY::ScriptLayer::write(Athena::io::IStreamWriter& ws) const
|
void SCLY::ScriptLayer::write(Athena::io::IStreamWriter& ws) const
|
||||||
|
@ -186,7 +190,6 @@ size_t SCLY::ScriptLayer::binarySize(size_t __isz) const
|
||||||
void SCLY::ScriptLayer::write(Athena::io::YAMLDocWriter& ws) const
|
void SCLY::ScriptLayer::write(Athena::io::YAMLDocWriter& ws) const
|
||||||
{
|
{
|
||||||
ws.writeUByte("unknown", unknown);
|
ws.writeUByte("unknown", unknown);
|
||||||
ws.writeUint32("objectCount", objectCount);
|
|
||||||
ws.enterSubVector("objects");
|
ws.enterSubVector("objects");
|
||||||
for (const std::unique_ptr<IScriptObject>& obj : objects)
|
for (const std::unique_ptr<IScriptObject>& obj : objects)
|
||||||
{
|
{
|
||||||
|
|
|
@ -247,43 +247,34 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
reader.enumerate("cskr", cskr);
|
reader.enumerate("cskr", cskr);
|
||||||
reader.enumerate("cinf", cinf);
|
reader.enumerate("cinf", cinf);
|
||||||
|
|
||||||
atUint32 animationCount = reader.readUint32("animationCount");
|
reader.enumerate("animations", animations);
|
||||||
reader.enumerate("animations", animations, animationCount);
|
|
||||||
|
|
||||||
reader.enumerate("pasDatabase", pasDatabase);
|
reader.enumerate("pasDatabase", pasDatabase);
|
||||||
|
|
||||||
atUint32 partCount = reader.readUint32("partCount");
|
reader.enumerate("part", partResData.part);
|
||||||
reader.enumerate("part", partResData.part, partCount);
|
|
||||||
|
|
||||||
atUint32 swhcCount = reader.readUint32("swhcCount");
|
reader.enumerate("swhc", partResData.swhc);
|
||||||
reader.enumerate("swhc", partResData.swhc, swhcCount);
|
|
||||||
|
|
||||||
atUint32 unkCount = reader.readUint32("unkCount");
|
reader.enumerate("unk", partResData.unk);
|
||||||
reader.enumerate("unk", partResData.unk, unkCount);
|
|
||||||
|
|
||||||
atUint32 elscCount = reader.readUint32("elscCount");
|
reader.enumerate("elsc", partResData.elsc);
|
||||||
reader.enumerate("elsc", partResData.elsc, elscCount);
|
|
||||||
|
|
||||||
atUint32 spscCount = reader.readUint32("spscCount");
|
reader.enumerate("spsc", partResData.spsc);
|
||||||
reader.enumerate("spsc", partResData.spsc, spscCount);
|
|
||||||
|
|
||||||
atUint32 unk2Count = reader.readUint32("unk2Count");
|
reader.enumerate("unk2", partResData.unk2);
|
||||||
reader.enumerate("unk2", partResData.unk2, unk2Count);
|
|
||||||
|
|
||||||
unk1 = reader.readUint32("unk1");
|
unk1 = reader.readUint32("unk1");
|
||||||
|
|
||||||
animAABBs.clear();
|
animAABBs.clear();
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
atUint32 aabbCount = reader.readUint32("animAABBCount");
|
reader.enumerate("part", animAABBs);
|
||||||
reader.enumerate("part", animAABBs, aabbCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
effects.clear();
|
effects.clear();
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
atUint32 effectCount = reader.readUint32("effectCount");
|
reader.enumerate("effects", effects);
|
||||||
reader.enumerate("effects", effects, effectCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCount > 3)
|
if (sectionCount > 3)
|
||||||
|
@ -295,8 +286,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
animIdxs.clear();
|
animIdxs.clear();
|
||||||
if (sectionCount > 4)
|
if (sectionCount > 4)
|
||||||
{
|
{
|
||||||
atUint32 animIdxCount = reader.readUint32("animIdxCount");
|
reader.enumerate("animIdxs", animIdxs);
|
||||||
reader.enumerate("animIdxs", animIdxs, animIdxCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
extents.clear();
|
extents.clear();
|
||||||
|
@ -304,8 +294,7 @@ void ANCS::CharacterSet::CharacterInfo::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
unk4 = reader.readUint32("unk4");
|
unk4 = reader.readUint32("unk4");
|
||||||
unk5 = reader.readUByte("unk5");
|
unk5 = reader.readUByte("unk5");
|
||||||
atUint32 extentsCount = reader.readUint32("extentsCount");
|
reader.enumerate("extents", extents);
|
||||||
reader.enumerate("extents", extents, extentsCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,40 +324,31 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
writer.enumerate("cskr", cskr);
|
writer.enumerate("cskr", cskr);
|
||||||
writer.enumerate("cinf", cinf);
|
writer.enumerate("cinf", cinf);
|
||||||
|
|
||||||
writer.writeUint32("animationCount", animations.size());
|
|
||||||
writer.enumerate("animations", animations);
|
writer.enumerate("animations", animations);
|
||||||
|
|
||||||
writer.enumerate("pasDatabase", pasDatabase);
|
writer.enumerate("pasDatabase", pasDatabase);
|
||||||
|
|
||||||
writer.writeUint32("partCount", partResData.part.size());
|
|
||||||
writer.enumerate("part", partResData.part);
|
writer.enumerate("part", partResData.part);
|
||||||
|
|
||||||
writer.writeUint32("swhcCount", partResData.swhc.size());
|
|
||||||
writer.enumerate("swhc", partResData.swhc);
|
writer.enumerate("swhc", partResData.swhc);
|
||||||
|
|
||||||
writer.writeUint32("unkCount", partResData.unk.size());
|
|
||||||
writer.enumerate("unk", partResData.unk);
|
writer.enumerate("unk", partResData.unk);
|
||||||
|
|
||||||
writer.writeUint32("elscCount", partResData.elsc.size());
|
|
||||||
writer.enumerate("elsc", partResData.elsc);
|
writer.enumerate("elsc", partResData.elsc);
|
||||||
|
|
||||||
writer.writeUint32("spscCount", partResData.spsc.size());
|
|
||||||
writer.enumerate("spsc", partResData.spsc);
|
writer.enumerate("spsc", partResData.spsc);
|
||||||
|
|
||||||
writer.writeUint32("unk2Count", partResData.unk2.size());
|
|
||||||
writer.enumerate("unk2", partResData.unk2);
|
writer.enumerate("unk2", partResData.unk2);
|
||||||
|
|
||||||
writer.writeUint32("unk1", unk1);
|
writer.writeUint32("unk1", unk1);
|
||||||
|
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
writer.writeUint32("animAABBCount", animAABBs.size());
|
|
||||||
writer.enumerate("animAABBs", animAABBs);
|
writer.enumerate("animAABBs", animAABBs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
writer.writeUint32("effectCount", effects.size());
|
|
||||||
writer.enumerate("effects", effects);
|
writer.enumerate("effects", effects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,7 +360,6 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
|
|
||||||
if (sectionCount > 4)
|
if (sectionCount > 4)
|
||||||
{
|
{
|
||||||
writer.writeUint32("animIdxCount", animIdxs.size());
|
|
||||||
writer.enumerate("animIdxs", animIdxs);
|
writer.enumerate("animIdxs", animIdxs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,7 +367,6 @@ void ANCS::CharacterSet::CharacterInfo::write(Athena::io::YAMLDocWriter& writer)
|
||||||
{
|
{
|
||||||
writer.writeUint32("unk4", unk4);
|
writer.writeUint32("unk4", unk4);
|
||||||
writer.writeUByte("unk5", unk5);
|
writer.writeUByte("unk5", unk5);
|
||||||
writer.writeUint32("extentsCount", extents.size());
|
|
||||||
writer.enumerate("extents", extents);
|
writer.enumerate("extents", extents);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -520,18 +498,15 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
atUint16 sectionCount = reader.readUint16("sectionCount");
|
atUint16 sectionCount = reader.readUint16("sectionCount");
|
||||||
|
|
||||||
atUint32 animationCount = reader.readUint32("animationCount");
|
reader.enumerate("animations", animations);
|
||||||
reader.enumerate("animations", animations, animationCount);
|
|
||||||
|
|
||||||
atUint32 transitionCount = reader.readUint32("transitionCount");
|
reader.enumerate("transitions", transitions);
|
||||||
reader.enumerate("transitions", transitions, transitionCount);
|
|
||||||
reader.enumerate("defaultTransition", defaultTransition);
|
reader.enumerate("defaultTransition", defaultTransition);
|
||||||
|
|
||||||
additiveAnims.clear();
|
additiveAnims.clear();
|
||||||
if (sectionCount > 1)
|
if (sectionCount > 1)
|
||||||
{
|
{
|
||||||
atUint32 additiveAnimCount = reader.readUint32("additiveAnimCount");
|
reader.enumerate("additiveAnims", additiveAnims);
|
||||||
reader.enumerate("additiveAnims", additiveAnims, additiveAnimCount);
|
|
||||||
floatA = reader.readFloat("floatA");
|
floatA = reader.readFloat("floatA");
|
||||||
floatB = reader.readFloat("floatB");
|
floatB = reader.readFloat("floatB");
|
||||||
}
|
}
|
||||||
|
@ -539,15 +514,13 @@ void ANCS::AnimationSet::read(Athena::io::YAMLDocReader& reader)
|
||||||
halfTransitions.clear();
|
halfTransitions.clear();
|
||||||
if (sectionCount > 2)
|
if (sectionCount > 2)
|
||||||
{
|
{
|
||||||
atUint32 halfTransitionCount = reader.readUint32("halfTransitionCount");
|
reader.enumerate("halfTransitions", halfTransitions);
|
||||||
reader.enumerate("halfTransitions", halfTransitions, halfTransitionCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
evnts.clear();
|
evnts.clear();
|
||||||
if (sectionCount > 3)
|
if (sectionCount > 3)
|
||||||
{
|
{
|
||||||
atUint32 evntsCount = reader.readUint32("evntsCount");
|
reader.enumerate("evnts", evnts);
|
||||||
reader.enumerate("evnts", evnts, evntsCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -665,40 +638,32 @@ void ANCS::AnimationSet::EVNT::read(Athena::io::YAMLDocReader& reader)
|
||||||
{
|
{
|
||||||
version = reader.readUint32("version");
|
version = reader.readUint32("version");
|
||||||
|
|
||||||
atUint32 loopCount = reader.readUint32("loopCount");
|
reader.enumerate("loopEvents", loopEvents);
|
||||||
reader.enumerate("loopEvents", loopEvents, loopCount);
|
|
||||||
|
|
||||||
uevtEvents.clear();
|
uevtEvents.clear();
|
||||||
if (version == 2)
|
if (version == 2)
|
||||||
{
|
{
|
||||||
atUint32 uevtCount = reader.readUint32("uevtCount");
|
reader.enumerate("uevtEvents", uevtEvents);
|
||||||
reader.enumerate("uevtEvents", uevtEvents, uevtCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
atUint32 effectCount = reader.readUint32("effectCount");
|
reader.enumerate("effectEvents", effectEvents);
|
||||||
reader.enumerate("effectEvents", effectEvents, effectCount);
|
|
||||||
|
|
||||||
atUint32 sfxCount = reader.readUint32("sfxCount");
|
reader.enumerate("sfxEvents", sfxEvents);
|
||||||
reader.enumerate("sfxEvents", sfxEvents, sfxCount);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANCS::AnimationSet::EVNT::write(Athena::io::YAMLDocWriter& writer) const
|
void ANCS::AnimationSet::EVNT::write(Athena::io::YAMLDocWriter& writer) const
|
||||||
{
|
{
|
||||||
writer.writeUint32("version", version);
|
writer.writeUint32("version", version);
|
||||||
|
|
||||||
writer.writeUint32("loopCount", loopEvents.size());
|
|
||||||
writer.enumerate("loopEvents", loopEvents);
|
writer.enumerate("loopEvents", loopEvents);
|
||||||
|
|
||||||
if (version == 2)
|
if (version == 2)
|
||||||
{
|
{
|
||||||
writer.writeUint32("uevtCount", uevtEvents.size());
|
|
||||||
writer.enumerate("uevtEvents", uevtEvents);
|
writer.enumerate("uevtEvents", uevtEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
writer.writeUint32("effectCount", effectEvents.size());
|
|
||||||
writer.enumerate("effectEvents", effectEvents);
|
writer.enumerate("effectEvents", effectEvents);
|
||||||
|
|
||||||
writer.writeUint32("sfxCount", sfxEvents.size());
|
|
||||||
writer.enumerate("sfxEvents", sfxEvents);
|
writer.enumerate("sfxEvents", sfxEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -139,7 +139,7 @@ struct ANCS : BigYAML
|
||||||
Value<atUint32> idx;
|
Value<atUint32> idx;
|
||||||
Value<atUint8> unk2;
|
Value<atUint8> unk2;
|
||||||
Value<float> unk3;
|
Value<float> unk3;
|
||||||
Value<float> unk4;
|
Value<atUint32> unk4;
|
||||||
Value<atUint32> unk5;
|
Value<atUint32> unk5;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,7 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::read(Athena::io::YAMLDocReader& reader
|
||||||
reader.enumerate("caudId", caudId);
|
reader.enumerate("caudId", caudId);
|
||||||
unk1 = reader.readUint32("unk1");
|
unk1 = reader.readUint32("unk1");
|
||||||
unk2 = reader.readUint32("unk2");
|
unk2 = reader.readUint32("unk2");
|
||||||
unk3 = reader.readUint32("unk3");
|
unk3 = reader.enumerate("unk3Vals", unk3Vals);
|
||||||
reader.enumerate("unk3Vals", unk3Vals, unk3);
|
|
||||||
extraType = reader.readUint32("extraType");
|
extraType = reader.readUint32("extraType");
|
||||||
if (extraType == 1)
|
if (extraType == 1)
|
||||||
extraFloat = reader.readFloat("extraFloat");
|
extraFloat = reader.readFloat("extraFloat");
|
||||||
|
@ -67,7 +66,6 @@ void CHAR::AnimationInfo::EVNT::SFXEvent::write(Athena::io::YAMLDocWriter& write
|
||||||
writer.enumerate("caudId", caudId);
|
writer.enumerate("caudId", caudId);
|
||||||
writer.writeUint32("unk1", unk1);
|
writer.writeUint32("unk1", unk1);
|
||||||
writer.writeUint32("unk2", unk2);
|
writer.writeUint32("unk2", unk2);
|
||||||
writer.writeUint32("unk3", unk3);
|
|
||||||
writer.enumerate("unk3Vals", unk3Vals);
|
writer.enumerate("unk3Vals", unk3Vals);
|
||||||
writer.writeUint32("extraType", extraType);
|
writer.writeUint32("extraType", extraType);
|
||||||
if (extraType == 1)
|
if (extraType == 1)
|
||||||
|
|
|
@ -276,7 +276,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||||
{
|
{
|
||||||
CGenDescription* desc = x1c_genDesc.GetObj();
|
CGenDescription* desc = x1c_genDesc.GetObj();
|
||||||
|
|
||||||
CIntElement* seedElem = desc->x1c_SEED.get();
|
CIntElement* seedElem = desc->x1c_x10_SEED.get();
|
||||||
if (seedElem)
|
if (seedElem)
|
||||||
{
|
{
|
||||||
int seedVal;
|
int seedVal;
|
||||||
|
@ -361,7 +361,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||||
psivElem->GetValue(0, x218_PSIV);
|
psivElem->GetValue(0, x218_PSIV);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CIntElement* maxpElem = desc->x28_MAXP.get();
|
CIntElement* maxpElem = desc->x28_x1c_MAXP.get();
|
||||||
if (maxpElem)
|
if (maxpElem)
|
||||||
maxpElem->GetValue(x50_curFrame, x70_MAXP);
|
maxpElem->GetValue(x50_curFrame, x70_MAXP);
|
||||||
|
|
||||||
|
@ -375,7 +375,7 @@ CElementGen::CElementGen(const TToken<CGenDescription>& gen,
|
||||||
x225_26_LINE = desc->x44_24_x30_24_LINE;
|
x225_26_LINE = desc->x44_24_x30_24_LINE;
|
||||||
x225_27_FXLL = desc->x44_25_x30_25_FXLL;
|
x225_27_FXLL = desc->x44_25_x30_25_FXLL;
|
||||||
|
|
||||||
CVectorElement* pofsElem = desc->x18_POFS.get();
|
CVectorElement* pofsElem = desc->x18_xc_POFS.get();
|
||||||
if (pofsElem)
|
if (pofsElem)
|
||||||
pofsElem->GetValue(x50_curFrame, x94_POFS);
|
pofsElem->GetValue(x50_curFrame, x94_POFS);
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ bool CElementGen::InternalUpdate(double dt)
|
||||||
x2c0_maxSize = 0.f;
|
x2c0_maxSize = 0.f;
|
||||||
float grte = 0.f;
|
float grte = 0.f;
|
||||||
CParticleGlobals::SetEmitterTime(x50_curFrame);
|
CParticleGlobals::SetEmitterTime(x50_curFrame);
|
||||||
CRealElement* grteElem = desc->x2c_GRTE.get();
|
CRealElement* grteElem = desc->x2c_x20_GRTE.get();
|
||||||
if (grteElem->GetValue(x50_curFrame, grte))
|
if (grteElem->GetValue(x50_curFrame, grte))
|
||||||
{
|
{
|
||||||
x2c_particleLists.clear();
|
x2c_particleLists.clear();
|
||||||
|
@ -527,7 +527,7 @@ bool CElementGen::InternalUpdate(double dt)
|
||||||
if (!x68_particleEmission || x50_curFrame >= x214_PSLT)
|
if (!x68_particleEmission || x50_curFrame >= x214_PSLT)
|
||||||
genCount = 0;
|
genCount = 0;
|
||||||
|
|
||||||
CIntElement* maxpElem = desc->x28_MAXP.get();
|
CIntElement* maxpElem = desc->x28_x1c_MAXP.get();
|
||||||
if (maxpElem)
|
if (maxpElem)
|
||||||
maxpElem->GetValue(x50_curFrame, x70_MAXP);
|
maxpElem->GetValue(x50_curFrame, x70_MAXP);
|
||||||
|
|
||||||
|
@ -690,10 +690,10 @@ void CElementGen::UpdateExistingParticles()
|
||||||
|
|
||||||
if (x225_26_LINE)
|
if (x225_26_LINE)
|
||||||
{
|
{
|
||||||
CRealElement* leng = desc->x20_LENG.get();
|
CRealElement* leng = desc->x20_x14_LENG.get();
|
||||||
if (leng)
|
if (leng)
|
||||||
err |= leng->GetValue(particleFrame, particle.x2c_lineLengthOrSize);
|
err |= leng->GetValue(particleFrame, particle.x2c_lineLengthOrSize);
|
||||||
CRealElement* widt = desc->x24_WIDT.get();
|
CRealElement* widt = desc->x24_x18_WIDT.get();
|
||||||
if (widt)
|
if (widt)
|
||||||
err |= widt->GetValue(particleFrame, particle.x30_lineWidthOrRota);
|
err |= widt->GetValue(particleFrame, particle.x30_lineWidthOrRota);
|
||||||
}
|
}
|
||||||
|
@ -707,7 +707,7 @@ void CElementGen::UpdateExistingParticles()
|
||||||
err |= size->GetValue(particleFrame, particle.x2c_lineLengthOrSize);
|
err |= size->GetValue(particleFrame, particle.x2c_lineLengthOrSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
CColorElement* colr = desc->x30_COLR.get();
|
CColorElement* colr = desc->x30_x24_COLR.get();
|
||||||
if (colr)
|
if (colr)
|
||||||
err |= colr->GetValue(particleFrame, particle.x34_color);
|
err |= colr->GetValue(particleFrame, particle.x34_color);
|
||||||
|
|
||||||
|
@ -746,14 +746,14 @@ void CElementGen::CreateNewParticles(int count)
|
||||||
|
|
||||||
CElementGen::CParticle& particle = g_StaticParticleList[staticIdx];
|
CElementGen::CParticle& particle = g_StaticParticleList[staticIdx];
|
||||||
particle.x28_startFrame = x50_curFrame;
|
particle.x28_startFrame = x50_curFrame;
|
||||||
CIntElement* ltme = desc->x34_LTME.get();
|
CIntElement* ltme = desc->x34_x28_LTME.get();
|
||||||
if (ltme)
|
if (ltme)
|
||||||
ltme->GetValue(0, particle.x0_endFrame);
|
ltme->GetValue(0, particle.x0_endFrame);
|
||||||
CParticleGlobals::SetParticleLifetime(particle.x0_endFrame);
|
CParticleGlobals::SetParticleLifetime(particle.x0_endFrame);
|
||||||
CParticleGlobals::UpdateParticleLifetimeTweenValues(0);
|
CParticleGlobals::UpdateParticleLifetimeTweenValues(0);
|
||||||
particle.x0_endFrame += x50_curFrame;
|
particle.x0_endFrame += x50_curFrame;
|
||||||
|
|
||||||
CColorElement* colr = desc->x30_COLR.get();
|
CColorElement* colr = desc->x30_x24_COLR.get();
|
||||||
if (colr)
|
if (colr)
|
||||||
colr->GetValue(0, particle.x34_color);
|
colr->GetValue(0, particle.x34_color);
|
||||||
else
|
else
|
||||||
|
@ -778,13 +778,13 @@ void CElementGen::CreateNewParticles(int count)
|
||||||
|
|
||||||
if (x225_26_LINE)
|
if (x225_26_LINE)
|
||||||
{
|
{
|
||||||
CRealElement* leng = desc->x20_LENG.get();
|
CRealElement* leng = desc->x20_x14_LENG.get();
|
||||||
if (leng)
|
if (leng)
|
||||||
leng->GetValue(0, particle.x2c_lineLengthOrSize);
|
leng->GetValue(0, particle.x2c_lineLengthOrSize);
|
||||||
else
|
else
|
||||||
particle.x2c_lineLengthOrSize = 1.f;
|
particle.x2c_lineLengthOrSize = 1.f;
|
||||||
|
|
||||||
CRealElement* widt = desc->x24_WIDT.get();
|
CRealElement* widt = desc->x24_x18_WIDT.get();
|
||||||
if (widt)
|
if (widt)
|
||||||
widt->GetValue(0, particle.x30_lineWidthOrRota);
|
widt->GetValue(0, particle.x30_lineWidthOrRota);
|
||||||
else
|
else
|
||||||
|
@ -850,7 +850,7 @@ void CElementGen::UpdatePSTranslationAndOrientation()
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
CVectorElement* pofs = desc->x18_POFS.get();
|
CVectorElement* pofs = desc->x18_xc_POFS.get();
|
||||||
if (pofs)
|
if (pofs)
|
||||||
pofs->GetValue(x50_curFrame, x94_POFS);
|
pofs->GetValue(x50_curFrame, x94_POFS);
|
||||||
|
|
||||||
|
@ -1441,7 +1441,7 @@ void CElementGen::RenderLines()
|
||||||
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear);
|
CGraphics::SetBlendMode(ERglBlendMode::Blend, ERglBlendFactor::SrcAlpha, ERglBlendFactor::InvSrcAlpha, ERglLogicOp::Clear);
|
||||||
}
|
}
|
||||||
|
|
||||||
CRealElement* widt = desc->x24_WIDT.get();
|
CRealElement* widt = desc->x24_x18_WIDT.get();
|
||||||
bool widtConst = false;
|
bool widtConst = false;
|
||||||
if (widt)
|
if (widt)
|
||||||
widtConst = widt->IsConstant();
|
widtConst = widt->IsConstant();
|
||||||
|
@ -1701,7 +1701,7 @@ void CElementGen::RenderParticles()
|
||||||
{
|
{
|
||||||
float theta = particle.x30_lineWidthOrRota * M_PI / 180.f;
|
float theta = particle.x30_lineWidthOrRota * M_PI / 180.f;
|
||||||
float sinT = sinf(theta) * size;
|
float sinT = sinf(theta) * size;
|
||||||
float cosT = sinf(theta) * size;
|
float cosT = cosf(theta) * size;
|
||||||
|
|
||||||
switch (m_shaderClass)
|
switch (m_shaderClass)
|
||||||
{
|
{
|
||||||
|
@ -1836,7 +1836,7 @@ void CElementGen::RenderParticles()
|
||||||
{
|
{
|
||||||
float theta = particle.x30_lineWidthOrRota * M_PI / 180.f;
|
float theta = particle.x30_lineWidthOrRota * M_PI / 180.f;
|
||||||
float sinT = sinf(theta) * size;
|
float sinT = sinf(theta) * size;
|
||||||
float cosT = sinf(theta) * size;
|
float cosT = cosf(theta) * size;
|
||||||
|
|
||||||
for (int i=0 ; i<mbspVal ; ++i)
|
for (int i=0 ; i<mbspVal ; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,20 +23,20 @@ public:
|
||||||
/* Naming convention: <demo-offset>_<retail-offset>_<name> */
|
/* Naming convention: <demo-offset>_<retail-offset>_<name> */
|
||||||
|
|
||||||
/* Removed from demo */
|
/* Removed from demo */
|
||||||
//std::unique_ptr<CVectorElement> x0_PSIV;
|
// std::unique_ptr<CVectorElement> x0_PSIV;
|
||||||
//std::unique_ptr<CModVectorElement> x4_PSVM;
|
// std::unique_ptr<CModVectorElement> x4_PSVM;
|
||||||
//std::unique_ptr<CVectorElement> x8_PSOV;
|
// std::unique_ptr<CVectorElement> x8_PSOV;
|
||||||
std::unique_ptr<CIntElement> xc_x0_PSLT;
|
std::unique_ptr<CIntElement> xc_x0_PSLT;
|
||||||
std::unique_ptr<CIntElement> x10_x4_PSWT;
|
std::unique_ptr<CIntElement> x10_x4_PSWT;
|
||||||
std::unique_ptr<CRealElement> x14_x8_PSTS;
|
std::unique_ptr<CRealElement> x14_x8_PSTS;
|
||||||
std::unique_ptr<CVectorElement> x18_POFS;
|
std::unique_ptr<CVectorElement> x18_xc_POFS;
|
||||||
std::unique_ptr<CIntElement> x1c_SEED;
|
std::unique_ptr<CIntElement> x1c_x10_SEED;
|
||||||
std::unique_ptr<CRealElement> x20_LENG;
|
std::unique_ptr<CRealElement> x20_x14_LENG;
|
||||||
std::unique_ptr<CRealElement> x24_WIDT;
|
std::unique_ptr<CRealElement> x24_x18_WIDT;
|
||||||
std::unique_ptr<CIntElement> x28_MAXP;
|
std::unique_ptr<CIntElement> x28_x1c_MAXP;
|
||||||
std::unique_ptr<CRealElement> x2c_GRTE;
|
std::unique_ptr<CRealElement> x2c_x20_GRTE;
|
||||||
std::unique_ptr<CColorElement> x30_COLR;
|
std::unique_ptr<CColorElement> x30_x24_COLR;
|
||||||
std::unique_ptr<CIntElement> x34_LTME;
|
std::unique_ptr<CIntElement> x34_x28_LTME;
|
||||||
/* Removed from demo (replaced by EMTR) */
|
/* Removed from demo (replaced by EMTR) */
|
||||||
// std::unique_ptr<CVectorElement> x38_ILOC;
|
// std::unique_ptr<CVectorElement> x38_ILOC;
|
||||||
// std::unique_ptr<CVectorElement> x3c_IVEC;
|
// std::unique_ptr<CVectorElement> x3c_IVEC;
|
||||||
|
|
|
@ -873,7 +873,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x40_x2c_EMTR.reset(GetEmitterElement(in));
|
fillDesc->x40_x2c_EMTR.reset(GetEmitterElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('COLR'):
|
case SBIG('COLR'):
|
||||||
fillDesc->x30_COLR.reset(GetColorElement(in));
|
fillDesc->x30_x24_COLR.reset(GetColorElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('CIND'):
|
case SBIG('CIND'):
|
||||||
fillDesc->x45_30_x32_24_CIND = GetBool(in);
|
fillDesc->x45_30_x32_24_CIND = GetBool(in);
|
||||||
|
@ -885,7 +885,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->xa0_x8c_CSSD.reset(GetIntElement(in));
|
fillDesc->xa0_x8c_CSSD.reset(GetIntElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('GRTE'):
|
case SBIG('GRTE'):
|
||||||
fillDesc->x2c_GRTE.reset(GetRealElement(in));
|
fillDesc->x2c_x20_GRTE.reset(GetRealElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('FXLL'):
|
case SBIG('FXLL'):
|
||||||
fillDesc->x44_25_x30_25_FXLL = GetBool(in);
|
fillDesc->x44_25_x30_25_FXLL = GetBool(in);
|
||||||
|
@ -919,10 +919,10 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x104_xf0_LCLR.reset(GetColorElement(in));
|
fillDesc->x104_xf0_LCLR.reset(GetColorElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('LENG'):
|
case SBIG('LENG'):
|
||||||
fillDesc->x20_LENG.reset(GetRealElement(in));
|
fillDesc->x20_x14_LENG.reset(GetRealElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('MAXP'):
|
case SBIG('MAXP'):
|
||||||
fillDesc->x28_MAXP.reset(GetIntElement(in));
|
fillDesc->x28_x1c_MAXP.reset(GetIntElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('LOFF'):
|
case SBIG('LOFF'):
|
||||||
fillDesc->x10c_xf8_LOFF.reset(GetVectorElement(in));
|
fillDesc->x10c_xf8_LOFF.reset(GetVectorElement(in));
|
||||||
|
@ -940,7 +940,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x44_29_x30_29_LIT_ = GetBool(in);
|
fillDesc->x44_29_x30_29_LIT_ = GetBool(in);
|
||||||
break;
|
break;
|
||||||
case SBIG('LTME'):
|
case SBIG('LTME'):
|
||||||
fillDesc->x34_LTME.reset(GetIntElement(in));
|
fillDesc->x34_x28_LTME.reset(GetIntElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('LSLA'):
|
case SBIG('LSLA'):
|
||||||
fillDesc->x11c_x108_LSLA.reset(GetRealElement(in));
|
fillDesc->x11c_x108_LSLA.reset(GetRealElement(in));
|
||||||
|
@ -991,7 +991,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x70_x5c_PMRT.reset(GetVectorElement(in));
|
fillDesc->x70_x5c_PMRT.reset(GetVectorElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('POFS'):
|
case SBIG('POFS'):
|
||||||
fillDesc->x18_POFS.reset(GetVectorElement(in));
|
fillDesc->x18_xc_POFS.reset(GetVectorElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('PMUS'):
|
case SBIG('PMUS'):
|
||||||
fillDesc->x45_24_x31_26_PMUS = GetBool(in);
|
fillDesc->x45_24_x31_26_PMUS = GetBool(in);
|
||||||
|
@ -1015,7 +1015,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x10_x4_PSWT.reset(GetIntElement(in));
|
fillDesc->x10_x4_PSWT.reset(GetIntElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('SEED'):
|
case SBIG('SEED'):
|
||||||
fillDesc->x1c_SEED.reset(GetIntElement(in));
|
fillDesc->x1c_x10_SEED.reset(GetIntElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('PMOO'):
|
case SBIG('PMOO'):
|
||||||
fillDesc->x45_25_x31_27_PMOO = GetBool(in);
|
fillDesc->x45_25_x31_27_PMOO = GetBool(in);
|
||||||
|
@ -1072,7 +1072,7 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
|
||||||
fillDesc->x44_27_x30_27_ZBUF = GetBool(in);
|
fillDesc->x44_27_x30_27_ZBUF = GetBool(in);
|
||||||
break;
|
break;
|
||||||
case SBIG('WIDT'):
|
case SBIG('WIDT'):
|
||||||
fillDesc->x24_WIDT.reset(GetRealElement(in));
|
fillDesc->x24_x18_WIDT.reset(GetRealElement(in));
|
||||||
break;
|
break;
|
||||||
case SBIG('ORNT'):
|
case SBIG('ORNT'):
|
||||||
fillDesc->x30_30_ORNT = GetBool(in);
|
fillDesc->x30_30_ORNT = GetBool(in);
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 448e1953e1ac457aa2ab21aef3030a04aca1e53e
|
Subproject commit 9611e3ace238f580570f1449142d3ef2f040ed72
|
Loading…
Reference in New Issue