mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-11 04:40:14 -05:00
![briaguya](/assets/img/avatar_default.png)
Co-authored-by: kenix3 <kenixwhisperwind@gmail.com> Co-authored-by: David Chavez <david@dcvz.io> Co-authored-by: KiritoDv <kiritodev01@gmail.com> Co-authored-by: Christopher Leggett <chris@leggett.dev>
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
#include "VtxExporter.h"
|
|
#include <libultraship/bridge.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);
|
|
}
|