iw4x-client/src/Components/Modules/AssetInterfaces/ILocalizeEntry.cpp

32 lines
736 B
C++
Raw Normal View History

2022-02-27 07:53:44 -05:00
#include <STDInclude.hpp>
#include "ILocalizeEntry.hpp"
2016-01-12 13:08:26 -05:00
namespace Assets
{
void ILocalizeEntry::save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
2016-01-12 13:08:26 -05:00
{
AssertSize(Game::LocalizeEntry, 8);
2016-01-22 05:59:43 -05:00
Utils::Stream* buffer = builder->getBuffer();
Game::LocalizeEntry* asset = header.localize;
Game::LocalizeEntry* dest = buffer->dest<Game::LocalizeEntry>();
buffer->save(asset);
2016-01-12 13:08:26 -05:00
buffer->pushBlock(Game::XFILE_BLOCK_VIRTUAL);
2016-01-12 13:08:26 -05:00
if (asset->value)
{
buffer->saveString(asset->value);
Utils::Stream::ClearPointer(&dest->value);
2016-01-12 13:08:26 -05:00
}
if (asset->name)
{
buffer->saveString(builder->getAssetName(this->getType(), asset->name));
Utils::Stream::ClearPointer(&dest->name);
2016-01-12 13:08:26 -05:00
}
buffer->popBlock();
2016-01-12 13:08:26 -05:00
}
}