From aabc9f51bb1a5e4412463ca88a7b7b46430a101a Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Tue, 27 Feb 2024 11:22:10 +0100 Subject: [PATCH] Improve #2270 by moving mehtod to cpp file --- Source/Engine/Content/Content.cpp | 8 ++++++-- Source/Engine/Content/Factories/IAssetFactory.h | 6 +----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Engine/Content/Content.cpp b/Source/Engine/Content/Content.cpp index 27738af06..810c0bb3c 100644 --- a/Source/Engine/Content/Content.cpp +++ b/Source/Engine/Content/Content.cpp @@ -198,6 +198,12 @@ void ContentService::Dispose() Graphics::DisposeDevice(); } +IAssetFactory::Collection& IAssetFactory::Get() +{ + static Collection Factories(1024); + return Factories; +} + AssetsCache* Content::GetRegistry() { return &Cache; @@ -912,8 +918,6 @@ bool Content::IsAssetTypeIdInvalid(const ScriptingTypeHandle& type, const Script return true; } -Dictionary IAssetFactory::Factories; - Asset* Content::LoadAsync(const Guid& id, const ScriptingTypeHandle& type) { if (!id.IsValid()) diff --git a/Source/Engine/Content/Factories/IAssetFactory.h b/Source/Engine/Content/Factories/IAssetFactory.h index 64ae5c122..e544ceca2 100644 --- a/Source/Engine/Content/Factories/IAssetFactory.h +++ b/Source/Engine/Content/Factories/IAssetFactory.h @@ -16,15 +16,11 @@ class FLAXENGINE_API IAssetFactory { public: typedef Dictionary Collection; - static Collection Factories; /// /// Gets the all registered assets factories. Key is asset typename, value is the factory object. /// - static Collection& Get() - { - return Factories; - } + static Collection& Get(); public: ///