[IMenuList] Initial commit
This commit is contained in:
parent
c0dcc4afbf
commit
bd8a746811
@ -436,6 +436,7 @@ namespace Components
|
||||
#endif
|
||||
AssetHandler::RegisterInterface(new Assets::ISndCurve());
|
||||
AssetHandler::RegisterInterface(new Assets::IMaterial());
|
||||
AssetHandler::RegisterInterface(new Assets::IMenuList());
|
||||
#ifdef ENABLE_EXPERIMENTAL_MAP_CODE
|
||||
AssetHandler::RegisterInterface(new Assets::IclipMap_t());
|
||||
#endif
|
||||
|
@ -83,6 +83,7 @@ namespace Components
|
||||
#include "AssetInterfaces/IGfxWorld.hpp"
|
||||
#include "AssetInterfaces/IMaterial.hpp"
|
||||
#include "AssetInterfaces/ISndCurve.hpp"
|
||||
#include "AssetInterfaces/IMenuList.hpp"
|
||||
#include "AssetInterfaces/IclipMap_t.hpp"
|
||||
#include "AssetInterfaces/IPhysPreset.hpp"
|
||||
#include "AssetInterfaces/IXAnimParts.hpp"
|
||||
|
38
src/Components/Modules/AssetInterfaces/IMenuList.cpp
Normal file
38
src/Components/Modules/AssetInterfaces/IMenuList.cpp
Normal file
@ -0,0 +1,38 @@
|
||||
#include "STDInclude.hpp"
|
||||
|
||||
namespace Assets
|
||||
{
|
||||
void IMenuList::save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
||||
{
|
||||
AssertSize(Game::MenuList, 12);
|
||||
|
||||
Utils::Stream* buffer = builder->getBuffer();
|
||||
Game::MenuList* asset = header.menuList;
|
||||
Game::MenuList* dest = buffer->dest<Game::MenuList>();
|
||||
|
||||
buffer->save(asset);
|
||||
|
||||
buffer->pushBlock(Game::XFILE_BLOCK_VIRTUAL);
|
||||
|
||||
if (asset->name)
|
||||
{
|
||||
buffer->saveString(builder->getAssetName(this->getType(), asset->name));
|
||||
Utils::Stream::ClearPointer(&dest->name);
|
||||
}
|
||||
|
||||
if (asset->menus)
|
||||
{
|
||||
buffer->align(Utils::Stream::ALIGN_4);
|
||||
|
||||
Game::menuDef_t **destMenus = buffer->dest<Game::menuDef_t*>();
|
||||
buffer->saveArray(asset->menus, asset->menuCount);
|
||||
|
||||
for (int i = 0; i < asset->menuCount; i++)
|
||||
{
|
||||
destMenus[i] = builder->saveSubAsset(Game::XAssetType::ASSET_TYPE_MENU, asset->menus[i]).menu;
|
||||
}
|
||||
}
|
||||
|
||||
buffer->popBlock();
|
||||
}
|
||||
}
|
14
src/Components/Modules/AssetInterfaces/IMenuList.hpp
Normal file
14
src/Components/Modules/AssetInterfaces/IMenuList.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
namespace Assets
|
||||
{
|
||||
class IMenuList : public Components::AssetHandler::IAsset
|
||||
{
|
||||
public:
|
||||
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_MENULIST; };
|
||||
|
||||
virtual void save(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;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user