Shipwright/OTRExporter/OTRExporter/PathExporter.cpp
M4xw 442a88f03b git subrepo clone https://github.com/HarbourMasters/OTRExporter.git
subrepo:
  subdir:   "OTRExporter"
  merged:   "1503d3eef"
upstream:
  origin:   "https://github.com/HarbourMasters/OTRExporter.git"
  branch:   "master"
  commit:   "1503d3eef"
git-subrepo:
  version:  "0.4.1"
  origin:   "???"
  commit:   "???"
2022-03-22 02:53:02 +01:00

23 lines
694 B
C++

#include "PathExporter.h"
#include "../ZAPD/ZFile.h"
void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
{
ZPath* path = (ZPath*)res;
WriteHeader(res, outPath, writer, Ship::ResourceType::Path);
writer->Write((uint32_t)path->pathways.size());
for (int k = 0; k < path->pathways.size(); k++)
{
writer->Write((uint32_t)path->pathways[k].points.size());
for (int i = 0; i < path->pathways[k].points.size(); i++)
{
writer->Write(path->pathways[k].points[i].scalars[0].scalarData.s16);
writer->Write(path->pathways[k].points[i].scalars[1].scalarData.s16);
writer->Write(path->pathways[k].points[i].scalars[2].scalarData.s16);
}
}
}