mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-27 08:15:33 +01:00
CustomTexture: Use another file name with wildcards
This commit is contained in:
parent
a353ead3cb
commit
ee9d05d67f
@ -80,7 +80,7 @@ void HiresTexture::Init(const std::string& gameCode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format)
|
std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format, bool dump)
|
||||||
{
|
{
|
||||||
// checking for min/max on paletted textures
|
// checking for min/max on paletted textures
|
||||||
u32 min = 0xffff;
|
u32 min = 0xffff;
|
||||||
@ -119,14 +119,16 @@ std::string HiresTexture::GenBaseName(const u8* texture, size_t texture_size, co
|
|||||||
}
|
}
|
||||||
|
|
||||||
u64 tex_hash = GetHashHiresTexture(texture, (int)texture_size);
|
u64 tex_hash = GetHashHiresTexture(texture, (int)texture_size);
|
||||||
u64 tlut_hash = 0;
|
u64 tlut_hash = tlut_size ? GetHashHiresTexture(tlut, (int)tlut_size) : 0;
|
||||||
u64 hash = tex_hash;
|
|
||||||
if (tlut_size)
|
std::string basename = StringFromFormat("tex1_%dx%d_%016lx", width, height, tex_hash);
|
||||||
{
|
std::string tlutname = tlut_size ? StringFromFormat("_%016lx", tlut_hash) : "";
|
||||||
tlut_hash = GetHashHiresTexture(tlut, (int)tlut_size);
|
std::string formatname = StringFromFormat("_%d", format);
|
||||||
hash ^= tlut_hash;
|
|
||||||
}
|
if (!dump && textureMap.find(basename + "_*" + formatname) != textureMap.end())
|
||||||
return StringFromFormat("%s_%08x_%i", SConfig::GetInstance().m_LocalCoreStartupParameter.m_strUniqueID.c_str(), (u32)hash, (u16)format);
|
return basename + "_*" + formatname;
|
||||||
|
|
||||||
|
return basename + tlutname + formatname;
|
||||||
}
|
}
|
||||||
|
|
||||||
HiresTexture* HiresTexture::Search(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format)
|
HiresTexture* HiresTexture::Search(const u8* texture, size_t texture_size, const u8* tlut, size_t tlut_size, u32 width, u32 height, int format)
|
||||||
|
@ -25,7 +25,7 @@ public:
|
|||||||
const u8* texture, size_t texture_size,
|
const u8* texture, size_t texture_size,
|
||||||
const u8* tlut, size_t tlut_size,
|
const u8* tlut, size_t tlut_size,
|
||||||
u32 width, u32 height,
|
u32 width, u32 height,
|
||||||
int format
|
int format, bool dump = false
|
||||||
);
|
);
|
||||||
|
|
||||||
~HiresTexture();
|
~HiresTexture();
|
||||||
|
@ -476,7 +476,7 @@ TextureCache::TCacheEntryBase* TextureCache::Load(const u32 stage)
|
|||||||
src_data, texture_size,
|
src_data, texture_size,
|
||||||
&texMem[tlutaddr], palette_size,
|
&texMem[tlutaddr], palette_size,
|
||||||
width, height,
|
width, height,
|
||||||
texformat
|
texformat, true
|
||||||
);
|
);
|
||||||
DumpTexture(entry, basename, 0);
|
DumpTexture(entry, basename, 0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user