2017-01-20 08:36:52 -05:00
|
|
|
#include "STDInclude.hpp"
|
2016-01-22 05:59:43 -05:00
|
|
|
|
|
|
|
namespace Assets
|
|
|
|
{
|
2016-11-20 08:09:07 -05:00
|
|
|
void IMaterialVertexShader::save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
2016-01-22 05:59:43 -05:00
|
|
|
{
|
2016-11-20 08:09:07 -05:00
|
|
|
AssertSize(Game::MaterialVertexShader, 16);
|
2016-01-22 05:59:43 -05:00
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
Utils::Stream* buffer = builder->getBuffer();
|
2016-01-22 05:59:43 -05:00
|
|
|
Game::MaterialVertexShader* asset = header.vertexShader;
|
2016-11-20 08:09:07 -05:00
|
|
|
Game::MaterialVertexShader* dest = buffer->dest<Game::MaterialVertexShader>();
|
|
|
|
buffer->save(asset);
|
2016-01-22 05:59:43 -05:00
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
buffer->pushBlock(Game::XFILE_BLOCK_VIRTUAL);
|
2016-01-22 05:59:43 -05:00
|
|
|
|
|
|
|
if (asset->name)
|
|
|
|
{
|
2016-11-20 08:09:07 -05:00
|
|
|
buffer->saveString(builder->getAssetName(this->getType(), asset->name));
|
2016-06-10 07:52:55 -04:00
|
|
|
Utils::Stream::ClearPointer(&dest->name);
|
2016-01-22 05:59:43 -05:00
|
|
|
}
|
|
|
|
|
2017-04-22 15:47:04 -04:00
|
|
|
if (asset->prog.loadDef.program)
|
2016-01-22 05:59:43 -05:00
|
|
|
{
|
2016-11-20 08:09:07 -05:00
|
|
|
buffer->align(Utils::Stream::ALIGN_4);
|
2017-04-22 15:47:04 -04:00
|
|
|
buffer->saveArray(asset->prog.loadDef.program, asset->prog.loadDef.programSize);
|
|
|
|
Utils::Stream::ClearPointer(&dest->prog.loadDef.program);
|
2016-01-22 05:59:43 -05:00
|
|
|
}
|
|
|
|
|
2016-11-20 08:09:07 -05:00
|
|
|
buffer->popBlock();
|
2016-01-22 05:59:43 -05:00
|
|
|
}
|
|
|
|
}
|