Update dependencies and add virtual destructor to asset interfaces

This commit is contained in:
momo5502 2016-08-04 14:27:43 +02:00
parent bb65f463be
commit 67aade3ef4
4 changed files with 367 additions and 360 deletions

2
deps/fmt vendored

@ -1 +1 @@
Subproject commit ed301089183f51d53f9f076b9676d9c2a1f7c505
Subproject commit 9dbb60c4c8019c0d851ce2e61f99cb5c74696369

2
deps/protobuf vendored

@ -1 +1 @@
Subproject commit 00d5a7f099065e2c8d119039c2f42c1f88ad8f59
Subproject commit 0dca3cc5d642590d4c2bc75ce15e0c2ca31bcc87

View File

@ -22,9 +22,13 @@ namespace Components
if (AssetHandler::AssetInterfaces.find(iAsset->GetType()) != AssetHandler::AssetInterfaces.end())
{
Logger::Print("Duplicate interface handler: %s\n", Game::DB_GetXAssetTypeName(iAsset->GetType()));
Logger::Print("Duplicate asset interface: %s\n", Game::DB_GetXAssetTypeName(iAsset->GetType()));
delete AssetHandler::AssetInterfaces[iAsset->GetType()];
}
else
{
Logger::Print("Asset interface registered: %s\n", Game::DB_GetXAssetTypeName(iAsset->GetType()));
}
AssetHandler::AssetInterfaces[iAsset->GetType()] = iAsset;
}
@ -251,22 +255,24 @@ namespace Components
Utils::Hook(0x5BB650, AssetHandler::AddAssetStub, HOOK_JUMP).Install()->Quick();
// Register asset interfaces
AssetHandler::RegisterInterface(new Assets::IXModel());
AssetHandler::RegisterInterface(new Assets::IMapEnts());
AssetHandler::RegisterInterface(new Assets::IRawFile());
AssetHandler::RegisterInterface(new Assets::IGfxImage());
AssetHandler::RegisterInterface(new Assets::IMaterial());
AssetHandler::RegisterInterface(new Assets::IPhysPreset());
AssetHandler::RegisterInterface(new Assets::IXAnimParts());
AssetHandler::RegisterInterface(new Assets::IPhysCollmap());
//AssetHandler::RegisterInterface(new Assets::IXModelSurfs());
AssetHandler::RegisterInterface(new Assets::ILocalizedEntry());
AssetHandler::RegisterInterface(new Assets::IMaterialPixelShader());
AssetHandler::RegisterInterface(new Assets::IMaterialTechniqueSet());
AssetHandler::RegisterInterface(new Assets::IMaterialVertexShader());
AssetHandler::RegisterInterface(new Assets::IStructuredDataDefSet());
AssetHandler::RegisterInterface(new Assets::IMaterialVertexDeclaration());
if (ZoneBuilder::IsEnabled())
{
AssetHandler::RegisterInterface(new Assets::IXModel());
AssetHandler::RegisterInterface(new Assets::IMapEnts());
AssetHandler::RegisterInterface(new Assets::IRawFile());
AssetHandler::RegisterInterface(new Assets::IGfxImage());
AssetHandler::RegisterInterface(new Assets::IMaterial());
AssetHandler::RegisterInterface(new Assets::IPhysPreset());
AssetHandler::RegisterInterface(new Assets::IXAnimParts());
AssetHandler::RegisterInterface(new Assets::IPhysCollmap());
//AssetHandler::RegisterInterface(new Assets::IXModelSurfs());
AssetHandler::RegisterInterface(new Assets::ILocalizedEntry());
AssetHandler::RegisterInterface(new Assets::IMaterialPixelShader());
AssetHandler::RegisterInterface(new Assets::IMaterialTechniqueSet());
AssetHandler::RegisterInterface(new Assets::IMaterialVertexShader());
AssetHandler::RegisterInterface(new Assets::IStructuredDataDefSet());
AssetHandler::RegisterInterface(new Assets::IMaterialVertexDeclaration());
}
}
AssetHandler::~AssetHandler()

View File

@ -6,6 +6,7 @@ namespace Components
class IAsset
{
public:
virtual ~IAsset() {};
virtual Game::XAssetType GetType() { return Game::XAssetType::ASSET_TYPE_INVALID; };
virtual void Mark(Game::XAssetHeader header, ZoneBuilder::Zone* builder) { /*ErrorTypeNotSupported(this);*/ };
virtual void Save(Game::XAssetHeader header, ZoneBuilder::Zone* builder) { /*ErrorTypeNotSupported(this);*/ };