Skip to content

Commit 7d44f93

Browse files
committed
Some fixes
1 parent 5ca4c40 commit 7d44f93

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

include/nbl/asset/IAssetManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ class IAssetManager : public core::IReferenceCounted, public core::QuitSignallin
574574
//! @returns 0xdeadbeefu on failure or 0-based index on success.
575575
uint32_t addAssetLoader(core::smart_refctd_ptr<IAssetLoader>&& _loader)
576576
{
577-
_loader->initialize();
578577
// there's no way it ever fails, so no 0xdeadbeef return
579578
const char** exts = _loader->getAssociatedFileExtensions();
580579
size_t extIx = 0u;

include/nbl/asset/interchange/IAssetLoader.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,9 @@ class IAssetLoader : public virtual core::IReferenceCounted
311311

312312
assert(bundle.getContents().size() == reloadedBundle.getContents().size());
313313

314-
const uint32_t count = bundle.getContents().size();
315-
auto* dummies = bundle.getContents().begin();
316-
auto* reloaded = reloadedBundle.getContents().begin();
314+
const uint32_t count = bundle.getMutableContents().size();
315+
auto* dummies = bundle.getMutableContents().begin();
316+
auto* reloaded = reloadedBundle.getMutableContents().begin();
317317
for (uint32_t i = 0u; i < count; ++i)
318318
if (dummies[i]->isADummyObjectForCache() && !dummies[i]->canBeRestoredFrom(reloaded[i].get()))
319319
return {}; // return empty bundle

include/nbl/asset/interchange/SAssetBundle.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,6 @@ class SAssetBundle
6161
{
6262
return core::SRange<const core::smart_refctd_ptr<IAsset>>(m_contents->begin(),m_contents->end());
6363
}
64-
inline core::SRange<core::smart_refctd_ptr<IAsset>> getContents()
65-
{
66-
return core::SRange<core::smart_refctd_ptr<IAsset>>(m_contents->begin(), m_contents->end());
67-
}
6864

6965
//! Whether this asset bundle is in a cache and should be removed from cache to destroy
7066
inline bool isInAResourceCache() const { return m_isCached; }
@@ -113,6 +109,10 @@ class SAssetBundle
113109
m_contents->operator[](offset) = std::move(_asset);
114110
assert(allSameTypeAndNotNull());
115111
}
112+
inline core::SRange<core::smart_refctd_ptr<IAsset>> getMutableContents()
113+
{
114+
return core::SRange<core::smart_refctd_ptr<IAsset>>(m_contents->begin(), m_contents->end());
115+
}
116116

117117

118118
core::smart_refctd_ptr<IAssetMetadata> m_metadata;

src/nbl/asset/IAssetManager.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ void IAssetManager::addLoadersAndWriters()
185185
#ifdef _NBL_COMPILE_WITH_GLI_WRITER_
186186
addAssetWriter(core::make_smart_refctd_ptr<asset::CGLIWriter>());
187187
#endif
188+
189+
for (auto& loader : m_loaders.vector)
190+
loader->initialize();
188191
}
189192

190193

0 commit comments

Comments
 (0)