1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-16 11:33:03 +01:00

Get basic object downloading working

This commit is contained in:
Ted John
2019-02-02 17:49:34 +00:00
parent f5e24bd973
commit 27f70e3656
6 changed files with 109 additions and 5 deletions

View File

@@ -339,6 +339,23 @@ public:
}
}
void AddObjectFromFile(const std::string_view& objectName, const void* data, size_t dataSize) override
{
utf8 path[MAX_PATH];
GetPathForNewObject(path, sizeof(path), std::string(objectName).c_str());
log_verbose("Adding object: [%s]", objectName);
try
{
File::WriteAllBytes(path, data, dataSize);
ScanObject(path);
}
catch (const std::exception&)
{
Console::Error::WriteLine("Failed saving object: [%s] to '%s'.", objectName, path);
}
}
void ExportPackedObject(IStream* stream) override
{
auto chunkReader = SawyerChunkReader(stream);