mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-15 22:15:16 -05:00
442a88f03b
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: "???"
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#include "VtxExporter.h"
|
|
#include "Resource.h"
|
|
#include "VersionInfo.h"
|
|
|
|
|
|
void OTRExporter_Vtx::SaveArr(ZResource* res, const fs::path& outPath, const std::vector<ZResource*>& vec, BinaryWriter* writer)
|
|
{
|
|
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
|
|
|
|
for (auto& res: vec) {
|
|
ZVtx* vtx = (ZVtx*)res;
|
|
writer->Write(vtx->x);
|
|
writer->Write(vtx->y);
|
|
writer->Write(vtx->z);
|
|
writer->Write(vtx->flag);
|
|
writer->Write(vtx->s);
|
|
writer->Write(vtx->t);
|
|
writer->Write(vtx->r);
|
|
writer->Write(vtx->g);
|
|
writer->Write(vtx->b);
|
|
writer->Write(vtx->a);
|
|
}
|
|
|
|
}
|
|
|
|
void OTRExporter_Vtx::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
|
{
|
|
ZVtx* vtx = (ZVtx*)res;
|
|
|
|
WriteHeader(res, outPath, writer, Ship::ResourceType::Vertex);
|
|
|
|
writer->Write((uint32_t)1); //Yes I'm hard coding it to one, it *should* be fine.
|
|
|
|
writer->Write(vtx->x);
|
|
writer->Write(vtx->y);
|
|
writer->Write(vtx->z);
|
|
writer->Write(vtx->flag);
|
|
writer->Write(vtx->s);
|
|
writer->Write(vtx->t);
|
|
writer->Write(vtx->r);
|
|
writer->Write(vtx->g);
|
|
writer->Write(vtx->b);
|
|
writer->Write(vtx->a);
|
|
}
|