diff options
Diffstat (limited to 'assetFactory')
-rw-r--r-- | assetFactory/asset.h | 3 | ||||
-rw-r--r-- | assetFactory/assetFactory.cpp | 3 | ||||
-rw-r--r-- | assetFactory/assetFactory.h | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/assetFactory/asset.h b/assetFactory/asset.h index 5bdd2f2..b5de056 100644 --- a/assetFactory/asset.h +++ b/assetFactory/asset.h @@ -2,12 +2,15 @@ #include "factoryMesh.h" #include "persistence.h" +#include <manyPtr.h> #include <stdTypeDefs.h> class TextureAtlas; +class Renderable; class Asset : public Persistence::Persistable, public StdTypeDefs<Asset> { public: + using ManyPtr = ManySharedPtr<Asset, const Renderable>; using TexturePtr = std::shared_ptr<TextureAtlas>; std::string id; diff --git a/assetFactory/assetFactory.cpp b/assetFactory/assetFactory.cpp index 176e1f5..426fecc 100644 --- a/assetFactory/assetFactory.cpp +++ b/assetFactory/assetFactory.cpp @@ -5,6 +5,7 @@ #include "filesystem.h" #include "gfx/image.h" #include "gfx/models/texture.h" +#include "gfx/renderable.h" #include "object.h" #include "plane.h" #include "saxParse-persistence.h" @@ -146,7 +147,7 @@ bool AssetFactory::persist(Persistence::PersistenceStore & store) { using MapObjects = Persistence::MapByMember<Shapes, std::shared_ptr<Object>>; - using MapAssets = Persistence::MapByMember<Assets>; + using MapAssets = Persistence::MapByMember<Assets, Asset::Ptr>; using MapTextureFragments = Persistence::MapByMember<TextureFragments>; using MapAssImp = Persistence::MapByMember<AssImps, std::shared_ptr<AssImp>, &AssImp::path>; return STORE_TYPE && STORE_NAME_HELPER("object", shapes, MapObjects) diff --git a/assetFactory/assetFactory.h b/assetFactory/assetFactory.h index 787f0a4..864e882 100644 --- a/assetFactory/assetFactory.h +++ b/assetFactory/assetFactory.h @@ -12,7 +12,7 @@ class Texture; class AssetFactory : public Persistence::Persistable { public: using Shapes = std::map<std::string, Shape::Ptr, std::less<>>; - using Assets = std::map<std::string, Asset::Ptr, std::less<>>; + using Assets = std::map<std::string, Asset::ManyPtr, std::less<>>; using AssImps = std::map<std::string, AssImp::Ptr, std::less<>>; using TextureFragments = std::map<std::string, TextureFragment::Ptr, std::less<>>; using Colour = RGB; |