当前位置: 首页>>代码示例>>C++>>正文


C++ TCacheEntryBase::SetHiresParams方法代码示例

本文整理汇总了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))
开发者ID:gamax92,项目名称:Ishiiruka,代码行数:67,代码来源:TextureCacheBase.cpp


注:本文中的TCacheEntryBase::SetHiresParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。