[ImenuDef_t] Menu marking.

This commit is contained in:
RektInator 2017-02-25 21:11:17 +01:00
parent 8c36783f1d
commit 26f8b86936
2 changed files with 25 additions and 1 deletions

View File

@ -2,6 +2,30 @@
namespace Assets namespace Assets
{ {
void ImenuDef_t::mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
{
Game::menuDef_t *asset = header.menu;
if (asset->window.background)
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_MATERIAL, asset->window.background);
}
// mark items
for (int i = 0; i < asset->itemCount; i++)
{
if (asset->items[i]->window.background)
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_MATERIAL, asset->items[i]->window.background);
}
if (asset->items[i]->focusSound)
{
builder->loadAsset(Game::XAssetType::ASSET_TYPE_SOUND, asset->items[i]->focusSound);
}
}
}
template <typename T> template <typename T>
void save_windowDef_t(Game::windowDef_t* asset, T* dest, Components::ZoneBuilder::Zone* builder) void save_windowDef_t(Game::windowDef_t* asset, T* dest, Components::ZoneBuilder::Zone* builder)
{ {

View File

@ -8,7 +8,7 @@ namespace Assets
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_MENU; }; virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_MENU; };
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override; virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
// virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override; virtual void mark(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
// virtual void load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder) override; // virtual void load(Game::XAssetHeader* header, std::string name, Components::ZoneBuilder::Zone* builder) override;
}; };
} }