本文整理汇总了C++中CTexture::ReplaceTexture方法的典型用法代码示例。如果您正苦于以下问题:C++ CTexture::ReplaceTexture方法的具体用法?C++ CTexture::ReplaceTexture怎么用?C++ CTexture::ReplaceTexture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CTexture
的用法示例。
在下文中一共展示了CTexture::ReplaceTexture方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceTexture
bool CTexDict::ReplaceTexture(const char* p_src_texture_name, const char* p_dst_texture_name)
{
CTexture* pTexture = get_source_texture( p_src_texture_name );
if ( pTexture )
{
Mem::Manager::sHandle().PushContext(Mem::Manager::sHandle().TopDownHeap());
#ifdef __NOPT_ASSERT__
if ( Script::GetInt( CRCD(0x2a648514,"cas_artist"), false ) )
{
Dbg_Message( "Replacing %s with %s here", p_src_texture_name, p_dst_texture_name );
}
#endif
CTexture *p_new_texture = LoadTexture(p_dst_texture_name, false, false);
Dbg_MsgAssert(p_new_texture, ("Can't find replacement texture %s", p_dst_texture_name));
bool result = pTexture->ReplaceTexture( p_new_texture );
Dbg_MsgAssert(result, ("Can't replace texture %s with %s", p_src_texture_name, p_dst_texture_name));
// We're done with the new texture, get rid of it
UnloadTexture(p_new_texture);
Mem::Manager::sHandle().PopContext();
return result;
}
else
{
// GJ: The texture checksum lookup table is only
// available for sprite tex dicts, not for CAS
// parts, so I've commented out the following for now...
// if ( Script::GetInt( "cas_artist", false ) )
// {
// Dbg_Message( "Couldn't find %s (%08x) in order to replace texture %s", p_src_texture_name, src_checksum, p_dst_texture_name );
// }
Dbg_Assert( mp_texture_lookup );
/*
// For debugging...
if (mp_texture_lookup)
{
mp_texture_lookup->IterateStart();
CTexture *p_texture;
int count = 0;
while ((p_texture = mp_texture_lookup->IterateNext()))
{
Dbg_Message("Found Checksum #%d %08x", count, p_texture->GetChecksum());
count++;
}
Dbg_Assert( count );
}
*/
return false;
}
}