citra/src/core/custom_tex_cache.cpp

32 lines
841 B
C++
Raw Normal View History

// Copyright 2019 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
2019-08-14 05:04:50 +00:00
#include "core/custom_tex_cache.h"
namespace Core {
CustomTexCache::CustomTexCache() = default;
CustomTexCache::~CustomTexCache() = default;
bool CustomTexCache::IsTextureDumped(u64 hash) const {
2019-08-14 05:04:50 +00:00
return dumped_textures.count(hash);
}
void CustomTexCache::SetTextureDumped(const u64 hash) {
2019-08-14 05:04:50 +00:00
dumped_textures.insert(hash);
}
bool CustomTexCache::IsTextureCached(u64 hash) const {
2019-08-14 05:04:50 +00:00
return custom_textures.count(hash);
}
2019-08-14 05:04:50 +00:00
const CustomTexInfo& CustomTexCache::LookupTexture(u64 hash) const {
return custom_textures.at(hash);
}
void CustomTexCache::CacheTexture(u64 hash, const std::vector<u8>& tex, u32 width, u32 height) {
custom_textures[hash] = {width, height, tex};
}
} // namespace Core