fix crashes, add custom texture cache, load textures from load directory

This commit is contained in:
Khangaroo 2019-08-06 08:43:24 -04:00 committed by James Rowe
parent f866b2a917
commit 6d90c42a79
16 changed files with 167 additions and 49 deletions

View 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