2020-01-15 12:07:48 +00:00
|
|
|
#include "Runtime/Graphics/CPVSAreaSet.hpp"
|
2022-02-19 13:04:45 +00:00
|
|
|
#include "Runtime/Streams/IOStreams.hpp"
|
2016-07-27 23:06:57 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2016-07-27 23:06:57 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
CPVSAreaSet::CPVSAreaSet(const u8* data, u32 len) {
|
|
|
|
CMemoryInStream r(data, len);
|
2022-02-18 07:37:54 +00:00
|
|
|
x0_numFeatures = r.ReadLong();
|
|
|
|
x4_numLights = r.ReadLong();
|
|
|
|
x8_num2ndLights = r.ReadLong();
|
|
|
|
xc_numActors = r.ReadLong();
|
|
|
|
x10_leafSize = r.ReadLong();
|
|
|
|
x14_lightIndexCount = r.ReadLong();
|
2018-12-08 05:30:43 +00:00
|
|
|
x18_entityIndex.reserve(xc_numActors);
|
2019-06-12 02:05:17 +00:00
|
|
|
for (u32 i = 0; i < xc_numActors; ++i)
|
2022-02-18 07:37:54 +00:00
|
|
|
x18_entityIndex.push_back(r.ReadLong());
|
|
|
|
x1c_lightLeaves = data + r.GetReadPosition();
|
2018-12-08 05:30:43 +00:00
|
|
|
const u8* octreeData = x1c_lightLeaves + x14_lightIndexCount * x10_leafSize;
|
|
|
|
x20_octree = CPVSVisOctree::MakePVSVisOctree(octreeData);
|
2016-07-27 23:06:57 +00:00
|
|
|
}
|
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|