本文整理汇总了C++中TCacheEntryBase::SetHiresParams方法的典型用法代码示例。如果您正苦于以下问题:C++ TCacheEntryBase::SetHiresParams方法的具体用法?C++ TCacheEntryBase::SetHiresParams怎么用?C++ TCacheEntryBase::SetHiresParams使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCacheEntryBase
的用法示例。
在下文中一共展示了TCacheEntryBase::SetHiresParams方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load
//.........这里部分代码省略.........
if (pcfmt == PC_TEX_FMT_NONE)
{
pcfmt = g_texture_cache->GetNativeTextureFormat(texformat, (TlutFormat)tlutfmt, width, height);
}
// how many levels the allocated texture shall have
const u32 texLevels = hires_tex ? hires_tex->m_levels : tex_levels;
// create the entry/texture
TCacheEntryConfig config;
config.width = width;
config.height = height;
config.levels = texLevels;
config.pcformat = pcfmt;
config.materialmap = hires_tex && hires_tex->m_nrm_levels && g_ActiveConfig.HiresMaterialMapsEnabled();
const bool use_scaling = (g_ActiveConfig.iTexScalingType > 0) && !hires_tex && (width < 384) && (height < 384);
if (use_scaling)
{
config.width *= g_ActiveConfig.iTexScalingFactor;
config.height *= g_ActiveConfig.iTexScalingFactor;
config.pcformat = PC_TEX_FMT_RGBA32;
}
TCacheEntryBase* entry = AllocateTexture(config);
GFX_DEBUGGER_PAUSE_AT(NEXT_NEW_TEXTURE, true);
iter = textures_by_address.emplace((u64)address, entry);
if (g_ActiveConfig.iSafeTextureCache_ColorSamples == 0 ||
std::max(texture_size, palette_size) <= (u32)g_ActiveConfig.iSafeTextureCache_ColorSamples * 8)
{
entry->textures_by_hash_iter = textures_by_hash.emplace(full_hash, entry);
}
entry->SetGeneralParameters(address, texture_size, full_format);
entry->SetDimensions(nativeW, nativeH, tex_levels);
entry->SetHiresParams(!!hires_tex, basename, use_scaling);
entry->SetHashes(full_hash, tex_hash);
entry->is_efb_copy = false;
// load texture
if (hires_tex)
{
entry->Load(TextureCacheBase::temp, width, height, expandedWidth, 0);
u8 *Bufferptr = TextureCacheBase::temp;
Bufferptr += TextureUtil::GetTextureSizeInBytes(width, height, pcfmt);
for (u32 level = 1; level != texLevels; ++level)
{
u32 mip_width = TextureUtil::CalculateLevelSize(width, level);
u32 mip_height = TextureUtil::CalculateLevelSize(height, level);
entry->Load(Bufferptr, mip_width, mip_height, mip_width, level);
Bufferptr += TextureUtil::GetTextureSizeInBytes(mip_width, mip_height, pcfmt);
}
if (config.materialmap)
{
entry->LoadMaterialMap(Bufferptr, width, height, 0);
Bufferptr += TextureUtil::GetTextureSizeInBytes(width, height, pcfmt);
for (u32 level = 1; level != texLevels; ++level)
{
u32 mip_width = TextureUtil::CalculateLevelSize(width, level);
u32 mip_height = TextureUtil::CalculateLevelSize(height, level);
entry->LoadMaterialMap(Bufferptr, mip_width, mip_height, level);
Bufferptr += TextureUtil::GetTextureSizeInBytes(mip_width, mip_height, pcfmt);
}
}
}
else
{
if (!(texformat == GX_TF_RGBA8 && from_tmem))