mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:47:42 +00:00
Update submodules, initial CTextureCache
This commit is contained in:
@@ -1,5 +1,25 @@
|
||||
//
|
||||
// Created by antidote on 12/3/19.
|
||||
//
|
||||
#include "Runtime/CTextureCache.hpp"
|
||||
#include "Runtime/CToken.hpp"
|
||||
|
||||
#include "CTextureCache.hpp"
|
||||
namespace urde {
|
||||
CTextureCache::CTextureCache(CInputStream& in) {
|
||||
u32 textureCount = in.readUint32Big();
|
||||
for (u32 i = 0; i < textureCount; ++i) {
|
||||
CAssetId uid(in);
|
||||
if (m_textureInfo.find(uid) == m_textureInfo.end())
|
||||
m_textureInfo.emplace(uid, CTextureInfo(in));
|
||||
}
|
||||
}
|
||||
|
||||
const CTextureInfo* CTextureCache::GetTextureInfo(CAssetId id) const {
|
||||
auto it = m_textureInfo.find(id);
|
||||
if (it == m_textureInfo.end())
|
||||
return nullptr;
|
||||
return &it->second;
|
||||
}
|
||||
|
||||
CFactoryFnReturn FTextureCacheFactory(const SObjectTag& tag, CInputStream& in,
|
||||
const CVParamTransfer& vparms, CObjectReference* selfRef) {
|
||||
return TToken<CTextureCache>::GetIObjObjectFor(std::make_unique<CTextureCache>(in));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user