From 26f8b8693671b4b9660c3e954ce530bd4eb6780d Mon Sep 17 00:00:00 2001 From: RektInator Date: Sat, 25 Feb 2017 21:11:17 +0100 Subject: [PATCH] [ImenuDef_t] Menu marking. --- .../Modules/AssetInterfaces/ImenuDef_t.cpp | 24 +++++++++++++++++++ .../Modules/AssetInterfaces/ImenuDef_t.hpp | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/Components/Modules/AssetInterfaces/ImenuDef_t.cpp b/src/Components/Modules/AssetInterfaces/ImenuDef_t.cpp index 01620d10..4c3ad6ad 100644 --- a/src/Components/Modules/AssetInterfaces/ImenuDef_t.cpp +++ b/src/Components/Modules/AssetInterfaces/ImenuDef_t.cpp @@ -2,6 +2,30 @@ 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 void save_windowDef_t(Game::windowDef_t* asset, T* dest, Components::ZoneBuilder::Zone* builder) { diff --git a/src/Components/Modules/AssetInterfaces/ImenuDef_t.hpp b/src/Components/Modules/AssetInterfaces/ImenuDef_t.hpp index 90b0831c..1f58deb5 100644 --- a/src/Components/Modules/AssetInterfaces/ImenuDef_t.hpp +++ b/src/Components/Modules/AssetInterfaces/ImenuDef_t.hpp @@ -8,7 +8,7 @@ namespace Assets virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_MENU; }; 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; }; }