2019-08-06 17:24:07 +01:00
|
|
|
// Copyright 2019 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
2019-08-06 13:43:24 +01:00
|
|
|
#include <stdexcept>
|
|
|
|
#include <vector>
|
|
|
|
#include "common/common_types.h"
|
|
|
|
#include "custom_tex_cache.h"
|
|
|
|
|
|
|
|
namespace Core {
|
2019-08-06 17:24:07 +01:00
|
|
|
CustomTexCache::CustomTexCache() {}
|
|
|
|
|
|
|
|
CustomTexCache::~CustomTexCache() {}
|
|
|
|
|
|
|
|
bool CustomTexCache::IsTextureDumped(u64 hash) const {
|
2019-08-06 13:43:24 +01:00
|
|
|
return dumped_textures.find(hash) != dumped_textures.end();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CustomTexCache::SetTextureDumped(const u64 hash) {
|
|
|
|
dumped_textures[hash] = true;
|
|
|
|
}
|
|
|
|
|
2019-08-06 17:24:07 +01:00
|
|
|
bool CustomTexCache::IsTextureCached(u64 hash) const {
|
2019-08-06 13:43:24 +01:00
|
|
|
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
|