metaforce/Runtime/World/CGameArea.cpp

44 lines
1.0 KiB
C++
Raw Normal View History

2016-04-19 00:17:49 +00:00
#include "CGameArea.hpp"
namespace urde
{
static std::vector<SObjectTag> ReadDependencyList(CInputStream& in)
{
std::vector<SObjectTag> ret;
u32 count = in.readUint32Big();
ret.reserve(count);
for (int i=0 ; i<count ; ++i)
{
ret.emplace_back();
ret.back().readMLVL(in);
}
return ret;
}
CGameArea::CGameArea(CInputStream& in, int mlvlVersion)
2016-04-23 18:04:49 +00:00
: x4_mlvlVersion(mlvlVersion), xf0_25_active(true)
2016-04-19 00:17:49 +00:00
{
x8_nameSTRG = in.readUint32Big();
xc_transform.read34RowMajor(in);
x3c_invTransform = xc_transform.inverse();
x6c_aabb.readBoundingBoxBig(in);
2016-04-23 18:04:49 +00:00
2016-04-19 00:17:49 +00:00
x84_mrea = in.readUint32Big();
2016-04-23 18:04:49 +00:00
if (mlvlVersion > 15)
x88_areaId = in.readUint32Big();
else
x88_areaId = -1;
2016-04-19 00:17:49 +00:00
u32 attachedCount = in.readUint32Big();
x8c_attachedAreaIndices.reserve(attachedCount);
for (int i=0 ; i<attachedCount ; ++i)
x8c_attachedAreaIndices.push_back(in.readUint16Big());
x9c_deps1 = ReadDependencyList(in);
xac_deps2 = ReadDependencyList(in);
}
}