mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 14:58:10 -05:00
ZoneLoading: Properly link assets as dependencies instead of only saving the name of the dependency
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
#include "GlobalAssetPool.h"
|
||||
#include "AssetPool.h"
|
||||
#include "XAssetInfo.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
@ -25,9 +26,10 @@ class AssetPoolStatic final : public AssetPool<T>
|
||||
AssetPoolEntry* m_pool;
|
||||
XAssetInfo<T>* m_info_pool;
|
||||
size_t m_capacity;
|
||||
asset_type_t m_type;
|
||||
|
||||
public:
|
||||
AssetPoolStatic(const size_t capacity, const int priority)
|
||||
AssetPoolStatic(const size_t capacity, const int priority, asset_type_t type)
|
||||
{
|
||||
m_capacity = capacity;
|
||||
|
||||
@ -78,7 +80,7 @@ public:
|
||||
m_capacity = 0;
|
||||
}
|
||||
|
||||
XAssetInfo<T>* AddAsset(std::string name, T* asset, std::vector<std::string>& scriptStrings, std::vector<XAssetDependency>& dependencies) override
|
||||
XAssetInfo<T>* AddAsset(std::string name, T* asset, std::vector<std::string>& scriptStrings, std::vector<XAssetInfoGeneric*>& dependencies) override
|
||||
{
|
||||
if(m_free == nullptr)
|
||||
{
|
||||
@ -90,8 +92,9 @@ public:
|
||||
|
||||
memcpy(&poolSlot->m_entry, asset, sizeof(T));
|
||||
|
||||
poolSlot->m_info->m_type = m_type;
|
||||
poolSlot->m_info->m_name = std::move(name);
|
||||
poolSlot->m_info->m_asset = &poolSlot->m_entry;
|
||||
poolSlot->m_info->m_ptr = &poolSlot->m_entry;
|
||||
poolSlot->m_info->m_script_strings = std::move(scriptStrings);
|
||||
poolSlot->m_info->m_dependencies = std::move(dependencies);
|
||||
|
||||
|
Reference in New Issue
Block a user