Add missing WPSM types (Trilogy/PAL additions)

This commit is contained in:
Phillip Stephens 2016-06-01 20:13:43 -07:00
parent e02b4def14
commit fccd52e155
3 changed files with 62 additions and 1 deletions

View File

@ -113,6 +113,15 @@ void WPSM<IDType>::read(athena::io::YAMLDocReader& r)
case SBIG('FOFF'): case SBIG('FOFF'):
xb0_FOFF.read(r); xb0_FOFF.read(r);
break; 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(); r.leaveSubRecord();
@ -304,6 +313,24 @@ void WPSM<IDType>::write(athena::io::YAMLDocWriter& w) const
xb0_FOFF.write(w); xb0_FOFF.write(w);
w.leaveSubRecord(); w.leaveSubRecord();
} }
if (xunk_FC60)
{
w.enterSubRecord("FC60");
xunk_FC60.write(w);
w.leaveSubRecord();
}
if (xunk_SPS1)
{
w.enterSubRecord("SPS1");
xunk_SPS1.write(w);
w.leaveSubRecord();
}
if (xunk_SPS1)
{
w.enterSubRecord("SPS2");
xunk_SPS2.write(w);
w.leaveSubRecord();
}
} }
template <class IDType> template <class IDType>
@ -372,7 +399,12 @@ size_t WPSM<IDType>::binarySize(size_t __isz) const
__isz = xac_RNGE.binarySize(__isz + 4); __isz = xac_RNGE.binarySize(__isz + 4);
if (xb0_FOFF) if (xb0_FOFF)
__isz = xb0_FOFF.binarySize(__isz + 4); __isz = xb0_FOFF.binarySize(__isz + 4);
if (xunk_FC60)
__isz = xunk_FC60.binarySize(__isz + 4);
if (xunk_SPS1)
__isz = xunk_SPS1.binarySize(__isz + 4);
if (xunk_SPS2)
__isz = xunk_SPS2.binarySize(__isz + 4);
return __isz; return __isz;
} }
@ -493,6 +525,15 @@ void WPSM<IDType>::read(athena::io::IStreamReader& r)
case SBIG('FOFF'): case SBIG('FOFF'):
xb0_FOFF.read(r); xb0_FOFF.read(r);
break; break;
case SBIG('FC60'):
xunk_FC60.read(r);
break;
case SBIG('SPS1'):
xunk_SPS1.read(r);
break;
case SBIG('SPS2'):
xunk_SPS2.read(r);
break;
default: default:
LogModule.report(logvisor::Fatal, "Unknown WPSM class %.4s @%" PRIi64, &clsId, r.position()); LogModule.report(logvisor::Fatal, "Unknown WPSM class %.4s @%" PRIi64, &clsId, r.position());
break; break;
@ -659,6 +700,21 @@ void WPSM<IDType>::write(athena::io::IStreamWriter &w) const
w.writeBytes("FOFF", 4); w.writeBytes("FOFF", 4);
xb0_FOFF.write(w); xb0_FOFF.write(w);
} }
if (xunk_FC60)
{
w.writeBytes("FC60", 4);
xunk_FC60.write(w);
}
if (xunk_SPS1)
{
w.writeBytes("SPS1", 4);
xunk_SPS1.write(w);
}
if (xunk_SPS2)
{
w.writeBytes("SPS2", 4);
xunk_SPS2.write(w);
}
w.writeBytes("_END", 4); w.writeBytes("_END", 4);
} }

View File

@ -45,6 +45,9 @@ struct WPSM : BigYAML
uint32_t xa8_PJFX = ~0; uint32_t xa8_PJFX = ~0;
RealElementFactory xac_RNGE; RealElementFactory xac_RNGE;
RealElementFactory xb0_FOFF; RealElementFactory xb0_FOFF;
BoolHelper xunk_FC60;
BoolHelper xunk_SPS1;
BoolHelper xunk_SPS2;
void read(athena::io::YAMLDocReader& r); void read(athena::io::YAMLDocReader& r);
void write(athena::io::YAMLDocWriter& w) const; void write(athena::io::YAMLDocWriter& w) const;

View File

@ -16,6 +16,7 @@ class CScannableParameters;
class CLightParameters; class CLightParameters;
class CAnimationParameters; class CAnimationParameters;
class CFluidUVMotion; class CFluidUVMotion;
class CCameraShakeData;
using FScriptLoader = std::function<CEntity*(CStateManager& mgr, CInputStream& in, using FScriptLoader = std::function<CEntity*(CStateManager& mgr, CInputStream& in,
int propCount, const CEntityInfo& info)>; int propCount, const CEntityInfo& info)>;
@ -31,6 +32,7 @@ public:
static CLightParameters LoadLightParameters(CInputStream& in); static CLightParameters LoadLightParameters(CInputStream& in);
static CAnimationParameters LoadAnimationParameters(CInputStream& in); static CAnimationParameters LoadAnimationParameters(CInputStream& in);
static CFluidUVMotion LoadFluidUVMotion(CInputStream& in); static CFluidUVMotion LoadFluidUVMotion(CInputStream& in);
static CCameraShakeData LoadCameraShakeData(CInputStream& in);
static zeus::CTransform ConvertEditorEulerToTransform4f(const zeus::CVector3f& orientation, static zeus::CTransform ConvertEditorEulerToTransform4f(const zeus::CVector3f& orientation,
const zeus::CVector3f& position); const zeus::CVector3f& position);