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

32 lines
748 B
C++
Raw Normal View History

2022-02-27 07:53:44 -05:00
#include <STDInclude.hpp>
#include "IPhysPreset.hpp"
2016-01-25 17:47:50 -05:00
namespace Assets
{
void IPhysPreset::save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
2016-01-25 17:47:50 -05:00
{
AssertSize(Game::PhysPreset, 44);
2016-01-25 17:47:50 -05:00
Utils::Stream* buffer = builder->getBuffer();
2016-01-25 17:47:50 -05:00
Game::PhysPreset* asset = header.physPreset;
Game::PhysPreset* dest = buffer->dest<Game::PhysPreset>();
buffer->save(asset);
2016-01-25 17:47:50 -05:00
buffer->pushBlock(Game::XFILE_BLOCK_VIRTUAL);
2016-01-25 17:47:50 -05:00
if (asset->name)
{
buffer->saveString(builder->getAssetName(this->getType(), asset->name));
Utils::Stream::ClearPointer(&dest->name);
2016-01-25 17:47:50 -05:00
}
if (asset->sndAliasPrefix)
{
buffer->saveString(asset->sndAliasPrefix);
Utils::Stream::ClearPointer(&dest->sndAliasPrefix);
2016-01-25 17:47:50 -05:00
}
buffer->popBlock();
2016-01-25 17:47:50 -05:00
}
}