mirror of https://github.com/AxioDL/metaforce.git
YAML RAII refactor
This commit is contained in:
parent
1b8baca988
commit
748e81ae6e
|
@ -81,43 +81,40 @@ void CRSM<IDType>::read(athena::io::YAMLDocReader& r)
|
|||
continue;
|
||||
}
|
||||
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
FourCC clsId(elem.first.c_str());
|
||||
auto gen = std::find_if(GeneratorTypes.begin(), GeneratorTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (gen != GeneratorTypes.end())
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
{
|
||||
x0_generators[clsId].read(r);
|
||||
r.leaveSubRecord();
|
||||
continue;
|
||||
}
|
||||
FourCC clsId(elem.first.c_str());
|
||||
auto gen = std::find_if(GeneratorTypes.begin(), GeneratorTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (gen != GeneratorTypes.end())
|
||||
{
|
||||
x0_generators[clsId].read(r);
|
||||
continue;
|
||||
}
|
||||
|
||||
auto sfx = std::find_if(SFXTypes.begin(), SFXTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (sfx != SFXTypes.end())
|
||||
{
|
||||
x10_sfx[clsId] = r.readInt32(clsId.toString().c_str());
|
||||
r.leaveSubRecord();
|
||||
continue;
|
||||
}
|
||||
auto sfx = std::find_if(SFXTypes.begin(), SFXTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (sfx != SFXTypes.end())
|
||||
{
|
||||
x10_sfx[clsId] = r.readInt32(clsId.toString().c_str());
|
||||
continue;
|
||||
}
|
||||
|
||||
auto decal = std::find_if(DecalTypes.begin(), DecalTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (decal != DecalTypes.end())
|
||||
{
|
||||
x20_decals[clsId].read(r);
|
||||
r.leaveSubRecord();
|
||||
continue;
|
||||
auto decal = std::find_if(DecalTypes.begin(), DecalTypes.end(), [&clsId](const FourCC& other) -> bool{
|
||||
return clsId == other;
|
||||
});
|
||||
if (decal != DecalTypes.end())
|
||||
{
|
||||
x20_decals[clsId].read(r);
|
||||
continue;
|
||||
}
|
||||
if (clsId == SBIG('RNGE'))
|
||||
x30_RNGE = r.readFloat(nullptr);
|
||||
else if (clsId == SBIG('FOFF'))
|
||||
x34_FOFF = r.readFloat(nullptr);
|
||||
}
|
||||
if (clsId == SBIG('RNGE'))
|
||||
x30_RNGE = r.readFloat(nullptr);
|
||||
else if (clsId == SBIG('FOFF'))
|
||||
x34_FOFF = r.readFloat(nullptr);
|
||||
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -125,30 +122,18 @@ template <class IDType>
|
|||
void CRSM<IDType>::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
for (const auto& pair : x0_generators)
|
||||
{
|
||||
if (pair.second)
|
||||
{
|
||||
w.enterSubRecord(pair.first.toString().c_str());
|
||||
pair.second.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(pair.first.toString().c_str()))
|
||||
pair.second.write(w);
|
||||
|
||||
for (const auto& pair : x10_sfx)
|
||||
{
|
||||
if (pair.second != ~0)
|
||||
w.writeUint32(pair.first.toString().c_str(), pair.second);
|
||||
}
|
||||
|
||||
for (const auto& pair : x20_decals)
|
||||
{
|
||||
if (pair.second)
|
||||
{
|
||||
w.enterSubRecord(pair.first.toString().c_str());
|
||||
pair.second.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(pair.first.toString().c_str()))
|
||||
pair.second.write(w);
|
||||
|
||||
if (x30_RNGE != 50.f)
|
||||
w.writeFloat("RNGE", x30_RNGE);
|
||||
|
|
|
@ -63,21 +63,23 @@ public:
|
|||
void read(athena::io::YAMLDocReader& reader)
|
||||
{
|
||||
size_t count;
|
||||
reader.enterSubVector(nullptr, count);
|
||||
r = (count >= 1) ? reader.readFloat(nullptr) : 0.f;
|
||||
g = (count >= 2) ? reader.readFloat(nullptr) : 0.f;
|
||||
b = (count >= 3) ? reader.readFloat(nullptr) : 0.f;
|
||||
a = (count >= 4) ? reader.readFloat(nullptr) : 0.f;
|
||||
reader.leaveSubVector();
|
||||
if (auto v = reader.enterSubVector(nullptr, count))
|
||||
{
|
||||
r = (count >= 1) ? reader.readFloat(nullptr) : 0.f;
|
||||
g = (count >= 2) ? reader.readFloat(nullptr) : 0.f;
|
||||
b = (count >= 3) ? reader.readFloat(nullptr) : 0.f;
|
||||
a = (count >= 4) ? reader.readFloat(nullptr) : 0.f;
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& writer) const
|
||||
{
|
||||
writer.enterSubVector(nullptr);
|
||||
writer.writeFloat(nullptr, r);
|
||||
writer.writeFloat(nullptr, g);
|
||||
writer.writeFloat(nullptr, b);
|
||||
writer.writeFloat(nullptr, a);
|
||||
writer.leaveSubVector();
|
||||
if (auto v = writer.enterSubVector(nullptr))
|
||||
{
|
||||
writer.writeFloat(nullptr, r);
|
||||
writer.writeFloat(nullptr, g);
|
||||
writer.writeFloat(nullptr, b);
|
||||
writer.writeFloat(nullptr, a);
|
||||
}
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{return __isz + 4;}
|
||||
|
|
|
@ -15,58 +15,58 @@ void DPSM<IDType>::read(athena::io::YAMLDocReader& r)
|
|||
continue;
|
||||
}
|
||||
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
bool loadFirstDesc = false;
|
||||
uint32_t clsId = *reinterpret_cast<const uint32_t*>(elem.first.c_str());
|
||||
switch(clsId)
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
{
|
||||
case SBIG('1SZE'):
|
||||
case SBIG('1LFT'):
|
||||
case SBIG('1ROT'):
|
||||
case SBIG('1OFF'):
|
||||
case SBIG('1CLR'):
|
||||
case SBIG('1TEX'):
|
||||
case SBIG('1ADD'):
|
||||
loadFirstDesc = true;
|
||||
case SBIG('2SZE'):
|
||||
case SBIG('2LFT'):
|
||||
case SBIG('2ROT'):
|
||||
case SBIG('2OFF'):
|
||||
case SBIG('2CLR'):
|
||||
case SBIG('2TEX'):
|
||||
case SBIG('2ADD'):
|
||||
if (loadFirstDesc)
|
||||
readQuadDecalInfo(r, clsId, x0_quad);
|
||||
else
|
||||
readQuadDecalInfo(r, clsId, x1c_quad);
|
||||
break;
|
||||
case SBIG('DMDL'):
|
||||
x38_DMDL.read(r);
|
||||
break;
|
||||
case SBIG('DLFT'):
|
||||
x48_DLFT.read(r);
|
||||
break;
|
||||
case SBIG('DMOP'):
|
||||
x4c_DMOP.read(r);
|
||||
break;
|
||||
case SBIG('DMRT'):
|
||||
x50_DMRT.read(r);
|
||||
break;
|
||||
case SBIG('DMSC'):
|
||||
x54_DMSC.read(r);
|
||||
break;
|
||||
case SBIG('DMCL'):
|
||||
x58_DMCL.read(r);
|
||||
break;
|
||||
case SBIG('DMAB'):
|
||||
x5c_24_DMAB = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('DMOO'):
|
||||
x5c_25_DMOO = r.readBool(nullptr);
|
||||
break;
|
||||
bool loadFirstDesc = false;
|
||||
uint32_t clsId = *reinterpret_cast<const uint32_t*>(elem.first.c_str());
|
||||
switch(clsId)
|
||||
{
|
||||
case SBIG('1SZE'):
|
||||
case SBIG('1LFT'):
|
||||
case SBIG('1ROT'):
|
||||
case SBIG('1OFF'):
|
||||
case SBIG('1CLR'):
|
||||
case SBIG('1TEX'):
|
||||
case SBIG('1ADD'):
|
||||
loadFirstDesc = true;
|
||||
case SBIG('2SZE'):
|
||||
case SBIG('2LFT'):
|
||||
case SBIG('2ROT'):
|
||||
case SBIG('2OFF'):
|
||||
case SBIG('2CLR'):
|
||||
case SBIG('2TEX'):
|
||||
case SBIG('2ADD'):
|
||||
if (loadFirstDesc)
|
||||
readQuadDecalInfo(r, clsId, x0_quad);
|
||||
else
|
||||
readQuadDecalInfo(r, clsId, x1c_quad);
|
||||
break;
|
||||
case SBIG('DMDL'):
|
||||
x38_DMDL.read(r);
|
||||
break;
|
||||
case SBIG('DLFT'):
|
||||
x48_DLFT.read(r);
|
||||
break;
|
||||
case SBIG('DMOP'):
|
||||
x4c_DMOP.read(r);
|
||||
break;
|
||||
case SBIG('DMRT'):
|
||||
x50_DMRT.read(r);
|
||||
break;
|
||||
case SBIG('DMSC'):
|
||||
x54_DMSC.read(r);
|
||||
break;
|
||||
case SBIG('DMCL'):
|
||||
x58_DMCL.read(r);
|
||||
break;
|
||||
case SBIG('DMAB'):
|
||||
x5c_24_DMAB = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('DMOO'):
|
||||
x5c_25_DMOO = r.readBool(nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,41 +77,24 @@ void DPSM<IDType>::write(athena::io::YAMLDocWriter& w) const
|
|||
writeQuadDecalInfo(w, x1c_quad, false);
|
||||
|
||||
if (x38_DMDL)
|
||||
{
|
||||
w.enterSubRecord("DMDL");
|
||||
x38_DMDL.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DMDL"))
|
||||
x38_DMDL.write(w);
|
||||
if (x48_DLFT)
|
||||
{
|
||||
w.enterSubRecord("DLFT");
|
||||
x48_DLFT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DLFT"))
|
||||
x48_DLFT.write(w);
|
||||
if (x4c_DMOP)
|
||||
{
|
||||
w.enterSubRecord("DMOP");
|
||||
x4c_DMOP.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DMOP"))
|
||||
x4c_DMOP.write(w);
|
||||
if (x50_DMRT)
|
||||
{
|
||||
w.enterSubRecord("DMRT");
|
||||
x50_DMRT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DMRT"))
|
||||
x50_DMRT.write(w);
|
||||
if (x54_DMSC)
|
||||
{
|
||||
w.enterSubRecord("DMSC");
|
||||
x54_DMSC.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DMSC"))
|
||||
x54_DMSC.write(w);
|
||||
if (x58_DMCL)
|
||||
{
|
||||
w.enterSubRecord("DMCL");
|
||||
x54_DMSC.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("DMCL"))
|
||||
x54_DMSC.write(w);
|
||||
|
||||
if (x5c_24_DMAB)
|
||||
w.writeBool("DMAB", x5c_24_DMAB);
|
||||
if (x5c_25_DMOO)
|
||||
|
@ -160,48 +143,26 @@ void DPSM<IDType>::writeQuadDecalInfo(athena::io::YAMLDocWriter& w,
|
|||
const typename DPSM<IDType>::SQuadDescr& quad, bool first) const
|
||||
{
|
||||
if (quad.x0_LFT)
|
||||
{
|
||||
w.enterSubRecord((first ? "1LFT" : "2LFT"));
|
||||
quad.x0_LFT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
|
||||
if (auto rec = w.enterSubRecord((first ? "1LFT" : "2LFT")))
|
||||
quad.x0_LFT.write(w);
|
||||
if (quad.x4_SZE)
|
||||
{
|
||||
w.enterSubRecord((first ? "1SZE" : "2SZE"));
|
||||
quad.x4_SZE.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1SZE" : "2SZE")))
|
||||
quad.x4_SZE.write(w);
|
||||
if (quad.x8_ROT)
|
||||
{
|
||||
w.enterSubRecord((first ? "1ROT" : "2ROT"));
|
||||
quad.x8_ROT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1ROT" : "2ROT")))
|
||||
quad.x8_ROT.write(w);
|
||||
if (quad.xc_OFF)
|
||||
{
|
||||
w.enterSubRecord((first ? "1OFF" : "2OFF"));
|
||||
quad.xc_OFF.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1OFF" : "2OFF")))
|
||||
quad.xc_OFF.write(w);
|
||||
if (quad.x10_CLR)
|
||||
{
|
||||
w.enterSubRecord((first ? "1CLR" : "2CLR"));
|
||||
quad.x10_CLR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1CLR" : "2CLR")))
|
||||
quad.x10_CLR.write(w);
|
||||
if (quad.x14_TEX)
|
||||
{
|
||||
w.enterSubRecord((first ? "1TEX" : "2TEX"));
|
||||
quad.x14_TEX.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1TEX" : "2TEX")))
|
||||
quad.x14_TEX.write(w);
|
||||
if (quad.x18_ADD)
|
||||
{
|
||||
w.enterSubRecord((first ? "1ADD" : "2ADD"));
|
||||
quad.x18_ADD.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord((first ? "1ADD" : "2ADD")))
|
||||
quad.x18_ADD.write(w);
|
||||
}
|
||||
|
||||
template <class IDType>
|
||||
|
|
|
@ -84,125 +84,65 @@ template <class IDType>
|
|||
void ELSM<IDType>::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (x0_LIFE)
|
||||
{
|
||||
w.enterSubRecord("LIFE");
|
||||
x0_LIFE.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LIFE"))
|
||||
x0_LIFE.write(w);
|
||||
if (x4_SLIF)
|
||||
{
|
||||
w.enterSubRecord("SLIF");
|
||||
x4_SLIF.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SLIF"))
|
||||
x4_SLIF.write(w);
|
||||
if (x8_GRAT)
|
||||
{
|
||||
w.enterSubRecord("GRAT");
|
||||
x8_GRAT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("GRAT"))
|
||||
x8_GRAT.write(w);
|
||||
if (xc_SCNT)
|
||||
{
|
||||
w.enterSubRecord("SCNT");
|
||||
xc_SCNT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SCNT"))
|
||||
xc_SCNT.write(w);
|
||||
if (x10_SSEG)
|
||||
{
|
||||
w.enterSubRecord("SSEG");
|
||||
x10_SSEG.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SSEG"))
|
||||
x10_SSEG.write(w);
|
||||
if (x14_COLR)
|
||||
{
|
||||
w.enterSubRecord("COLR");
|
||||
x14_COLR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("COLR"))
|
||||
x14_COLR.write(w);
|
||||
if (x18_IEMT)
|
||||
{
|
||||
w.enterSubRecord("IEMT");
|
||||
x18_IEMT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("IEMT"))
|
||||
x18_IEMT.write(w);
|
||||
if (x1c_FEMT)
|
||||
{
|
||||
w.enterSubRecord("FEMT");
|
||||
x1c_FEMT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("FEMT"))
|
||||
x1c_FEMT.write(w);
|
||||
if (x20_AMPL)
|
||||
{
|
||||
w.enterSubRecord("AMPL");
|
||||
x20_AMPL.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AMPL"))
|
||||
x20_AMPL.write(w);
|
||||
if (x24_AMPD)
|
||||
{
|
||||
w.enterSubRecord("AMPD");
|
||||
x24_AMPD.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AMPD"))
|
||||
x24_AMPD.write(w);
|
||||
if (x28_LWD1)
|
||||
{
|
||||
w.enterSubRecord("LWD1");
|
||||
x28_LWD1.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LWD1"))
|
||||
x28_LWD1.write(w);
|
||||
if (x2c_LWD2)
|
||||
{
|
||||
w.enterSubRecord("LWD2");
|
||||
x2c_LWD2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LWD2"))
|
||||
x2c_LWD2.write(w);
|
||||
if (x30_LWD3)
|
||||
{
|
||||
w.enterSubRecord("LWD3");
|
||||
x30_LWD3.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LWD3"))
|
||||
x30_LWD3.write(w);
|
||||
if (x34_LCL1)
|
||||
{
|
||||
w.enterSubRecord("LCL1");
|
||||
x34_LCL1.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LCL1"))
|
||||
x34_LCL1.write(w);
|
||||
if (x38_LCL2)
|
||||
{
|
||||
w.enterSubRecord("LCL2");
|
||||
x38_LCL2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LCL2"))
|
||||
x38_LCL2.write(w);
|
||||
if (x3c_LCL3)
|
||||
{
|
||||
w.enterSubRecord("LCL3");
|
||||
x3c_LCL3.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LCL3"))
|
||||
x3c_LCL3.write(w);
|
||||
if (x40_SSWH)
|
||||
{
|
||||
w.enterSubRecord("SSWH");
|
||||
x40_SSWH.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SSWH"))
|
||||
x40_SSWH.write(w);
|
||||
if (x50_GPSM)
|
||||
{
|
||||
w.enterSubRecord("GPSM");
|
||||
x50_GPSM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("GPSM"))
|
||||
x50_GPSM.write(w);
|
||||
if (x60_EPSM)
|
||||
{
|
||||
w.enterSubRecord("EPSM");
|
||||
x60_EPSM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("EPSM"))
|
||||
x60_EPSM.write(w);
|
||||
if (x70_ZERY)
|
||||
{
|
||||
w.enterSubRecord("ZERY");
|
||||
x70_ZERY.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("ZERY"))
|
||||
x70_ZERY.write(w);
|
||||
}
|
||||
|
||||
template <class IDType>
|
||||
|
|
|
@ -186,20 +186,20 @@ void FONT<IDType>::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
/* glyphCount */
|
||||
/* glyphs */
|
||||
size_t count;
|
||||
__dna_docin.enterSubVector("glyphs", count);
|
||||
glyphCount = count;
|
||||
for (atUint32 i = 0; i < glyphCount; i++)
|
||||
if (auto v = __dna_docin.enterSubVector("glyphs", count))
|
||||
{
|
||||
if (version < 4)
|
||||
glyphs.emplace_back(new GlyphMP1);
|
||||
else
|
||||
glyphs.emplace_back(new GlyphMP2);
|
||||
glyphCount = count;
|
||||
for (atUint32 i = 0; i < glyphCount; i++)
|
||||
{
|
||||
if (version < 4)
|
||||
glyphs.emplace_back(new GlyphMP1);
|
||||
else
|
||||
glyphs.emplace_back(new GlyphMP2);
|
||||
|
||||
__dna_docin.enterSubRecord(nullptr);
|
||||
glyphs.back()->read(__dna_docin);
|
||||
__dna_docin.leaveSubRecord();
|
||||
if (auto rec = __dna_docin.enterSubRecord(nullptr))
|
||||
glyphs.back()->read(__dna_docin);
|
||||
}
|
||||
}
|
||||
__dna_docin.leaveSubVector();
|
||||
/* kerningInfoCount squelched */
|
||||
/* kerningInfo */
|
||||
kerningInfoCount = __dna_docin.enumerate("kerningInfo", kerningInfo);
|
||||
|
@ -234,16 +234,10 @@ void FONT<IDType>::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
__dna_docout.writeUint32("textureFormat", textureFormat);
|
||||
/* glyphCount squelched */
|
||||
/* glyphs */
|
||||
__dna_docout.enterSubVector("glyphs");
|
||||
|
||||
for (const std::unique_ptr<IGlyph>& glyph : glyphs)
|
||||
{
|
||||
__dna_docout.enterSubRecord(nullptr);
|
||||
glyph->write(__dna_docout);
|
||||
__dna_docout.leaveSubRecord();
|
||||
}
|
||||
|
||||
__dna_docout.leaveSubVector();
|
||||
if (auto v = __dna_docout.enterSubVector("glyphs"))
|
||||
for (const std::unique_ptr<IGlyph>& glyph : glyphs)
|
||||
if (auto rec = __dna_docout.enterSubRecord(nullptr))
|
||||
glyph->write(__dna_docout);
|
||||
/* kerningInfoCount squelched */
|
||||
/* kerningInfo */
|
||||
__dna_docout.enumerate("kerningInfo", kerningInfo);
|
||||
|
|
|
@ -207,18 +207,20 @@ void PAKRouter<BRIDGETYPE>::build(std::vector<BRIDGETYPE>& bridges, std::functio
|
|||
{
|
||||
if (namedEntry.name == "holo_cinf")
|
||||
continue; /* Problematic corner case */
|
||||
catalogWriter.enterSubRecord(namedEntry.name.c_str());
|
||||
hecl::ProjectPath working = getWorking(namedEntry.id);
|
||||
if (working.getAuxInfoUTF8().size())
|
||||
if (auto rec = catalogWriter.enterSubRecord(namedEntry.name.c_str()))
|
||||
{
|
||||
catalogWriter.enterSubVector(nullptr);
|
||||
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
|
||||
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8().c_str());
|
||||
catalogWriter.leaveSubVector();
|
||||
hecl::ProjectPath working = getWorking(namedEntry.id);
|
||||
if (working.getAuxInfoUTF8().size())
|
||||
{
|
||||
if (auto v = catalogWriter.enterSubVector(nullptr))
|
||||
{
|
||||
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
|
||||
catalogWriter.writeString(nullptr, working.getAuxInfoUTF8().c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
|
||||
}
|
||||
else
|
||||
catalogWriter.writeString(nullptr, working.getRelativePathUTF8().c_str());
|
||||
catalogWriter.leaveSubRecord();
|
||||
}
|
||||
|
||||
/* Write catalog */
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -125,19 +125,15 @@ void RealElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void RealElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t RealElementFactory::binarySize(size_t __isz) const
|
||||
|
@ -348,19 +344,15 @@ void IntElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void IntElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t IntElementFactory::binarySize(size_t __isz) const
|
||||
|
@ -522,19 +514,15 @@ void VectorElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void VectorElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t VectorElementFactory::binarySize(size_t __isz) const
|
||||
|
@ -664,19 +652,15 @@ void ColorElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void ColorElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t ColorElementFactory::binarySize(size_t __isz) const
|
||||
|
@ -790,19 +774,15 @@ void ModVectorElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void ModVectorElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t ModVectorElementFactory::binarySize(size_t __isz) const
|
||||
|
@ -909,19 +889,15 @@ void EmitterElementFactory::read(athena::io::YAMLDocReader& r)
|
|||
m_elem.reset();
|
||||
return;
|
||||
}
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
m_elem->read(r);
|
||||
}
|
||||
|
||||
void EmitterElementFactory::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t EmitterElementFactory::binarySize(size_t __isz) const
|
||||
|
|
|
@ -631,25 +631,21 @@ struct VEConstant : IVectorElement
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
size_t elemCount;
|
||||
r.enterSubVector(nullptr, elemCount);
|
||||
for (int i=0 ; i<3 && i<elemCount ; ++i)
|
||||
if (auto v = r.enterSubVector(nullptr, elemCount))
|
||||
{
|
||||
r.enterSubRecord(nullptr);
|
||||
comps[i].read(r);
|
||||
r.leaveSubRecord();
|
||||
for (int i=0 ; i<3 && i<elemCount ; ++i)
|
||||
{
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
comps[i].read(r);
|
||||
}
|
||||
}
|
||||
r.leaveSubVector();
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubVector(nullptr);
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
w.enterSubRecord(nullptr);
|
||||
comps[i].write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
w.leaveSubVector();
|
||||
if (auto v = w.enterSubVector(nullptr))
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
if (auto rec = w.enterSubRecord(nullptr))
|
||||
comps[i].write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -782,22 +778,15 @@ struct CEConstant : IColorElement
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
for (int i=0 ; i<4 ; ++i)
|
||||
{
|
||||
r.enterSubRecord(nullptr);
|
||||
comps[i].read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
comps[i].read(r);
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubVector(nullptr);
|
||||
for (int i=0 ; i<4 ; ++i)
|
||||
{
|
||||
w.enterSubRecord(nullptr);
|
||||
comps[i].write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
w.leaveSubVector();
|
||||
if (auto v = w.enterSubVector(nullptr))
|
||||
for (int i=0 ; i<4 ; ++i)
|
||||
if (auto rec = w.enterSubRecord(nullptr))
|
||||
comps[i].write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -912,22 +901,15 @@ struct MVEConstant : IModVectorElement
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
r.enterSubRecord(nullptr);
|
||||
comps[i].read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
comps[i].read(r);
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubVector(nullptr);
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
{
|
||||
w.enterSubRecord(nullptr);
|
||||
comps[i].write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
w.leaveSubVector();
|
||||
if (auto v = w.enterSubVector(nullptr))
|
||||
for (int i=0 ; i<3 ; ++i)
|
||||
if (auto rec = w.enterSubRecord(nullptr))
|
||||
comps[i].write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -1050,25 +1032,17 @@ struct EESimpleEmitterTR : EESimpleEmitter
|
|||
{
|
||||
position.m_elem.reset();
|
||||
velocity.m_elem.reset();
|
||||
if (r.enterSubRecord("ILOC"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("ILOC"))
|
||||
position.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("IVEC"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("IVEC"))
|
||||
velocity.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubRecord("ILOC");
|
||||
position.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("IVEC");
|
||||
velocity.write(w);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("ILOC"))
|
||||
position.write(w);
|
||||
if (auto rec = w.enterSubRecord("IVEC"))
|
||||
velocity.write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -1109,17 +1083,13 @@ struct UVEConstant : IUVElement
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
tex.clear();
|
||||
if (r.enterSubRecord("tex"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("tex"))
|
||||
tex.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubRecord("tex");
|
||||
tex.write(w);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("tex"))
|
||||
tex.write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -1160,62 +1130,35 @@ struct UVEAnimTexture : IUVElement
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
tex.clear();
|
||||
if (r.enterSubRecord("tex"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("tex"))
|
||||
tex.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("tileW"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("tileW"))
|
||||
tileW.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("tileH"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("tileH"))
|
||||
tileH.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("strideW"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("strideW"))
|
||||
strideW.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("strideH"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("strideH"))
|
||||
strideH.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("cycleFrames"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("cycleFrames"))
|
||||
cycleFrames.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("loop"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("loop"))
|
||||
loop = r.readBool(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubRecord("tex");
|
||||
tex.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("tileW");
|
||||
tileW.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("tileH");
|
||||
tileH.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("strideW");
|
||||
strideW.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("strideH");
|
||||
strideH.write(w);
|
||||
w.leaveSubRecord();
|
||||
w.enterSubRecord("cycleFrames");
|
||||
cycleFrames.write(w);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("tex"))
|
||||
tex.write(w);
|
||||
if (auto rec = w.enterSubRecord("tileW"))
|
||||
tileW.write(w);
|
||||
if (auto rec = w.enterSubRecord("tileH"))
|
||||
tileH.write(w);
|
||||
if (auto rec = w.enterSubRecord("strideW"))
|
||||
strideW.write(w);
|
||||
if (auto rec = w.enterSubRecord("strideH"))
|
||||
strideH.write(w);
|
||||
if (auto rec = w.enterSubRecord("cycleFrames"))
|
||||
cycleFrames.write(w);
|
||||
w.writeBool("loop", loop);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
|
@ -1274,17 +1217,15 @@ struct UVElementFactory : BigYAML
|
|||
|
||||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
if (r.enterSubRecord("CNST"))
|
||||
if (auto rec = r.enterSubRecord("CNST"))
|
||||
{
|
||||
m_elem.reset(new struct UVEConstant<IDType>);
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
else if (r.enterSubRecord("ATEX"))
|
||||
else if (auto rec = r.enterSubRecord("ATEX"))
|
||||
{
|
||||
m_elem.reset(new struct UVEAnimTexture<IDType>);
|
||||
m_elem->read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
else
|
||||
m_elem.reset();
|
||||
|
@ -1293,11 +1234,8 @@ struct UVElementFactory : BigYAML
|
|||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (m_elem)
|
||||
{
|
||||
w.enterSubRecord(m_elem->ClassID());
|
||||
m_elem->write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord(m_elem->ClassID()))
|
||||
m_elem->write(w);
|
||||
}
|
||||
|
||||
size_t binarySize(size_t __isz) const
|
||||
|
@ -1358,32 +1296,19 @@ struct SpawnSystemKeyframeData : BigYAML
|
|||
|
||||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
if (r.enterSubRecord("id"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("id"))
|
||||
id.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("a"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("a"))
|
||||
a = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("b"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("b"))
|
||||
b = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("c"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("c"))
|
||||
c = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
w.enterSubRecord("id");
|
||||
id.write(w);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("id"))
|
||||
id.write(w);
|
||||
w.writeUint32("a", a);
|
||||
w.writeUint32("b", b);
|
||||
w.writeUint32("c", c);
|
||||
|
@ -1412,55 +1337,39 @@ struct SpawnSystemKeyframeData : BigYAML
|
|||
|
||||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
if (r.enterSubRecord("a"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("a"))
|
||||
a = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("b"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("b"))
|
||||
b = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("endFrame"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("endFrame"))
|
||||
endFrame = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
if (r.enterSubRecord("d"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("d"))
|
||||
d = r.readUint32(nullptr);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
spawns.clear();
|
||||
size_t spawnCount;
|
||||
if (r.enterSubVector("spawns", spawnCount))
|
||||
if (auto v = r.enterSubVector("spawns", spawnCount))
|
||||
{
|
||||
spawns.reserve(spawnCount);
|
||||
for (const auto& child : r.getCurNode()->m_seqChildren)
|
||||
{
|
||||
if (r.enterSubRecord(nullptr))
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
{
|
||||
spawns.emplace_back();
|
||||
spawns.back().first = r.readUint32("startFrame");
|
||||
size_t systemCount;
|
||||
if (r.enterSubVector("systems", systemCount))
|
||||
if (auto v = r.enterSubVector("systems", systemCount))
|
||||
{
|
||||
spawns.back().second.reserve(systemCount);
|
||||
for (const auto& in : r.getCurNode()->m_seqChildren)
|
||||
{
|
||||
spawns.back().second.emplace_back();
|
||||
SpawnSystemKeyframeInfo& info = spawns.back().second.back();
|
||||
r.enterSubRecord(nullptr);
|
||||
info.read(r);
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord(nullptr))
|
||||
info.read(r);
|
||||
}
|
||||
r.leaveSubVector();
|
||||
}
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
r.leaveSubVector();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
|
@ -1471,22 +1380,20 @@ struct SpawnSystemKeyframeData : BigYAML
|
|||
w.writeUint32("b", b);
|
||||
w.writeUint32("endFrame", endFrame);
|
||||
w.writeUint32("d", d);
|
||||
w.enterSubVector("spawns");
|
||||
for (const auto& spawn : spawns)
|
||||
if (auto v = w.enterSubVector("spawns"))
|
||||
{
|
||||
w.enterSubRecord(nullptr);
|
||||
w.writeUint32("startFrame", spawn.first);
|
||||
w.enterSubVector("systems");
|
||||
for (const auto& info : spawn.second)
|
||||
for (const auto& spawn : spawns)
|
||||
{
|
||||
w.enterSubRecord(nullptr);
|
||||
info.write(w);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord(nullptr))
|
||||
{
|
||||
w.writeUint32("startFrame", spawn.first);
|
||||
if (auto v = w.enterSubVector("systems"))
|
||||
for (const auto& info : spawn.second)
|
||||
if (auto rec = w.enterSubRecord(nullptr))
|
||||
info.write(w);
|
||||
}
|
||||
}
|
||||
w.leaveSubVector();
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
w.leaveSubVector();
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
@ -1566,20 +1473,14 @@ struct ChildResourceFactory : BigYAML
|
|||
void read(athena::io::YAMLDocReader& r)
|
||||
{
|
||||
id.clear();
|
||||
if (r.enterSubRecord("CNST"))
|
||||
{
|
||||
if (auto rec = r.enterSubRecord("CNST"))
|
||||
id.read(r);
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
void write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (id)
|
||||
{
|
||||
w.enterSubRecord("CNST");
|
||||
id.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("CNST"))
|
||||
id.write(w);
|
||||
}
|
||||
size_t binarySize(size_t __isz) const
|
||||
{
|
||||
|
|
|
@ -16,96 +16,96 @@ void SWSH<IDType>::read(athena::io::YAMLDocReader& r)
|
|||
continue;
|
||||
}
|
||||
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
switch(*reinterpret_cast<const uint32_t*>(elem.first.data()))
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
{
|
||||
case SBIG('PSLT'):
|
||||
x0_PSLT.read(r);
|
||||
break;
|
||||
case SBIG('TIME'):
|
||||
x4_TIME.read(r);
|
||||
break;
|
||||
case SBIG('LRAD'):
|
||||
x8_LRAD.read(r);
|
||||
break;
|
||||
case SBIG('RRAD'):
|
||||
xc_RRAD.read(r);
|
||||
break;
|
||||
case SBIG('LENG'):
|
||||
x10_LENG.read(r);
|
||||
break;
|
||||
case SBIG('COLR'):
|
||||
x14_COLR.read(r);
|
||||
break;
|
||||
case SBIG('SIDE'):
|
||||
x18_SIDE.read(r);
|
||||
break;
|
||||
case SBIG('IROT'):
|
||||
x1c_IROT.read(r);
|
||||
break;
|
||||
case SBIG('ROTM'):
|
||||
x20_ROTM.read(r);
|
||||
break;
|
||||
case SBIG('POFS'):
|
||||
x24_POFS.read(r);
|
||||
break;
|
||||
case SBIG('IVEL'):
|
||||
x28_IVEL.read(r);
|
||||
break;
|
||||
case SBIG('NPOS'):
|
||||
x2c_NPOS.read(r);
|
||||
break;
|
||||
case SBIG('VELM'):
|
||||
x30_VELM.read(r);
|
||||
break;
|
||||
case SBIG('VLM2'):
|
||||
x34_VLM2.read(r);
|
||||
break;
|
||||
case SBIG('SPLN'):
|
||||
x38_SPLN.read(r);
|
||||
break;
|
||||
case SBIG('TEXR'):
|
||||
x3c_TEXR.read(r);
|
||||
break;
|
||||
case SBIG('TSPN'):
|
||||
x40_TSPN.read(r);
|
||||
break;
|
||||
case SBIG('LLRD'):
|
||||
x44_24_LLRD = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('CROS'):
|
||||
x44_25_CROS = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('VLS1'):
|
||||
x44_26_VLS1 = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('VLS2'):
|
||||
x44_27_VLS2 = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('SROT'):
|
||||
x44_28_SROT = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('WIRE'):
|
||||
x44_29_WIRE = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('TEXW'):
|
||||
x44_30_TEXW = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('AALP'):
|
||||
x44_31_AALP = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('ZBUF'):
|
||||
x45_24_ZBUF = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('ORNT'):
|
||||
x45_25_ORNT = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('CRND'):
|
||||
x45_26_CRND = r.readBool(nullptr);
|
||||
break;
|
||||
switch(*reinterpret_cast<const uint32_t*>(elem.first.data()))
|
||||
{
|
||||
case SBIG('PSLT'):
|
||||
x0_PSLT.read(r);
|
||||
break;
|
||||
case SBIG('TIME'):
|
||||
x4_TIME.read(r);
|
||||
break;
|
||||
case SBIG('LRAD'):
|
||||
x8_LRAD.read(r);
|
||||
break;
|
||||
case SBIG('RRAD'):
|
||||
xc_RRAD.read(r);
|
||||
break;
|
||||
case SBIG('LENG'):
|
||||
x10_LENG.read(r);
|
||||
break;
|
||||
case SBIG('COLR'):
|
||||
x14_COLR.read(r);
|
||||
break;
|
||||
case SBIG('SIDE'):
|
||||
x18_SIDE.read(r);
|
||||
break;
|
||||
case SBIG('IROT'):
|
||||
x1c_IROT.read(r);
|
||||
break;
|
||||
case SBIG('ROTM'):
|
||||
x20_ROTM.read(r);
|
||||
break;
|
||||
case SBIG('POFS'):
|
||||
x24_POFS.read(r);
|
||||
break;
|
||||
case SBIG('IVEL'):
|
||||
x28_IVEL.read(r);
|
||||
break;
|
||||
case SBIG('NPOS'):
|
||||
x2c_NPOS.read(r);
|
||||
break;
|
||||
case SBIG('VELM'):
|
||||
x30_VELM.read(r);
|
||||
break;
|
||||
case SBIG('VLM2'):
|
||||
x34_VLM2.read(r);
|
||||
break;
|
||||
case SBIG('SPLN'):
|
||||
x38_SPLN.read(r);
|
||||
break;
|
||||
case SBIG('TEXR'):
|
||||
x3c_TEXR.read(r);
|
||||
break;
|
||||
case SBIG('TSPN'):
|
||||
x40_TSPN.read(r);
|
||||
break;
|
||||
case SBIG('LLRD'):
|
||||
x44_24_LLRD = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('CROS'):
|
||||
x44_25_CROS = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('VLS1'):
|
||||
x44_26_VLS1 = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('VLS2'):
|
||||
x44_27_VLS2 = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('SROT'):
|
||||
x44_28_SROT = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('WIRE'):
|
||||
x44_29_WIRE = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('TEXW'):
|
||||
x44_30_TEXW = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('AALP'):
|
||||
x44_31_AALP = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('ZBUF'):
|
||||
x45_24_ZBUF = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('ORNT'):
|
||||
x45_25_ORNT = r.readBool(nullptr);
|
||||
break;
|
||||
case SBIG('CRND'):
|
||||
x45_26_CRND = r.readBool(nullptr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -113,107 +113,56 @@ template <class IDType>
|
|||
void SWSH<IDType>::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (x0_PSLT)
|
||||
{
|
||||
w.enterSubRecord("PSLT");
|
||||
x0_PSLT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PSLT"))
|
||||
x0_PSLT.write(w);
|
||||
if (x4_TIME)
|
||||
{
|
||||
w.enterSubRecord("TIME");
|
||||
x4_TIME.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("TIME"))
|
||||
x4_TIME.write(w);
|
||||
if (x8_LRAD)
|
||||
{
|
||||
w.enterSubRecord("LRAD");
|
||||
x8_LRAD.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LRAD"))
|
||||
x8_LRAD.write(w);
|
||||
if (xc_RRAD)
|
||||
{
|
||||
w.enterSubRecord("RRAD");
|
||||
xc_RRAD.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("RRAD"))
|
||||
xc_RRAD.write(w);
|
||||
if (x10_LENG)
|
||||
{
|
||||
w.enterSubRecord("LENG");
|
||||
x10_LENG.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LENG"))
|
||||
x10_LENG.write(w);
|
||||
if (x14_COLR)
|
||||
{
|
||||
w.enterSubRecord("COLR");
|
||||
x14_COLR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("COLR"))
|
||||
x14_COLR.write(w);
|
||||
if (x18_SIDE)
|
||||
{
|
||||
w.enterSubRecord("SIDE");
|
||||
x18_SIDE.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SIDE"))
|
||||
x18_SIDE.write(w);
|
||||
if (x1c_IROT)
|
||||
{
|
||||
w.enterSubRecord("IROT");
|
||||
x1c_IROT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("IROT"))
|
||||
x1c_IROT.write(w);
|
||||
if (x20_ROTM)
|
||||
{
|
||||
w.enterSubRecord("ROTM");
|
||||
x20_ROTM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("ROTM"))
|
||||
x20_ROTM.write(w);
|
||||
if (x24_POFS)
|
||||
{
|
||||
w.enterSubRecord("POFS");
|
||||
x24_POFS.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("POFS"))
|
||||
x24_POFS.write(w);
|
||||
if (x28_IVEL)
|
||||
{
|
||||
w.enterSubRecord("IVEL");
|
||||
x28_IVEL.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("IVEL"))
|
||||
x28_IVEL.write(w);
|
||||
if (x2c_NPOS)
|
||||
{
|
||||
w.enterSubRecord("NPOS");
|
||||
x2c_NPOS.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("NPOS"))
|
||||
x2c_NPOS.write(w);
|
||||
if (x30_VELM)
|
||||
{
|
||||
w.enterSubRecord("VELM");
|
||||
x30_VELM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("VELM"))
|
||||
x30_VELM.write(w);
|
||||
if (x34_VLM2)
|
||||
{
|
||||
w.enterSubRecord("VLM2");
|
||||
x34_VLM2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("VLM2"))
|
||||
x34_VLM2.write(w);
|
||||
if (x38_SPLN)
|
||||
{
|
||||
w.enterSubRecord("SPLN");
|
||||
x38_SPLN.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SPLN"))
|
||||
x38_SPLN.write(w);
|
||||
if (x3c_TEXR)
|
||||
{
|
||||
w.enterSubRecord("TEXR");
|
||||
x3c_TEXR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("TEXR"))
|
||||
x3c_TEXR.write(w);
|
||||
if (x40_TSPN)
|
||||
{
|
||||
w.enterSubRecord("TSPN");
|
||||
x40_TSPN.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("TSPN"))
|
||||
x40_TSPN.write(w);
|
||||
|
||||
if (x44_24_LLRD)
|
||||
w.writeBool("LLRD", true);
|
||||
|
|
|
@ -16,115 +16,114 @@ void WPSM<IDType>::read(athena::io::YAMLDocReader& r)
|
|||
continue;
|
||||
}
|
||||
|
||||
r.enterSubRecord(elem.first.c_str());
|
||||
|
||||
switch (*reinterpret_cast<const uint32_t*>(elem.first.data()))
|
||||
if (auto rec = r.enterSubRecord(elem.first.c_str()))
|
||||
{
|
||||
case SBIG('IORN'):
|
||||
x0_IORN.read(r);
|
||||
break;
|
||||
case SBIG('IVEC'):
|
||||
x4_IVEC.read(r);
|
||||
break;
|
||||
case SBIG('PSOV'):
|
||||
x8_PSOV.read(r);
|
||||
break;
|
||||
case SBIG('PSVM'):
|
||||
xc_PSVM.read(r);
|
||||
break;
|
||||
case SBIG('VMD2'):
|
||||
x10_VMD2.read(r);
|
||||
break;
|
||||
case SBIG('PSLT'):
|
||||
x14_PSLT.read(r);
|
||||
break;
|
||||
case SBIG('PSCL'):
|
||||
x18_PSCL.read(r);
|
||||
break;
|
||||
case SBIG('PCOL'):
|
||||
x1c_PCOL.read(r);
|
||||
break;
|
||||
case SBIG('POFS'):
|
||||
x20_POFS.read(r);
|
||||
break;
|
||||
case SBIG('OFST'):
|
||||
x24_OFST.read(r);
|
||||
break;
|
||||
case SBIG('APSO'):
|
||||
x28_APSO.read(r);
|
||||
break;
|
||||
case SBIG('HOMG'):
|
||||
x29_HOMG.read(r);
|
||||
break;
|
||||
case SBIG('AP11'):
|
||||
x2a_AP11.read(r);
|
||||
break;
|
||||
case SBIG('AP21'):
|
||||
x2b_AP21.read(r);
|
||||
break;
|
||||
case SBIG('AS11'):
|
||||
x2c_AS11.read(r);
|
||||
break;
|
||||
case SBIG('AS12'):
|
||||
x2d_AS12.read(r);
|
||||
break;
|
||||
case SBIG('AS13'):
|
||||
x2e_AS13.read(r);
|
||||
break;
|
||||
case SBIG('TRAT'):
|
||||
x30_TRAT.read(r);
|
||||
break;
|
||||
case SBIG('APSM'):
|
||||
x34_APSM.read(r);
|
||||
break;
|
||||
case SBIG('APS2'):
|
||||
x44_APS2.read(r);
|
||||
break;
|
||||
case SBIG('ASW1'):
|
||||
x54_ASW1.read(r);
|
||||
break;
|
||||
case SBIG('ASW2'):
|
||||
x64_ASW2.read(r);
|
||||
break;
|
||||
case SBIG('ASW3'):
|
||||
x74_ASW3.read(r);
|
||||
break;
|
||||
case SBIG('OHEF'):
|
||||
x84_OHEF.read(r);
|
||||
break;
|
||||
case SBIG('COLR'):
|
||||
x94_COLR.read(r);
|
||||
break;
|
||||
case SBIG('EWTR'):
|
||||
xa4_EWTR.read(r);
|
||||
break;
|
||||
case SBIG('LWTR'):
|
||||
xa5_LWTR.read(r);
|
||||
break;
|
||||
case SBIG('SWTR'):
|
||||
xa6_SWTR.read(r);
|
||||
break;
|
||||
case SBIG('PJFX'):
|
||||
xa8_PJFX = r.readUint32(nullptr);
|
||||
break;
|
||||
case SBIG('RNGE'):
|
||||
xac_RNGE.read(r);
|
||||
break;
|
||||
case SBIG('FOFF'):
|
||||
xb0_FOFF.read(r);
|
||||
break;
|
||||
case SBIG('FC60'):
|
||||
xunk_FC60.read(r);
|
||||
break;
|
||||
case SBIG('SPS1'):
|
||||
xunk_SPS2.read(r);
|
||||
break;
|
||||
case SBIG('SPS2'):
|
||||
xunk_SPS2.read(r);
|
||||
break;
|
||||
switch (*reinterpret_cast<const uint32_t*>(elem.first.data()))
|
||||
{
|
||||
case SBIG('IORN'):
|
||||
x0_IORN.read(r);
|
||||
break;
|
||||
case SBIG('IVEC'):
|
||||
x4_IVEC.read(r);
|
||||
break;
|
||||
case SBIG('PSOV'):
|
||||
x8_PSOV.read(r);
|
||||
break;
|
||||
case SBIG('PSVM'):
|
||||
xc_PSVM.read(r);
|
||||
break;
|
||||
case SBIG('VMD2'):
|
||||
x10_VMD2.read(r);
|
||||
break;
|
||||
case SBIG('PSLT'):
|
||||
x14_PSLT.read(r);
|
||||
break;
|
||||
case SBIG('PSCL'):
|
||||
x18_PSCL.read(r);
|
||||
break;
|
||||
case SBIG('PCOL'):
|
||||
x1c_PCOL.read(r);
|
||||
break;
|
||||
case SBIG('POFS'):
|
||||
x20_POFS.read(r);
|
||||
break;
|
||||
case SBIG('OFST'):
|
||||
x24_OFST.read(r);
|
||||
break;
|
||||
case SBIG('APSO'):
|
||||
x28_APSO.read(r);
|
||||
break;
|
||||
case SBIG('HOMG'):
|
||||
x29_HOMG.read(r);
|
||||
break;
|
||||
case SBIG('AP11'):
|
||||
x2a_AP11.read(r);
|
||||
break;
|
||||
case SBIG('AP21'):
|
||||
x2b_AP21.read(r);
|
||||
break;
|
||||
case SBIG('AS11'):
|
||||
x2c_AS11.read(r);
|
||||
break;
|
||||
case SBIG('AS12'):
|
||||
x2d_AS12.read(r);
|
||||
break;
|
||||
case SBIG('AS13'):
|
||||
x2e_AS13.read(r);
|
||||
break;
|
||||
case SBIG('TRAT'):
|
||||
x30_TRAT.read(r);
|
||||
break;
|
||||
case SBIG('APSM'):
|
||||
x34_APSM.read(r);
|
||||
break;
|
||||
case SBIG('APS2'):
|
||||
x44_APS2.read(r);
|
||||
break;
|
||||
case SBIG('ASW1'):
|
||||
x54_ASW1.read(r);
|
||||
break;
|
||||
case SBIG('ASW2'):
|
||||
x64_ASW2.read(r);
|
||||
break;
|
||||
case SBIG('ASW3'):
|
||||
x74_ASW3.read(r);
|
||||
break;
|
||||
case SBIG('OHEF'):
|
||||
x84_OHEF.read(r);
|
||||
break;
|
||||
case SBIG('COLR'):
|
||||
x94_COLR.read(r);
|
||||
break;
|
||||
case SBIG('EWTR'):
|
||||
xa4_EWTR.read(r);
|
||||
break;
|
||||
case SBIG('LWTR'):
|
||||
xa5_LWTR.read(r);
|
||||
break;
|
||||
case SBIG('SWTR'):
|
||||
xa6_SWTR.read(r);
|
||||
break;
|
||||
case SBIG('PJFX'):
|
||||
xa8_PJFX = r.readUint32(nullptr);
|
||||
break;
|
||||
case SBIG('RNGE'):
|
||||
xac_RNGE.read(r);
|
||||
break;
|
||||
case SBIG('FOFF'):
|
||||
xb0_FOFF.read(r);
|
||||
break;
|
||||
case SBIG('FC60'):
|
||||
xunk_FC60.read(r);
|
||||
break;
|
||||
case SBIG('SPS1'):
|
||||
xunk_SPS2.read(r);
|
||||
break;
|
||||
case SBIG('SPS2'):
|
||||
xunk_SPS2.read(r);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
r.leaveSubRecord();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -132,205 +131,106 @@ template <class IDType>
|
|||
void WPSM<IDType>::write(athena::io::YAMLDocWriter& w) const
|
||||
{
|
||||
if (x0_IORN)
|
||||
{
|
||||
w.enterSubRecord("IORN");
|
||||
x0_IORN.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("IORN"))
|
||||
x0_IORN.write(w);
|
||||
if (x4_IVEC)
|
||||
{
|
||||
w.enterSubRecord("IVEC");
|
||||
x4_IVEC.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("IVEC"))
|
||||
x4_IVEC.write(w);
|
||||
if (x8_PSOV)
|
||||
{
|
||||
w.enterSubRecord("PSOV");
|
||||
x8_PSOV.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PSOV"))
|
||||
x8_PSOV.write(w);
|
||||
if (xc_PSVM)
|
||||
{
|
||||
w.enterSubRecord("PSVM");
|
||||
xc_PSVM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PSVM"))
|
||||
xc_PSVM.write(w);
|
||||
if (x10_VMD2)
|
||||
{
|
||||
w.enterSubRecord("VMD2");
|
||||
x10_VMD2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("VMD2"))
|
||||
x10_VMD2.write(w);
|
||||
if (x14_PSLT)
|
||||
{
|
||||
w.enterSubRecord("PSLT");
|
||||
x14_PSLT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PSLT"))
|
||||
x14_PSLT.write(w);
|
||||
if (x18_PSCL)
|
||||
{
|
||||
w.enterSubRecord("PSCL");
|
||||
x18_PSCL.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PSCL"))
|
||||
x18_PSCL.write(w);
|
||||
if (x1c_PCOL)
|
||||
{
|
||||
w.enterSubRecord("PCOL");
|
||||
x1c_PCOL.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("PCOL"))
|
||||
x1c_PCOL.write(w);
|
||||
if (x20_POFS)
|
||||
{
|
||||
w.enterSubRecord("POFS");
|
||||
x20_POFS.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("POFS"))
|
||||
x20_POFS.write(w);
|
||||
if (x24_OFST)
|
||||
{
|
||||
w.enterSubRecord("OFST");
|
||||
x24_OFST.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("OFST"))
|
||||
x24_OFST.write(w);
|
||||
if (x28_APSO)
|
||||
{
|
||||
w.enterSubRecord("APSO");
|
||||
x28_APSO.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("APSO"))
|
||||
x28_APSO.write(w);
|
||||
if (x29_HOMG)
|
||||
{
|
||||
w.enterSubRecord("HOMG");
|
||||
x29_HOMG.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("HOMG"))
|
||||
x29_HOMG.write(w);
|
||||
if (x2a_AP11)
|
||||
{
|
||||
w.enterSubRecord("AP11");
|
||||
x2a_AP11.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AP11"))
|
||||
x2a_AP11.write(w);
|
||||
if (x2b_AP21)
|
||||
{
|
||||
w.enterSubRecord("AP21");
|
||||
x2b_AP21.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AP21"))
|
||||
x2b_AP21.write(w);
|
||||
if (x2c_AS11)
|
||||
{
|
||||
w.enterSubRecord("AS11");
|
||||
x2c_AS11.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AS11"))
|
||||
x2c_AS11.write(w);
|
||||
if (x2d_AS12)
|
||||
{
|
||||
w.enterSubRecord("AS12");
|
||||
x2d_AS12.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AS12"))
|
||||
x2d_AS12.write(w);
|
||||
if (x2e_AS13)
|
||||
{
|
||||
w.enterSubRecord("AS13");
|
||||
x2e_AS13.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("AS13"))
|
||||
x2e_AS13.write(w);
|
||||
if (x30_TRAT)
|
||||
{
|
||||
w.enterSubRecord("TRAT");
|
||||
x30_TRAT.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("TRAT"))
|
||||
x30_TRAT.write(w);
|
||||
if (x34_APSM)
|
||||
{
|
||||
w.enterSubRecord("APSM");
|
||||
x34_APSM.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("APSM"))
|
||||
x34_APSM.write(w);
|
||||
if (x44_APS2)
|
||||
{
|
||||
w.enterSubRecord("APS2");
|
||||
x44_APS2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("APS2"))
|
||||
x44_APS2.write(w);
|
||||
if (x54_ASW1)
|
||||
{
|
||||
w.enterSubRecord("ASW1");
|
||||
x54_ASW1.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("ASW1"))
|
||||
x54_ASW1.write(w);
|
||||
if (x64_ASW2)
|
||||
{
|
||||
w.enterSubRecord("ASW2");
|
||||
x64_ASW2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("ASW2"))
|
||||
x64_ASW2.write(w);
|
||||
if (x74_ASW3)
|
||||
{
|
||||
w.enterSubRecord("ASW3");
|
||||
x74_ASW3.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("ASW3"))
|
||||
x74_ASW3.write(w);
|
||||
if (x84_OHEF)
|
||||
{
|
||||
w.enterSubRecord("OHEF");
|
||||
x84_OHEF.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("OHEF"))
|
||||
x84_OHEF.write(w);
|
||||
if (x94_COLR)
|
||||
{
|
||||
w.enterSubRecord("COLR");
|
||||
x94_COLR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("COLR"))
|
||||
x94_COLR.write(w);
|
||||
if (!xa4_EWTR)
|
||||
{
|
||||
w.enterSubRecord("EWTR");
|
||||
xa4_EWTR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("EWTR"))
|
||||
xa4_EWTR.write(w);
|
||||
if (!xa5_LWTR)
|
||||
{
|
||||
w.enterSubRecord("LWTR");
|
||||
xa5_LWTR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("LWTR"))
|
||||
xa5_LWTR.write(w);
|
||||
if (!xa6_SWTR)
|
||||
{
|
||||
w.enterSubRecord("SWTR");
|
||||
xa6_SWTR.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SWTR"))
|
||||
xa6_SWTR.write(w);
|
||||
if (xa8_PJFX != ~0)
|
||||
w.writeUint32("PJFX", xa8_PJFX);
|
||||
if (xac_RNGE)
|
||||
{
|
||||
w.enterSubRecord("RNGE");
|
||||
xac_RNGE.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("RNGE"))
|
||||
xac_RNGE.write(w);
|
||||
if (xb0_FOFF)
|
||||
{
|
||||
w.enterSubRecord("FOFF");
|
||||
xb0_FOFF.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("FOFF"))
|
||||
xb0_FOFF.write(w);
|
||||
if (xunk_FC60)
|
||||
{
|
||||
w.enterSubRecord("FC60");
|
||||
xunk_FC60.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("FC60"))
|
||||
xunk_FC60.write(w);
|
||||
if (xunk_SPS1)
|
||||
{
|
||||
w.enterSubRecord("SPS1");
|
||||
xunk_SPS1.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SPS1"))
|
||||
xunk_SPS1.write(w);
|
||||
if (xunk_SPS1)
|
||||
{
|
||||
w.enterSubRecord("SPS2");
|
||||
xunk_SPS2.write(w);
|
||||
w.leaveSubRecord();
|
||||
}
|
||||
if (auto rec = w.enterSubRecord("SPS2"))
|
||||
xunk_SPS2.write(w);
|
||||
}
|
||||
|
||||
template <class IDType>
|
||||
|
|
|
@ -86,29 +86,30 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::read(a
|
|||
unk1 = reader.readUint32("unk1");
|
||||
unk2 = reader.readFloat("unk2");
|
||||
size_t parmValCount;
|
||||
reader.enterSubVector("parmVals", parmValCount);
|
||||
switch (DataType(parmType))
|
||||
if (auto v = reader.enterSubVector("parmVals", parmValCount))
|
||||
{
|
||||
case DataType::Int32:
|
||||
parmVals[0].int32 = reader.readInt32(nullptr);
|
||||
parmVals[1].int32 = reader.readInt32(nullptr);
|
||||
break;
|
||||
case DataType::UInt32:
|
||||
case DataType::Enum:
|
||||
parmVals[0].uint32 = reader.readUint32(nullptr);
|
||||
parmVals[1].uint32 = reader.readUint32(nullptr);
|
||||
break;
|
||||
case DataType::Float:
|
||||
parmVals[0].float32 = reader.readFloat(nullptr);
|
||||
parmVals[1].float32 = reader.readFloat(nullptr);
|
||||
break;
|
||||
case DataType::Bool:
|
||||
parmVals[0].bool1 = reader.readBool(nullptr);
|
||||
parmVals[1].bool1 = reader.readBool(nullptr);
|
||||
break;
|
||||
default: break;
|
||||
switch (DataType(parmType))
|
||||
{
|
||||
case DataType::Int32:
|
||||
parmVals[0].int32 = reader.readInt32(nullptr);
|
||||
parmVals[1].int32 = reader.readInt32(nullptr);
|
||||
break;
|
||||
case DataType::UInt32:
|
||||
case DataType::Enum:
|
||||
parmVals[0].uint32 = reader.readUint32(nullptr);
|
||||
parmVals[1].uint32 = reader.readUint32(nullptr);
|
||||
break;
|
||||
case DataType::Float:
|
||||
parmVals[0].float32 = reader.readFloat(nullptr);
|
||||
parmVals[1].float32 = reader.readFloat(nullptr);
|
||||
break;
|
||||
case DataType::Bool:
|
||||
parmVals[0].bool1 = reader.readBool(nullptr);
|
||||
parmVals[1].bool1 = reader.readBool(nullptr);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
reader.leaveSubVector();
|
||||
}
|
||||
|
||||
void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(athena::io::YAMLDocWriter& writer) const
|
||||
|
@ -116,28 +117,29 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::write(
|
|||
writer.writeUint32("parmType", parmType);
|
||||
writer.writeUint32("unk1", unk1);
|
||||
writer.writeFloat("unk2", unk2);
|
||||
writer.enterSubVector("parmVals");
|
||||
switch (DataType(parmType))
|
||||
if (auto v = writer.enterSubVector("parmVals"))
|
||||
{
|
||||
case DataType::Int32:
|
||||
writer.writeInt32(nullptr, parmVals[0].int32);
|
||||
writer.writeInt32(nullptr, parmVals[1].int32);
|
||||
break;
|
||||
case DataType::UInt32:
|
||||
case DataType::Enum:
|
||||
writer.writeUint32(nullptr, parmVals[0].uint32);
|
||||
writer.writeUint32(nullptr, parmVals[0].uint32);
|
||||
break;
|
||||
case DataType::Float:
|
||||
writer.writeFloat(nullptr, parmVals[0].float32);
|
||||
writer.writeFloat(nullptr, parmVals[0].float32);
|
||||
break;
|
||||
case DataType::Bool:
|
||||
writer.writeBool(nullptr, parmVals[0].bool1);
|
||||
writer.writeBool(nullptr, parmVals[0].bool1);
|
||||
break;
|
||||
switch (DataType(parmType))
|
||||
{
|
||||
case DataType::Int32:
|
||||
writer.writeInt32(nullptr, parmVals[0].int32);
|
||||
writer.writeInt32(nullptr, parmVals[1].int32);
|
||||
break;
|
||||
case DataType::UInt32:
|
||||
case DataType::Enum:
|
||||
writer.writeUint32(nullptr, parmVals[0].uint32);
|
||||
writer.writeUint32(nullptr, parmVals[0].uint32);
|
||||
break;
|
||||
case DataType::Float:
|
||||
writer.writeFloat(nullptr, parmVals[0].float32);
|
||||
writer.writeFloat(nullptr, parmVals[0].float32);
|
||||
break;
|
||||
case DataType::Bool:
|
||||
writer.writeBool(nullptr, parmVals[0].bool1);
|
||||
writer.writeBool(nullptr, parmVals[0].bool1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
writer.leaveSubVector();
|
||||
}
|
||||
|
||||
const char* ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::ParmInfo::DNAType()
|
||||
|
@ -260,28 +262,29 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::read(athena::io:
|
|||
ai.id = reader.readUint32("id");
|
||||
ai.parmVals.reserve(parmInfoCount);
|
||||
size_t parmValCount;
|
||||
reader.enterSubVector("parmVals", parmValCount);
|
||||
for (const ParmInfo& pi : parmInfos)
|
||||
if (auto v = reader.enterSubVector("parms", parmValCount))
|
||||
{
|
||||
switch (ParmInfo::DataType(pi.parmType))
|
||||
for (const ParmInfo& pi : parmInfos)
|
||||
{
|
||||
case ParmInfo::DataType::Int32:
|
||||
ai.parmVals.emplace_back(reader.readInt32(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::UInt32:
|
||||
case ParmInfo::DataType::Enum:
|
||||
ai.parmVals.emplace_back(reader.readUint32(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::Float:
|
||||
ai.parmVals.emplace_back(reader.readFloat(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::Bool:
|
||||
ai.parmVals.emplace_back(reader.readBool(nullptr));
|
||||
break;
|
||||
default: break;
|
||||
switch (ParmInfo::DataType(pi.parmType))
|
||||
{
|
||||
case ParmInfo::DataType::Int32:
|
||||
ai.parmVals.emplace_back(reader.readInt32(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::UInt32:
|
||||
case ParmInfo::DataType::Enum:
|
||||
ai.parmVals.emplace_back(reader.readUint32(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::Float:
|
||||
ai.parmVals.emplace_back(reader.readFloat(nullptr));
|
||||
break;
|
||||
case ParmInfo::DataType::Bool:
|
||||
ai.parmVals.emplace_back(reader.readBool(nullptr));
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
reader.leaveSubVector();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -296,31 +299,32 @@ void ANCS::CharacterSet::CharacterInfo::PASDatabase::AnimState::write(athena::io
|
|||
{
|
||||
writer.writeUint32("id", ai.id);
|
||||
auto it = ai.parmVals.begin();
|
||||
writer.enterSubVector("parms");
|
||||
for (const ParmInfo& pi : parmInfos)
|
||||
if (auto v = writer.enterSubVector("parms"))
|
||||
{
|
||||
ParmInfo::Parm pVal;
|
||||
if (it != ai.parmVals.end())
|
||||
pVal = *it++;
|
||||
switch (ParmInfo::DataType(pi.parmType))
|
||||
for (const ParmInfo& pi : parmInfos)
|
||||
{
|
||||
case ParmInfo::DataType::Int32:
|
||||
writer.writeInt32(nullptr, pVal.int32);
|
||||
break;
|
||||
case ParmInfo::DataType::UInt32:
|
||||
case ParmInfo::DataType::Enum:
|
||||
writer.writeUint32(nullptr, pVal.uint32);
|
||||
break;
|
||||
case ParmInfo::DataType::Float:
|
||||
writer.writeFloat(nullptr, pVal.float32);
|
||||
break;
|
||||
case ParmInfo::DataType::Bool:
|
||||
writer.writeBool(nullptr, pVal.bool1);
|
||||
break;
|
||||
default: break;
|
||||
ParmInfo::Parm pVal;
|
||||
if (it != ai.parmVals.end())
|
||||
pVal = *it++;
|
||||
switch (ParmInfo::DataType(pi.parmType))
|
||||
{
|
||||
case ParmInfo::DataType::Int32:
|
||||
writer.writeInt32(nullptr, pVal.int32);
|
||||
break;
|
||||
case ParmInfo::DataType::UInt32:
|
||||
case ParmInfo::DataType::Enum:
|
||||
writer.writeUint32(nullptr, pVal.uint32);
|
||||
break;
|
||||
case ParmInfo::DataType::Float:
|
||||
writer.writeFloat(nullptr, pVal.float32);
|
||||
break;
|
||||
case ParmInfo::DataType::Bool:
|
||||
writer.writeBool(nullptr, pVal.bool1);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
}
|
||||
writer.leaveSubVector();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -499,12 +499,13 @@ struct ANCS : BigYAML
|
|||
{
|
||||
out.clear();
|
||||
for (const AnimationSet::Animation& ai : animationSet.animations)
|
||||
ai.metaAnim.m_anim->gatherPrimitives(out);
|
||||
if (AnimationSet::IMetaAnim* anim = ai.metaAnim.m_anim.get())
|
||||
anim->gatherPrimitives(out);
|
||||
for (const AnimationSet::Transition& ti : animationSet.transitions)
|
||||
if (ti.metaTrans.m_trans)
|
||||
ti.metaTrans.m_trans->gatherPrimitives(out);
|
||||
if (animationSet.defaultTransition.m_trans)
|
||||
animationSet.defaultTransition.m_trans->gatherPrimitives(out);
|
||||
if (AnimationSet::IMetaTrans* trans = ti.metaTrans.m_trans.get())
|
||||
trans->gatherPrimitives(out);
|
||||
if (AnimationSet::IMetaTrans* trans = animationSet.defaultTransition.m_trans.get())
|
||||
trans->gatherPrimitives(out);
|
||||
for (auto& anim : out)
|
||||
{
|
||||
for (const AnimationSet::AnimationResources& res : animationSet.animResources)
|
||||
|
@ -521,10 +522,13 @@ struct ANCS : BigYAML
|
|||
void enumeratePrimitives(const std::function<bool(AnimationSet::MetaAnimPrimitive& prim)>& func)
|
||||
{
|
||||
for (const AnimationSet::Animation& ai : animationSet.animations)
|
||||
ai.metaAnim.m_anim->enumeratePrimitives(func);
|
||||
if (AnimationSet::IMetaAnim* anim = ai.metaAnim.m_anim.get())
|
||||
anim->enumeratePrimitives(func);
|
||||
for (const AnimationSet::Transition& ti : animationSet.transitions)
|
||||
ti.metaTrans.m_trans->enumeratePrimitives(func);
|
||||
animationSet.defaultTransition.m_trans->enumeratePrimitives(func);
|
||||
if (AnimationSet::IMetaTrans* trans = ti.metaTrans.m_trans.get())
|
||||
trans->enumeratePrimitives(func);
|
||||
if (AnimationSet::IMetaTrans* trans = animationSet.defaultTransition.m_trans.get())
|
||||
trans->enumeratePrimitives(func);
|
||||
}
|
||||
|
||||
static bool Extract(const SpecBase& dataSpec,
|
||||
|
|
|
@ -18,9 +18,8 @@ bool CSNG::Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath)
|
|||
athena::io::YAMLDocWriter dw("CSNG");
|
||||
dw.writeUint32("midiSetupId", head.midiSetupId);
|
||||
dw.writeUint32("songGroupId", head.songGroupId);
|
||||
dw.enterSubRecord("agscId");
|
||||
head.agscId.write(dw);
|
||||
dw.leaveSubRecord();
|
||||
if (auto rec = dw.enterSubRecord("agscId"))
|
||||
head.agscId.write(dw);
|
||||
|
||||
athena::io::FileWriter w(yamlPath.getAbsolutePath());
|
||||
if (w.hasError())
|
||||
|
@ -76,9 +75,8 @@ bool CSNG::Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPat
|
|||
Header head;
|
||||
head.midiSetupId = dr.readUint32("midiSetupId");
|
||||
head.songGroupId = dr.readUint32("songGroupId");
|
||||
dr.enterSubRecord("agscId");
|
||||
head.agscId.read(dr);
|
||||
dr.leaveSubRecord();
|
||||
if (auto rec = dr.enterSubRecord("agscId"))
|
||||
head.agscId.read(dr);
|
||||
head.sngLength = sngData.size();
|
||||
head.write(w);
|
||||
}
|
||||
|
|
|
@ -143,30 +143,29 @@ void SCLY::ScriptLayer::read(athena::io::YAMLDocReader& rs)
|
|||
unknown = rs.readUByte("unknown");
|
||||
size_t objCount;
|
||||
objects.clear();
|
||||
if (rs.enterSubVector("objects", objCount))
|
||||
if (auto v = rs.enterSubVector("objects", objCount))
|
||||
{
|
||||
objectCount = objCount;
|
||||
objects.reserve(objCount);
|
||||
for (atUint32 i = 0; i < objectCount; i++)
|
||||
{
|
||||
rs.enterSubRecord(nullptr);
|
||||
atUint8 type = rs.readUByte("type");
|
||||
auto iter = std::find_if(SCRIPT_OBJECT_DB.begin(), SCRIPT_OBJECT_DB.end(), [&type](const ScriptObjectSpec* obj) -> bool
|
||||
{ return obj->type == type; });
|
||||
|
||||
if (iter != SCRIPT_OBJECT_DB.end())
|
||||
if (auto rec = rs.enterSubRecord(nullptr))
|
||||
{
|
||||
std::unique_ptr<IScriptObject> obj((*iter)->a());
|
||||
obj->read(rs);
|
||||
obj->type = type;
|
||||
objects.push_back(std::move(obj));
|
||||
}
|
||||
else
|
||||
Log.report(logvisor::Fatal, _S("Unable to find type 0x%X in object database"), (atUint32)type);
|
||||
atUint8 type = rs.readUByte("type");
|
||||
auto iter = std::find_if(SCRIPT_OBJECT_DB.begin(), SCRIPT_OBJECT_DB.end(), [&type](const ScriptObjectSpec* obj) -> bool
|
||||
{ return obj->type == 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::Fatal, _S("Unable to find type 0x%X in object database"), (atUint32)type);
|
||||
}
|
||||
}
|
||||
rs.leaveSubVector();
|
||||
}
|
||||
else
|
||||
objectCount = 0;
|
||||
|
@ -203,15 +202,17 @@ size_t SCLY::ScriptLayer::binarySize(size_t __isz) const
|
|||
void SCLY::ScriptLayer::write(athena::io::YAMLDocWriter& ws) const
|
||||
{
|
||||
ws.writeUByte("unknown", unknown);
|
||||
ws.enterSubVector("objects");
|
||||
for (const std::unique_ptr<IScriptObject>& obj : objects)
|
||||
if (auto v = ws.enterSubVector("objects"))
|
||||
{
|
||||
ws.enterSubRecord(nullptr);
|
||||
ws.writeUByte("type", obj->type);
|
||||
obj->write(ws);
|
||||
ws.leaveSubRecord();
|
||||
};
|
||||
ws.leaveSubVector();
|
||||
for (const std::unique_ptr<IScriptObject>& obj : objects)
|
||||
{
|
||||
if (auto rec = ws.enterSubRecord(nullptr))
|
||||
{
|
||||
ws.writeUByte("type", obj->type);
|
||||
obj->write(ws);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const char* SCLY::ScriptLayer::DNAType()
|
||||
|
|
|
@ -562,10 +562,9 @@ void STRG::write(athena::io::YAMLDocWriter& writer) const
|
|||
{
|
||||
for (const auto& lang : langs)
|
||||
{
|
||||
writer.enterSubVector(lang.first.toString().c_str());
|
||||
for (const std::u16string& str : lang.second)
|
||||
writer.writeU16String(nullptr, str);
|
||||
writer.leaveSubVector();
|
||||
if (auto v = writer.enterSubVector(lang.first.toString().c_str()))
|
||||
for (const std::u16string& str : lang.second)
|
||||
writer.writeU16String(nullptr, str);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -449,7 +449,8 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
{
|
||||
/* x4_ */
|
||||
size_t __x4_Count;
|
||||
__dna_docin.enterSubVector("x4_", __x4_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x4_", __x4_Count))
|
||||
{
|
||||
/* x4_[0] */
|
||||
x4_[0] = __dna_docin.readFloat("x4_");
|
||||
/* x4_[1] */
|
||||
|
@ -466,11 +467,11 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x4_[6] = __dna_docin.readFloat("x4_");
|
||||
/* x4_[7] */
|
||||
x4_[7] = __dna_docin.readFloat("x4_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x24_ */
|
||||
size_t __x24_Count;
|
||||
__dna_docin.enterSubVector("x24_", __x24_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x24_", __x24_Count))
|
||||
{
|
||||
/* x24_[0] */
|
||||
x24_[0] = __dna_docin.readFloat("x24_");
|
||||
/* x24_[1] */
|
||||
|
@ -487,11 +488,11 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x24_[6] = __dna_docin.readFloat("x24_");
|
||||
/* x24_[7] */
|
||||
x24_[7] = __dna_docin.readFloat("x24_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x44_ */
|
||||
size_t __x44_Count;
|
||||
__dna_docin.enterSubVector("x44_", __x44_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x44_", __x44_Count))
|
||||
{
|
||||
/* x44_[0] */
|
||||
x44_[0] = __dna_docin.readFloat("x44_");
|
||||
/* x44_[1] */
|
||||
|
@ -508,8 +509,7 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x44_[6] = __dna_docin.readFloat("x44_");
|
||||
/* x44_[7] */
|
||||
x44_[7] = __dna_docin.readFloat("x44_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x64_ */
|
||||
x64_ = __dna_docin.readFloat("x64_");
|
||||
/* x68_ */
|
||||
|
@ -520,7 +520,8 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x70_ = __dna_docin.readFloat("x70_");
|
||||
/* xc4_ */
|
||||
size_t __xc4_Count;
|
||||
__dna_docin.enterSubVector("xc4_", __xc4_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("xc4_", __xc4_Count))
|
||||
{
|
||||
/* xc4_[0] */
|
||||
xc4_[0] = __dna_docin.readFloat("xc4_");
|
||||
/* xc4_[1] */
|
||||
|
@ -537,8 +538,7 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
xc4_[6] = __dna_docin.readFloat("xc4_");
|
||||
/* xc4_[7] */
|
||||
xc4_[7] = __dna_docin.readFloat("xc4_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* xe4_ */
|
||||
xe4_ = __dna_docin.readFloat("xe4_");
|
||||
/* xe8_ */
|
||||
|
@ -688,7 +688,8 @@ void CTweakBall::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
||||
{
|
||||
/* x4_ */
|
||||
__dna_docout.enterSubVector("x4_");
|
||||
if (auto v = __dna_docout.enterSubVector("x4_"))
|
||||
{
|
||||
/* x4_[0] */
|
||||
__dna_docout.writeFloat("x4_", x4_[0]);
|
||||
/* x4_[1] */
|
||||
|
@ -705,10 +706,10 @@ void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
__dna_docout.writeFloat("x4_", x4_[6]);
|
||||
/* x4_[7] */
|
||||
__dna_docout.writeFloat("x4_", x4_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x24_ */
|
||||
__dna_docout.enterSubVector("x24_");
|
||||
if (auto v = __dna_docout.enterSubVector("x24_"))
|
||||
{
|
||||
/* x24_[0] */
|
||||
__dna_docout.writeFloat("x24_", x24_[0]);
|
||||
/* x24_[1] */
|
||||
|
@ -725,10 +726,10 @@ void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
__dna_docout.writeFloat("x24_", x24_[6]);
|
||||
/* x24_[7] */
|
||||
__dna_docout.writeFloat("x24_", x24_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x44_ */
|
||||
__dna_docout.enterSubVector("x44_");
|
||||
if (auto v = __dna_docout.enterSubVector("x44_"))
|
||||
{
|
||||
/* x44_[0] */
|
||||
__dna_docout.writeFloat("x44_", x44_[0]);
|
||||
/* x44_[1] */
|
||||
|
@ -745,8 +746,7 @@ void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
__dna_docout.writeFloat("x44_", x44_[6]);
|
||||
/* x44_[7] */
|
||||
__dna_docout.writeFloat("x44_", x44_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x64_ */
|
||||
__dna_docout.writeFloat("x64_", x64_);
|
||||
/* x68_ */
|
||||
|
@ -756,7 +756,8 @@ void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
/* x70_ */
|
||||
__dna_docout.writeFloat("x70_", x70_);
|
||||
/* xc4_ */
|
||||
__dna_docout.enterSubVector("xc4_");
|
||||
if (auto v = __dna_docout.enterSubVector("xc4_"))
|
||||
{
|
||||
/* xc4_[0] */
|
||||
__dna_docout.writeFloat("xc4_", xc4_[0]);
|
||||
/* xc4_[1] */
|
||||
|
@ -773,8 +774,7 @@ void CTweakBall::write(athena::io::YAMLDocWriter& __dna_docout) const
|
|||
__dna_docout.writeFloat("xc4_", xc4_[6]);
|
||||
/* xc4_[7] */
|
||||
__dna_docout.writeFloat("xc4_", xc4_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* xe4_ */
|
||||
__dna_docout.writeFloat("xe4_", xe4_);
|
||||
/* xe8_ */
|
||||
|
|
|
@ -889,7 +889,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
{
|
||||
/* x4_ */
|
||||
size_t __x4_Count;
|
||||
__dna_docin.enterSubVector("x4_", __x4_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x4_", __x4_Count))
|
||||
{
|
||||
/* x4_[0] */
|
||||
x4_[0] = __dna_docin.readFloat("x4_");
|
||||
/* x4_[1] */
|
||||
|
@ -906,11 +907,11 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x4_[6] = __dna_docin.readFloat("x4_");
|
||||
/* x4_[7] */
|
||||
x4_[7] = __dna_docin.readFloat("x4_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x24_ */
|
||||
size_t __x24_Count;
|
||||
__dna_docin.enterSubVector("x24_", __x24_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x24_", __x24_Count))
|
||||
{
|
||||
/* x24_[0] */
|
||||
x24_[0] = __dna_docin.readFloat("x24_");
|
||||
/* x24_[1] */
|
||||
|
@ -927,11 +928,11 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x24_[6] = __dna_docin.readFloat("x24_");
|
||||
/* x24_[7] */
|
||||
x24_[7] = __dna_docin.readFloat("x24_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x44_ */
|
||||
size_t __x44_Count;
|
||||
__dna_docin.enterSubVector("x44_", __x44_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x44_", __x44_Count))
|
||||
{
|
||||
/* x44_[0] */
|
||||
x44_[0] = __dna_docin.readFloat("x44_");
|
||||
/* x44_[1] */
|
||||
|
@ -948,11 +949,11 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x44_[6] = __dna_docin.readFloat("x44_");
|
||||
/* x44_[7] */
|
||||
x44_[7] = __dna_docin.readFloat("x44_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x64_ */
|
||||
size_t __x64_Count;
|
||||
__dna_docin.enterSubVector("x64_", __x64_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x64_", __x64_Count))
|
||||
{
|
||||
/* x64_[0] */
|
||||
x64_[0] = __dna_docin.readFloat("x64_");
|
||||
/* x64_[1] */
|
||||
|
@ -969,11 +970,11 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x64_[6] = __dna_docin.readFloat("x64_");
|
||||
/* x64_[7] */
|
||||
x64_[7] = __dna_docin.readFloat("x64_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x84_ */
|
||||
size_t __x84_Count;
|
||||
__dna_docin.enterSubVector("x84_", __x84_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x84_", __x84_Count))
|
||||
{
|
||||
/* x84_[0] */
|
||||
x84_[0] = __dna_docin.readFloat("x84_");
|
||||
/* x84_[1] */
|
||||
|
@ -990,11 +991,11 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x84_[6] = __dna_docin.readFloat("x84_");
|
||||
/* x84_[7] */
|
||||
x84_[7] = __dna_docin.readFloat("x84_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* xa4_ */
|
||||
size_t __xa4_Count;
|
||||
__dna_docin.enterSubVector("xa4_", __xa4_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("xa4_", __xa4_Count))
|
||||
{
|
||||
/* xa4_[0] */
|
||||
xa4_[0] = __dna_docin.readFloat("xa4_");
|
||||
/* xa4_[1] */
|
||||
|
@ -1011,8 +1012,7 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
xa4_[6] = __dna_docin.readFloat("xa4_");
|
||||
/* xa4_[7] */
|
||||
xa4_[7] = __dna_docin.readFloat("xa4_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* xc4_ */
|
||||
xc4_ = __dna_docin.readFloat("xc4_");
|
||||
/* xc8_ */
|
||||
|
@ -1163,37 +1163,37 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x268_ = __dna_docin.readFloat("x268_");
|
||||
/* x158_ */
|
||||
size_t __x158_Count;
|
||||
__dna_docin.enterSubVector("x158_", __x158_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x158_", __x158_Count))
|
||||
{
|
||||
/* x158_[0] */
|
||||
x158_[0] = __dna_docin.readFloat("x158_");
|
||||
/* x158_[1] */
|
||||
x158_[1] = __dna_docin.readFloat("x158_");
|
||||
/* x158_[2] */
|
||||
x158_[2] = __dna_docin.readFloat("x158_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x164_ */
|
||||
size_t __x164_Count;
|
||||
__dna_docin.enterSubVector("x164_", __x164_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x164_", __x164_Count))
|
||||
{
|
||||
/* x164_[0] */
|
||||
x164_[0] = __dna_docin.readFloat("x164_");
|
||||
/* x164_[1] */
|
||||
x164_[1] = __dna_docin.readFloat("x164_");
|
||||
/* x164_[2] */
|
||||
x164_[2] = __dna_docin.readFloat("x164_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x170_ */
|
||||
size_t __x170_Count;
|
||||
__dna_docin.enterSubVector("x170_", __x170_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x170_", __x170_Count))
|
||||
{
|
||||
/* x170_[0] */
|
||||
x170_[0] = __dna_docin.readFloat("x170_");
|
||||
/* x170_[1] */
|
||||
x170_[1] = __dna_docin.readFloat("x170_");
|
||||
/* x170_[2] */
|
||||
x170_[2] = __dna_docin.readFloat("x170_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x17c_ */
|
||||
x17c_ = __dna_docin.readFloat("x17c_");
|
||||
/* x180_ */
|
||||
|
@ -1218,58 +1218,58 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
x1a4_ = __dna_docin.readFloat("x1a4_");
|
||||
/* x1a8_ */
|
||||
size_t __x1a8_Count;
|
||||
__dna_docin.enterSubVector("x1a8_", __x1a8_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1a8_", __x1a8_Count))
|
||||
{
|
||||
/* x1a8_[0] */
|
||||
x1a8_[0] = __dna_docin.readUint32("x1a8_");
|
||||
/* x1a8_[1] */
|
||||
x1a8_[1] = __dna_docin.readUint32("x1a8_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1b0_ */
|
||||
size_t __x1b0_Count;
|
||||
__dna_docin.enterSubVector("x1b0_", __x1b0_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1b0_", __x1b0_Count))
|
||||
{
|
||||
/* x1b0_[0] */
|
||||
x1b0_[0] = __dna_docin.readUint32("x1b0_");
|
||||
/* x1b0_[1] */
|
||||
x1b0_[1] = __dna_docin.readUint32("x1b0_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1b8_ */
|
||||
size_t __x1b8_Count;
|
||||
__dna_docin.enterSubVector("x1b8_", __x1b8_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1b8_", __x1b8_Count))
|
||||
{
|
||||
/* x1b8_[0] */
|
||||
x1b8_[0] = __dna_docin.readUint32("x1b8_");
|
||||
/* x1b8_[1] */
|
||||
x1b8_[1] = __dna_docin.readUint32("x1b8_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1c0_ */
|
||||
size_t __x1c0_Count;
|
||||
__dna_docin.enterSubVector("x1c0_", __x1c0_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1c0_", __x1c0_Count))
|
||||
{
|
||||
/* x1c0_[0] */
|
||||
x1c0_[0] = __dna_docin.readUint32("x1c0_");
|
||||
/* x1c0_[1] */
|
||||
x1c0_[1] = __dna_docin.readUint32("x1c0_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1c8_ */
|
||||
size_t __x1c8_Count;
|
||||
__dna_docin.enterSubVector("x1c8_", __x1c8_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1c8_", __x1c8_Count))
|
||||
{
|
||||
/* x1c8_[0] */
|
||||
x1c8_[0] = __dna_docin.readUint32("x1c8_");
|
||||
/* x1c8_[1] */
|
||||
x1c8_[1] = __dna_docin.readUint32("x1c8_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1d0_ */
|
||||
size_t __x1d0_Count;
|
||||
__dna_docin.enterSubVector("x1d0_", __x1d0_Count);
|
||||
if (auto v = __dna_docin.enterSubVector("x1d0_", __x1d0_Count))
|
||||
{
|
||||
/* x1d0_[0] */
|
||||
x1d0_[0] = __dna_docin.readUint32("x1d0_");
|
||||
/* x1d0_[1] */
|
||||
x1d0_[1] = __dna_docin.readUint32("x1d0_");
|
||||
/* */
|
||||
__dna_docin.leaveSubVector();
|
||||
}
|
||||
/* x1d8_ */
|
||||
x1d8_ = __dna_docin.readFloat("x1d8_");
|
||||
/* x1dc_ */
|
||||
|
@ -1403,7 +1403,8 @@ void CTweakPlayer::read(athena::io::YAMLDocReader& __dna_docin)
|
|||
void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout) const
|
||||
{
|
||||
/* x4_ */
|
||||
__dna_docout.enterSubVector("x4_");
|
||||
if (auto v = __dna_docout.enterSubVector("x4_"))
|
||||
{
|
||||
/* x4_[0] */
|
||||
__dna_docout.writeFloat("x4_", x4_[0]);
|
||||
/* x4_[1] */
|
||||
|
@ -1420,10 +1421,10 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("x4_", x4_[6]);
|
||||
/* x4_[7] */
|
||||
__dna_docout.writeFloat("x4_", x4_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x24_ */
|
||||
__dna_docout.enterSubVector("x24_");
|
||||
if (auto v = __dna_docout.enterSubVector("x24_"))
|
||||
{
|
||||
/* x24_[0] */
|
||||
__dna_docout.writeFloat("x24_", x24_[0]);
|
||||
/* x24_[1] */
|
||||
|
@ -1440,10 +1441,10 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("x24_", x24_[6]);
|
||||
/* x24_[7] */
|
||||
__dna_docout.writeFloat("x24_", x24_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x44_ */
|
||||
__dna_docout.enterSubVector("x44_");
|
||||
if (auto v = __dna_docout.enterSubVector("x44_"))
|
||||
{
|
||||
/* x44_[0] */
|
||||
__dna_docout.writeFloat("x44_", x44_[0]);
|
||||
/* x44_[1] */
|
||||
|
@ -1460,10 +1461,10 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("x44_", x44_[6]);
|
||||
/* x44_[7] */
|
||||
__dna_docout.writeFloat("x44_", x44_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x64_ */
|
||||
__dna_docout.enterSubVector("x64_");
|
||||
if (auto v = __dna_docout.enterSubVector("x64_"))
|
||||
{
|
||||
/* x64_[0] */
|
||||
__dna_docout.writeFloat("x64_", x64_[0]);
|
||||
/* x64_[1] */
|
||||
|
@ -1480,10 +1481,10 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("x64_", x64_[6]);
|
||||
/* x64_[7] */
|
||||
__dna_docout.writeFloat("x64_", x64_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x84_ */
|
||||
__dna_docout.enterSubVector("x84_");
|
||||
if (auto v = __dna_docout.enterSubVector("x84_"))
|
||||
{
|
||||
/* x84_[0] */
|
||||
__dna_docout.writeFloat("x84_", x84_[0]);
|
||||
/* x84_[1] */
|
||||
|
@ -1500,10 +1501,10 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("x84_", x84_[6]);
|
||||
/* x84_[7] */
|
||||
__dna_docout.writeFloat("x84_", x84_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* xa4_ */
|
||||
__dna_docout.enterSubVector("xa4_");
|
||||
if (auto v = __dna_docout.enterSubVector("xa4_"))
|
||||
{
|
||||
/* xa4_[0] */
|
||||
__dna_docout.writeFloat("xa4_", xa4_[0]);
|
||||
/* xa4_[1] */
|
||||
|
@ -1520,8 +1521,7 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
__dna_docout.writeFloat("xa4_", xa4_[6]);
|
||||
/* xa4_[7] */
|
||||
__dna_docout.writeFloat("xa4_", xa4_[7]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* xc4_ */
|
||||
__dna_docout.writeFloat("xc4_", xc4_);
|
||||
/* xc8_ */
|
||||
|
@ -1671,35 +1671,35 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
/* x268_ */
|
||||
__dna_docout.writeFloat("x268_", x268_);
|
||||
/* x158_ */
|
||||
__dna_docout.enterSubVector("x158_");
|
||||
if (auto v = __dna_docout.enterSubVector("x158_"))
|
||||
{
|
||||
/* x158_[0] */
|
||||
__dna_docout.writeFloat("x158_", x158_[0]);
|
||||
/* x158_[1] */
|
||||
__dna_docout.writeFloat("x158_", x158_[1]);
|
||||
/* x158_[2] */
|
||||
__dna_docout.writeFloat("x158_", x158_[2]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x164_ */
|
||||
__dna_docout.enterSubVector("x164_");
|
||||
if (auto v = __dna_docout.enterSubVector("x164_"))
|
||||
{
|
||||
/* x164_[0] */
|
||||
__dna_docout.writeFloat("x164_", x164_[0]);
|
||||
/* x164_[1] */
|
||||
__dna_docout.writeFloat("x164_", x164_[1]);
|
||||
/* x164_[2] */
|
||||
__dna_docout.writeFloat("x164_", x164_[2]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x170_ */
|
||||
__dna_docout.enterSubVector("x170_");
|
||||
if (auto v = __dna_docout.enterSubVector("x170_"))
|
||||
{
|
||||
/* x170_[0] */
|
||||
__dna_docout.writeFloat("x170_", x170_[0]);
|
||||
/* x170_[1] */
|
||||
__dna_docout.writeFloat("x170_", x170_[1]);
|
||||
/* x170_[2] */
|
||||
__dna_docout.writeFloat("x170_", x170_[2]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x17c_ */
|
||||
__dna_docout.writeFloat("x17c_", x17c_);
|
||||
/* x180_ */
|
||||
|
@ -1723,53 +1723,53 @@ void CTweakPlayer::CTweakPlayer::write(athena::io::YAMLDocWriter& __dna_docout)
|
|||
/* x1a4_ */
|
||||
__dna_docout.writeFloat("x1a4_", x1a4_);
|
||||
/* x1a8_ */
|
||||
__dna_docout.enterSubVector("x1a8_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1a8_"))
|
||||
{
|
||||
/* x1a8_[0] */
|
||||
__dna_docout.writeUint32("x1a8_", x1a8_[0]);
|
||||
/* x1a8_[1] */
|
||||
__dna_docout.writeUint32("x1a8_", x1a8_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1b0_ */
|
||||
__dna_docout.enterSubVector("x1b0_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1b0_"))
|
||||
{
|
||||
/* x1b0_[0] */
|
||||
__dna_docout.writeUint32("x1b0_", x1b0_[0]);
|
||||
/* x1b0_[1] */
|
||||
__dna_docout.writeUint32("x1b0_", x1b0_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1b8_ */
|
||||
__dna_docout.enterSubVector("x1b8_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1b8_"))
|
||||
{
|
||||
/* x1b8_[0] */
|
||||
__dna_docout.writeUint32("x1b8_", x1b8_[0]);
|
||||
/* x1b8_[1] */
|
||||
__dna_docout.writeUint32("x1b8_", x1b8_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1c0_ */
|
||||
__dna_docout.enterSubVector("x1c0_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1c0_"))
|
||||
{
|
||||
/* x1c0_[0] */
|
||||
__dna_docout.writeUint32("x1c0_", x1c0_[0]);
|
||||
/* x1c0_[1] */
|
||||
__dna_docout.writeUint32("x1c0_", x1c0_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1c8_ */
|
||||
__dna_docout.enterSubVector("x1c8_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1c8_"))
|
||||
{
|
||||
/* x1c8_[0] */
|
||||
__dna_docout.writeUint32("x1c8_", x1c8_[0]);
|
||||
/* x1c8_[1] */
|
||||
__dna_docout.writeUint32("x1c8_", x1c8_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1d0_ */
|
||||
__dna_docout.enterSubVector("x1d0_");
|
||||
if (auto v = __dna_docout.enterSubVector("x1d0_"))
|
||||
{
|
||||
/* x1d0_[0] */
|
||||
__dna_docout.writeUint32("x1d0_", x1d0_[0]);
|
||||
/* x1d0_[1] */
|
||||
__dna_docout.writeUint32("x1d0_", x1d0_[1]);
|
||||
/* */
|
||||
__dna_docout.leaveSubVector();
|
||||
}
|
||||
/* x1d8_ */
|
||||
__dna_docout.writeFloat("x1d8_", x1d8_);
|
||||
/* x1dc_ */
|
||||
|
|
|
@ -229,21 +229,16 @@ void STRG::write(athena::io::YAMLDocWriter& writer) const
|
|||
{
|
||||
for (const auto& lang : langs)
|
||||
{
|
||||
writer.enterSubVector(lang.first.toString().c_str());
|
||||
for (const std::u16string& str : lang.second)
|
||||
writer.writeU16String(nullptr, str);
|
||||
writer.leaveSubVector();
|
||||
if (auto v = writer.enterSubVector(lang.first.toString().c_str()))
|
||||
for (const std::u16string& str : lang.second)
|
||||
writer.writeU16String(nullptr, str);
|
||||
}
|
||||
if (names.size())
|
||||
{
|
||||
writer.enterSubRecord("names");
|
||||
for (const auto& name : names)
|
||||
{
|
||||
writer.enterSubRecord(name.first.c_str());
|
||||
writer.writeInt32(nullptr, name.second);
|
||||
writer.leaveSubRecord();
|
||||
}
|
||||
writer.leaveSubRecord();
|
||||
if (auto rec = writer.enterSubRecord("names"))
|
||||
for (const auto& name : names)
|
||||
if (auto rec = writer.enterSubRecord(name.first.c_str()))
|
||||
writer.writeInt32(nullptr, name.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -247,22 +247,17 @@ void STRG::write(athena::io::YAMLDocWriter& writer) const
|
|||
{
|
||||
for (const auto& item : langs)
|
||||
{
|
||||
writer.enterSubVector(item.first.toString().c_str());
|
||||
for (const std::string& str : item.second)
|
||||
writer.writeString(nullptr, str);
|
||||
writer.leaveSubVector();
|
||||
if (auto v = writer.enterSubVector(item.first.toString().c_str()))
|
||||
for (const std::string& str : item.second)
|
||||
writer.writeString(nullptr, str);
|
||||
}
|
||||
|
||||
if (names.size())
|
||||
{
|
||||
writer.enterSubRecord("names");
|
||||
for (const auto& item : names)
|
||||
{
|
||||
writer.enterSubRecord(item.first.c_str());
|
||||
writer.writeInt32(nullptr, item.second);
|
||||
writer.leaveSubRecord();
|
||||
}
|
||||
writer.leaveSubRecord();
|
||||
if (auto rec = writer.enterSubRecord("names"))
|
||||
for (const auto& item : names)
|
||||
if (auto rec = writer.enterSubRecord(item.first.c_str()))
|
||||
writer.writeInt32(nullptr, item.second);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -676,6 +676,15 @@ struct SpecMP1 : SpecBase
|
|||
void cookActor(const hecl::ProjectPath& out, const hecl::ProjectPath& in, BlendStream& ds, bool fast,
|
||||
hecl::BlenderToken& btok, FCookProgress progress)
|
||||
{
|
||||
/*
|
||||
if (hecl::StringUtils::EndsWith(in.getAuxInfo(), _S(".CINF")))
|
||||
return {SBIG('CINF'), path.hash().val32()};
|
||||
else if (hecl::StringUtils::EndsWith(in.getAuxInfo(), _S(".CSKR")))
|
||||
return {SBIG('CSKR'), path.hash().val32()};
|
||||
else if (hecl::StringUtils::EndsWith(in.getAuxInfo(), _S(".ANIM")))
|
||||
return {SBIG('ANIM'), path.hash().val32()};
|
||||
*/
|
||||
|
||||
Actor actor = ds.compileActor();
|
||||
DNAMP1::ANCS::Cook(out, in, actor, ds, m_pc, [&](const hecl::ProjectPath& modelPath) -> bool {
|
||||
hecl::ProjectPath cooked;
|
||||
|
|
|
@ -12,12 +12,13 @@ static void WriteTag(athena::io::YAMLDocWriter& cacheWriter,
|
|||
{
|
||||
char idStr[9];
|
||||
snprintf(idStr, 9, "%08X", uint32_t(pathTag.id));
|
||||
cacheWriter.enterSubVector(idStr);
|
||||
cacheWriter.writeString(nullptr, pathTag.type.toString().c_str());
|
||||
cacheWriter.writeString(nullptr, path.getAuxInfo().size() ?
|
||||
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
|
||||
path.getRelativePathUTF8());
|
||||
cacheWriter.leaveSubVector();
|
||||
if (auto v = cacheWriter.enterSubVector(idStr))
|
||||
{
|
||||
cacheWriter.writeString(nullptr, pathTag.type.toString().c_str());
|
||||
cacheWriter.writeString(nullptr, path.getAuxInfo().size() ?
|
||||
(path.getRelativePathUTF8() + '|' + path.getAuxInfoUTF8()) :
|
||||
path.getRelativePathUTF8());
|
||||
}
|
||||
}
|
||||
|
||||
static void WriteNameTag(athena::io::YAMLDocWriter& nameWriter,
|
||||
|
|
|
@ -118,6 +118,19 @@ void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj,
|
|||
m_origIds = sp.GetObj("MP1OriginalIDs");
|
||||
}
|
||||
|
||||
void ProjectResourceFactoryMP1::GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const
|
||||
{
|
||||
std::string pathPrefix("MP1/");
|
||||
pathPrefix += pakName;
|
||||
pathPrefix += '/';
|
||||
|
||||
std::unique_lock<std::mutex> lk(
|
||||
const_cast<ProjectResourceFactoryMP1&>(*this).m_backgroundIndexMutex);
|
||||
for (const auto& tag : m_tagToPath)
|
||||
if (!tag.second.getRelativePathUTF8().compare(0, pathPrefix.size(), pathPrefix))
|
||||
out.push_back(tag.first);
|
||||
}
|
||||
|
||||
void ProjectResourceFactoryMP1::Shutdown()
|
||||
{
|
||||
m_origIds = TLockedToken<MP1OriginalIDs>();
|
||||
|
|
|
@ -15,6 +15,7 @@ class ProjectResourceFactoryMP1 : public ProjectResourceFactoryBase
|
|||
public:
|
||||
ProjectResourceFactoryMP1(hecl::ClientProcess& clientProc);
|
||||
void IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp);
|
||||
void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const;
|
||||
void Shutdown();
|
||||
|
||||
ResId TranslateOriginalToNew(ResId id) const;
|
||||
|
|
|
@ -173,9 +173,8 @@ public:
|
|||
: RootSpace(vm)
|
||||
{
|
||||
m_state.read(r);
|
||||
r.enterSubRecord("spaceTree");
|
||||
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord("spaceTree"))
|
||||
m_spaceTree.reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
}
|
||||
|
||||
void think()
|
||||
|
@ -200,12 +199,13 @@ public:
|
|||
w.writeUint32("class", atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
w.enterSubRecord("spaceTree");
|
||||
if (m_spaceTree)
|
||||
m_spaceTree->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("spaceTree"))
|
||||
{
|
||||
if (m_spaceTree)
|
||||
m_spaceTree->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
}
|
||||
}
|
||||
|
||||
void setChild(std::unique_ptr<Space>&& space)
|
||||
|
@ -248,12 +248,10 @@ public:
|
|||
: SplitSpace(vm, parent, specter::SplitView::Axis::Horizontal)
|
||||
{
|
||||
m_state.read(r);
|
||||
r.enterSubRecord("slot0");
|
||||
m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
r.enterSubRecord("slot1");
|
||||
m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
r.leaveSubRecord();
|
||||
if (auto rec = r.enterSubRecord("slot0"))
|
||||
m_slots[0].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
if (auto rec = r.enterSubRecord("slot1"))
|
||||
m_slots[1].reset(NewSpaceFromConfigStream(vm, this, r));
|
||||
reloadState();
|
||||
}
|
||||
|
||||
|
@ -300,19 +298,21 @@ public:
|
|||
w.writeUint32("class", atUint32(m_class));
|
||||
m_state.write(w);
|
||||
|
||||
w.enterSubRecord("slot0");
|
||||
if (m_slots[0])
|
||||
m_slots[0]->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("slot0"))
|
||||
{
|
||||
if (m_slots[0])
|
||||
m_slots[0]->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
}
|
||||
|
||||
w.enterSubRecord("slot1");
|
||||
if (m_slots[1])
|
||||
m_slots[1]->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
w.leaveSubRecord();
|
||||
if (auto rec = w.enterSubRecord("slot1"))
|
||||
{
|
||||
if (m_slots[1])
|
||||
m_slots[1]->saveState(w);
|
||||
else
|
||||
w.writeUint32("class", 0);
|
||||
}
|
||||
}
|
||||
|
||||
void setChildSlot(unsigned slot, std::unique_ptr<Space>&& space);
|
||||
|
|
|
@ -41,6 +41,8 @@ public:
|
|||
virtual std::unique_ptr<u8[]> LoadResourceSync(const urde::SObjectTag& tag)=0;
|
||||
virtual std::unique_ptr<u8[]> LoadResourcePartSync(const urde::SObjectTag& tag, u32 size, u32 off)=0;
|
||||
|
||||
virtual void GetTagListForFile(const char* pakName, std::vector<SObjectTag>& out) const {}
|
||||
|
||||
virtual ResId TranslateOriginalToNew(ResId id) const { return -1; }
|
||||
virtual ResId TranslateNewToOriginal(ResId id) const { return -1; }
|
||||
};
|
||||
|
|
|
@ -65,9 +65,23 @@ CMFGameLoader::CMFGameLoader() : CMFGameLoaderBase("CMFGameLoader")
|
|||
}
|
||||
}
|
||||
|
||||
static const char* LoadDepPAKs[] =
|
||||
{
|
||||
"TestAnim",
|
||||
"SamusGun",
|
||||
"SamGunFx",
|
||||
nullptr
|
||||
};
|
||||
|
||||
void CMFGameLoader::MakeLoadDependencyList()
|
||||
{
|
||||
std::vector<SObjectTag> tags;
|
||||
for (int i=0 ; LoadDepPAKs[i] ; ++i)
|
||||
g_ResFactory->GetTagListForFile(LoadDepPAKs[i], tags);
|
||||
|
||||
x1c_loadList.reserve(tags.size());
|
||||
for (const SObjectTag& tag : tags)
|
||||
x1c_loadList.push_back(g_SimplePool->GetObj(tag));
|
||||
}
|
||||
|
||||
CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue)
|
||||
|
@ -124,12 +138,26 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
|
|||
wldState.GetDesiredAreaAssetId());
|
||||
return EMessageReturn::Exit;
|
||||
}
|
||||
else
|
||||
|
||||
if (!x18_guiMgr)
|
||||
x18_guiMgr = std::make_shared<CInGameGuiManager>(*x14_stateMgr, queue);
|
||||
if (!x18_guiMgr->CheckLoadComplete(*x14_stateMgr))
|
||||
return EMessageReturn::Exit;
|
||||
|
||||
x1c_loadList.clear();
|
||||
|
||||
wtMgr->StartTextFadeOut();
|
||||
x2c_25_transitionFinished = wtMgr->IsTransitionFinished();
|
||||
return EMessageReturn::Exit;
|
||||
}
|
||||
case EArchMsgType::FrameBegin:
|
||||
{
|
||||
if (x2c_25_transitionFinished)
|
||||
{
|
||||
if (!x18_guiMgr)
|
||||
{
|
||||
x18_guiMgr = std::make_shared<CInGameGuiManager>(*x14_stateMgr, queue);
|
||||
}
|
||||
queue.Push(
|
||||
MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 10, 1000,
|
||||
std::make_shared<CMFGame>(x14_stateMgr, x18_guiMgr, queue)));
|
||||
return EMessageReturn::RemoveIOWinAndExit;
|
||||
}
|
||||
}
|
||||
default:
|
||||
|
|
|
@ -47,7 +47,7 @@ class CMFGameLoader : public CMFGameLoaderBase
|
|||
struct
|
||||
{
|
||||
bool x2c_24_initialized : 1;
|
||||
bool x2c_25_ : 1;
|
||||
bool x2c_25_transitionFinished : 1;
|
||||
};
|
||||
u8 _dummy = 0;
|
||||
};
|
||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
|||
Subproject commit e86501e66a219e5370b82be6379da449cb23381a
|
||||
Subproject commit bcffcf3105090648ba44b3aa69a5d906986be531
|
Loading…
Reference in New Issue