Shipwright/libultraship/libultraship/Path.cpp
M4xw d24c8453db git subrepo clone https://github.com/HarbourMasters/libultraship.git
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:   "???"
2022-03-22 02:52:44 +01:00

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);
}
}
}