mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-02-11 21:00:12 -05:00
![M4xw](/assets/img/avatar_default.png)
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: "???"
21 lines
649 B
C++
21 lines
649 B
C++
#include "BlobExporter.h"
|
|
#include "../ZAPD/ZFile.h"
|
|
|
|
void OTRExporter_Blob::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer)
|
|
{
|
|
ZBlob* blob = (ZBlob*)res;
|
|
|
|
WriteHeader(blob, outPath, writer, Ship::ResourceType::Blob);
|
|
|
|
auto start = std::chrono::steady_clock::now();
|
|
|
|
writer->Write((uint32_t)blob->GetRawDataSize());
|
|
|
|
auto data = blob->parent->GetRawData();
|
|
|
|
for (size_t i = blob->GetRawDataIndex(); i < blob->GetRawDataIndex() + blob->GetRawDataSize(); i++)
|
|
writer->Write(data[i]);
|
|
|
|
auto end = std::chrono::steady_clock::now();
|
|
size_t diff = std::chrono::duration_cast<std::chrono::milliseconds>(end - start).count();
|
|
} |