VideoCommon: move all texture calculations to a "TextureInfo" class. This ever so slightly improves readability and allows for the full texture name to be generated outside of the hires texture cache

This commit is contained in:
iwubcode
2021-05-01 00:59:24 -05:00
parent 1f26b694dc
commit 182dfc38e6
8 changed files with 551 additions and 226 deletions

View File

@ -11,6 +11,7 @@
#include "Common/CommonTypes.h"
#include "VideoCommon/TextureConfig.h"
#include "VideoCommon/TextureInfo.h"
enum class TextureFormat;
@ -25,13 +26,9 @@ public:
static void Clear();
static void Shutdown();
static std::shared_ptr<HiresTexture> Search(const u8* texture, size_t texture_size,
const u8* tlut, size_t tlut_size, u32 width,
u32 height, TextureFormat format, bool has_mipmaps);
static std::shared_ptr<HiresTexture> Search(TextureInfo& texture_info);
static std::string GenBaseName(const u8* texture, size_t texture_size, const u8* tlut,
size_t tlut_size, u32 width, u32 height, TextureFormat format,
bool has_mipmaps, bool dump = false);
static std::string GenBaseName(TextureInfo& texture_info, bool dump = false);
static u32 CalculateMipCount(u32 width, u32 height);