本文整理汇总了C++中IsErrorTexture函数的典型用法代码示例。如果您正苦于以下问题:C++ IsErrorTexture函数的具体用法?C++ IsErrorTexture怎么用?C++ IsErrorTexture使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsErrorTexture函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCookieStringReceived
void CLightingManager::OnCookieStringReceived( const char *pszString, const int &index )
{
ITexture *pTexCookie = materials->FindTexture( pszString, TEXTURE_GROUP_OTHER );
if ( IsErrorTexture( pTexCookie ) )
return;
}
示例2: Init
bool CPlayerTextureProxy::Init( IMaterial *pMaterial, KeyValues *pKeyValues )
{
#ifdef ALLPROXIESFAIL
return false;
#endif
m_pMaterial = pMaterial;
// Check for $basetexture variable
m_pBaseTextureVar = pMaterial->FindVar( "$basetexture", NULL );
if ( !m_pBaseTextureVar )
return false;
// Set default texture and make sure its not an error texture
m_pTexture = m_pBaseTextureVar->GetTextureValue();
if ( IsErrorTexture( m_pTexture ) )
return false;
Q_strncpy(m_szTextureType, pKeyValues->GetString("type"), sizeof(m_szTextureType));
if (!Q_strcmp(m_szTextureType, "shirt") || !Q_strcmp(m_szTextureType, "keepershirt"))
{
m_pDetailTextureVar = pMaterial->FindVar("$detail", NULL);
//m_pTextureRegen = new CProceduralRegenerator();
}
return true;
}
示例3: Assert
ITexture *GetPlayerModelTexture( void )
{
if ( !s_pPlayerModelTexture )
{
s_pPlayerModelTexture.Init( materials->FindTexture( "_rt_playermodel", TEXTURE_GROUP_RENDER_TARGET ) );
Assert( !IsErrorTexture( s_pPlayerModelTexture ) );
AddReleaseFunc();
}
return s_pPlayerModelTexture;
}
示例4: Assert
ITexture *GetScopeTexture( void )
{
if ( !s_pScopeTexture )
{
s_pScopeTexture.Init( materials->FindTexture( "_rt_Scope", TEXTURE_GROUP_RENDER_TARGET ) );
Assert( !IsErrorTexture( s_pScopeTexture ) );
AddReleaseFunc();
}
return s_pScopeTexture;
}
示例5: Assert
ITexture *GetPowerOfTwoFrameBufferTexture( void )
{
if ( !s_pPowerOfTwoFrameBufferTexture )
{
s_pPowerOfTwoFrameBufferTexture.Init( materials->FindTexture( "_rt_PowerOfTwoFB", TEXTURE_GROUP_RENDER_TARGET ) );
Assert( !IsErrorTexture( s_pPowerOfTwoFrameBufferTexture ) );
AddReleaseFunc();
}
return s_pPowerOfTwoFrameBufferTexture;
}
示例6: TE_PlayerDecal
//-----------------------------------------------------------------------------
// Purpose:
// Input : filter -
// delay -
// pos -
// player -
// entity -
//-----------------------------------------------------------------------------
void TE_PlayerDecal( IRecipientFilter& filter, float delay,
const Vector* pos, int player, int entity )
{
if ( cl_playerspraydisable.GetBool() )
return;
// No valid target?
C_BaseEntity *ent = cl_entitylist->GetEnt( entity );
if ( !ent )
return;
// Find player logo for shooter
player_info_t info;
engine->GetPlayerInfo( player, &info );
// Make sure we've got the material for this player's logo
char texname[ 512 ];
IMaterial *logo = CreateTempMaterialForPlayerLogo( player, &info, texname, 512 );
if ( !logo )
return;
ITexture *texture = materials->FindTexture( texname, TEXTURE_GROUP_DECAL );
if ( IsErrorTexture( texture ) )
{
return; // not found
}
// Update the texture used by the material if need be.
bool bFound = false;
IMaterialVar *pMatVar = logo->FindVar( "$basetexture", &bFound );
if ( bFound && pMatVar )
{
if ( pMatVar->GetTextureValue() != texture )
{
pMatVar->SetTextureValue( texture );
logo->RefreshPreservingMaterialVars();
}
}
color32 rgbaColor = { 255, 255, 255, 255 };
effects->PlayerDecalShoot(
logo,
(void *)player,
entity,
ent->GetModel(),
ent->GetAbsOrigin(),
ent->GetAbsAngles(),
*pos,
0,
0,
rgbaColor );
}
示例7: GetTargetVar
void CHLSL_Solver_PP_RT::OnExecuteCode( const RunCodeContext &context )
{
CHLSL_Var *pT = GetTargetVar(0);
if ( IsErrorTexture( pT->GetTexture() ) )
pT->SetTexture( materials->FindTexture( m_szRTName, TEXTURE_GROUP_OTHER ) );
if ( context.IsUsingPreview() )
{
context.pRenderContext->PushRenderTargetAndViewport( pT->GetTexture() );
BlitRTRect( context );
context.pRenderContext->PopRenderTargetAndViewport();
}
}
示例8: GetRTManager
bool CDialog_RendertargetSettings::DoesRTExist( const char *name )
{
if ( !name || !*name )
return false;
ITexture *pTex = materials->FindTexture( name, TEXTURE_GROUP_OTHER, false );
RTDef *rt = GetRTManager()->FindRTByName( name, true );
if ( rt && rt->IsFlaggedForDeletion() )
return false;
return rt != NULL ||
!IsErrorTexture( pTex );
}
示例9: Init
bool CPlayerLogoProxy::Init( IMaterial *pMaterial, KeyValues *pKeyValues )
{
bool found = false;
m_pBaseTextureVar = pMaterial->FindVar( "$basetexture", &found );
if ( !found )
return false;
m_pDefaultTexture = materials->FindTexture( DEFAULT_DECAL_NAME, TEXTURE_GROUP_DECAL );
if ( IsErrorTexture( m_pDefaultTexture ) )
return false;
m_pDefaultTexture->IncrementReferenceCount();
return true;
}
示例10: sprintf
ITexture *GetFullFrameFrameBufferTexture( int textureIndex )
{
if ( !s_pFullFrameFrameBufferTexture[textureIndex] )
{
char name[256];
if( textureIndex != 0 )
{
sprintf( name, "_rt_FullFrameFB%d", textureIndex );
}
else
{
Q_strcpy( name, "_rt_FullFrameFB" );
}
s_pFullFrameFrameBufferTexture[textureIndex].Init( materials->FindTexture( name, TEXTURE_GROUP_RENDER_TARGET ) );
Assert( !IsErrorTexture( s_pFullFrameFrameBufferTexture[textureIndex] ) );
AddReleaseFunc();
}
return s_pFullFrameFrameBufferTexture[textureIndex];
}
示例11: TE_PlayerDecal
//-----------------------------------------------------------------------------
// Purpose:
// Input : filter -
// delay -
// pos -
// player -
// entity -
//-----------------------------------------------------------------------------
void TE_PlayerDecal( IRecipientFilter& filter, float delay,
const Vector* pos, int player, int entity )
{
if ( cl_playerspraydisable.GetBool() )
return;
// No valid target?
C_BaseEntity *ent = cl_entitylist->GetEnt( entity );
if ( !ent )
return;
// Find player logo for shooter
player_info_t info;
engine->GetPlayerInfo( player, &info );
// Doesn't have a logo
if ( !info.customFiles[0] )
return;
IMaterial *logo = materials->FindMaterial( VarArgs("decals/playerlogo%2.2d", player), TEXTURE_GROUP_DECAL );
if ( IsErrorMaterial( logo ) )
return;
char logohex[ 16 ];
Q_binarytohex( (byte *)&info.customFiles[0], sizeof( info.customFiles[0] ), logohex, sizeof( logohex ) );
// See if logo has been downloaded.
char texname[ 512 ];
Q_snprintf( texname, sizeof( texname ), "temp/%s", logohex );
char fulltexname[ 512 ];
Q_snprintf( fulltexname, sizeof( fulltexname ), "materials/temp/%s.vtf", logohex );
if ( !filesystem->FileExists( fulltexname ) )
{
char custname[ 512 ];
Q_snprintf( custname, sizeof( custname ), "downloads/%s.dat", logohex );
// it may have been downloaded but not copied under materials folder
if ( !filesystem->FileExists( custname ) )
return; // not downloaded yet
// copy from download folder to materials/temp folder
// this is done since material system can access only materials/*.vtf files
if ( !engine->CopyFile( custname, fulltexname) )
return;
}
ITexture *texture = materials->FindTexture( texname, TEXTURE_GROUP_DECAL );
if ( IsErrorTexture( texture ) )
{
return; // not found
}
// Update the texture used by the material if need be.
bool bFound = false;
IMaterialVar *pMatVar = logo->FindVar( "$basetexture", &bFound );
if ( bFound && pMatVar )
{
if ( pMatVar->GetTextureValue() != texture )
{
pMatVar->SetTextureValue( texture );
logo->RefreshPreservingMaterialVars();
}
}
color32 rgbaColor = { 255, 255, 255, 255 };
effects->PlayerDecalShoot(
logo,
(void *)player,
entity,
ent->GetModel(),
ent->GetAbsOrigin(),
ent->GetAbsAngles(),
*pos,
0,
0,
rgbaColor );
}