2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-06 23:25:53 +00:00
metaforce/Runtime/Graphics/CPVSAreaSet.cpp
Phillip Stephens dad7249927
RE COutput/InputStream and friends and migrate over
This branch is probably still horribly broken, but it's a good first step to migrating away from having hecl embedded in the runtime
2022-02-21 08:01:05 -08:00

23 lines
717 B
C++

#include "Runtime/Graphics/CPVSAreaSet.hpp"
#include "IOStreams.hpp"
namespace metaforce {
CPVSAreaSet::CPVSAreaSet(const u8* data, u32 len) {
CMemoryInStream r(data, len);
x0_numFeatures = r.ReadLong();
x4_numLights = r.ReadLong();
x8_num2ndLights = r.ReadLong();
xc_numActors = r.ReadLong();
x10_leafSize = r.ReadLong();
x14_lightIndexCount = r.ReadLong();
x18_entityIndex.reserve(xc_numActors);
for (u32 i = 0; i < xc_numActors; ++i)
x18_entityIndex.push_back(r.ReadLong());
x1c_lightLeaves = data + r.GetReadPosition();
const u8* octreeData = x1c_lightLeaves + x14_lightIndexCount * x10_leafSize;
x20_octree = CPVSVisOctree::MakePVSVisOctree(octreeData);
}
} // namespace metaforce