mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
fix: do not reallocate assets for dynamic asset pool
This commit is contained in:
parent
306ffb730e
commit
80c4a9a2ae
@ -29,11 +29,6 @@ public:
|
||||
{
|
||||
GlobalAssetPool<T>::UnlinkAssetPool(this);
|
||||
|
||||
for (auto& entry : m_assets)
|
||||
{
|
||||
delete entry->Asset();
|
||||
}
|
||||
|
||||
m_assets.clear();
|
||||
m_asset_lookup.clear();
|
||||
}
|
||||
@ -42,10 +37,6 @@ public:
|
||||
{
|
||||
const auto normalizedName = XAssetInfo<T>::NormalizeAssetName(xAssetInfo->m_name);
|
||||
|
||||
T* newAsset = new T();
|
||||
memcpy(newAsset, xAssetInfo->Asset(), sizeof(T));
|
||||
xAssetInfo->m_ptr = newAsset;
|
||||
|
||||
auto* pAssetInfo = xAssetInfo.get();
|
||||
m_asset_lookup[normalizedName] = pAssetInfo;
|
||||
m_assets.emplace_back(std::move(xAssetInfo));
|
||||
|
@ -6,8 +6,12 @@ Zone::Zone(std::string name, const zone_priority_t priority, IGame* game)
|
||||
m_name(std::move(name)),
|
||||
m_priority(priority),
|
||||
m_language(GameLanguage::LANGUAGE_NONE),
|
||||
m_game(game)
|
||||
m_game(game),
|
||||
m_pools(ZoneAssetPools::CreateForGame(game->GetId(), this, priority))
|
||||
{
|
||||
const auto assetTypeCount = m_pools->GetAssetTypeCount();
|
||||
for (auto i = 0; i < assetTypeCount; i++)
|
||||
m_pools->InitPoolDynamic(i);
|
||||
}
|
||||
|
||||
Zone::~Zone()
|
||||
|
Loading…
x
Reference in New Issue
Block a user