mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-01 08:05:07 -04:00
d24c8453db
subrepo: subdir: "libultraship" merged: "a484cda98" upstream: origin: "https://github.com/HarbourMasters/libultraship.git" branch: "main" commit: "a484cda98" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
34 lines
657 B
C++
34 lines
657 B
C++
#include "Path.h"
|
|
|
|
namespace Ship
|
|
{
|
|
void PathV0::ParseFileBinary(BinaryReader* reader, Resource* res)
|
|
{
|
|
Path* path = (Path*)res;
|
|
|
|
ResourceFile::ParseFileBinary(reader, res);
|
|
|
|
uint32_t numPaths = reader->ReadUInt32();
|
|
path->paths.reserve(numPaths);
|
|
|
|
for (uint32_t k = 0; k < numPaths; k++)
|
|
{
|
|
std::vector<Vec3s> nodes;
|
|
|
|
uint32_t numNodes = reader->ReadUInt32();
|
|
nodes.reserve(numNodes);
|
|
|
|
for (uint32_t i = 0; i < numNodes; i++)
|
|
{
|
|
int16_t x = reader->ReadInt16();
|
|
int16_t y = reader->ReadInt16();
|
|
int16_t z = reader->ReadInt16();
|
|
|
|
nodes.push_back(Vec3s(x, y, z));
|
|
}
|
|
|
|
path->paths.push_back(nodes);
|
|
}
|
|
}
|
|
}
|