2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2025-07-09 04:31:49 +00:00

ZoneCodeGenerator: Add support for scriptstring array pointers

This commit is contained in:
Jan
2019-11-24 02:46:40 +01:00
parent 1606f62ee7
commit b8bd20f693
3 changed files with 39 additions and 12 deletions

View File

@ -1,4 +1,5 @@
#include "AssetLoader.h"
#include <cassert>
AssetLoader::AssetLoader(const asset_type_t assetType, IZoneScriptStringProvider* scriptStringProvider, Zone* zone, IZoneInputStream* stream)
{
@ -47,6 +48,20 @@ scr_string_t AssetLoader::UseScriptString(const scr_string_t scrString)
return scriptStringIndex;
}
void AssetLoader::LoadScriptStringArray(const bool atStreamStart, const size_t count)
{
assert(varScriptString != nullptr);
if (atStreamStart)
m_stream->Load<scr_string_t>(varScriptString, count);
for (size_t index = 0; index < count; index++)
{
*varScriptString = UseScriptString(*varScriptString);
varScriptString++;
}
}
void* AssetLoader::LinkAsset(std::string name, void* asset)
{
return m_zone->GetPools()->AddAsset(m_asset_type, std::move(name), asset, m_used_script_strings, m_dependencies);