fix crashes, add custom texture cache, load textures from load directory
This commit is contained in:
parent
f866b2a917
commit
6d90c42a79
16 changed files with 167 additions and 49 deletions
27
src/core/custom_tex_cache.cpp
Normal file
27
src/core/custom_tex_cache.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
#include <stdexcept>
|
||||
#include <vector>
|
||||
#include "common/common_types.h"
|
||||
#include "custom_tex_cache.h"
|
||||
|
||||
namespace Core {
|
||||
const bool CustomTexCache::IsTextureDumped(const u64 hash) {
|
||||
return dumped_textures.find(hash) != dumped_textures.end();
|
||||
}
|
||||
|
||||
void CustomTexCache::SetTextureDumped(const u64 hash) {
|
||||
dumped_textures[hash] = true;
|
||||
}
|
||||
|
||||
const bool CustomTexCache::IsTextureCached(const u64 hash) {
|
||||
return custom_textures.find(hash) != custom_textures.end();
|
||||
}
|
||||
|
||||
const CustomTexInfo& CustomTexCache::LookupTexture(const u64 hash) {
|
||||
return custom_textures.at(hash);
|
||||
}
|
||||
|
||||
void CustomTexCache::CacheTexture(const u64 hash, const std::vector<u8>& tex, u32 width,
|
||||
u32 height) {
|
||||
custom_textures[hash] = {width, height, tex};
|
||||
}
|
||||
} // namespace Core
|
Loading…
Add table
Add a link
Reference in a new issue