本文整理汇总了C++中ITexture::Download方法的典型用法代码示例。如果您正苦于以下问题:C++ ITexture::Download方法的具体用法?C++ ITexture::Download怎么用?C++ ITexture::Download使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITexture
的用法示例。
在下文中一共展示了ITexture::Download方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CC_Generate_Density_Tex
void CC_Generate_Density_Tex( void )
{
CMaterialReference DensityMaterial("dev/density", TEXTURE_GROUP_CLIENT_EFFECTS);
ITexture *pTex = materials->FindTexture("dev/density", TEXTURE_GROUP_CLIENT_EFFECTS, true);
Msg("density_generate_tex: Generating density texture\n");
if( pTex )
pTex->Download();
else
Msg("Texture not found\n");
DensityMaterial.Shutdown();
}
示例2: OnBind
//-----------------------------------------------------------------------------
// Called when the texture is bound...
//-----------------------------------------------------------------------------
void CCamoMaterialProxy::OnBind( C_BaseEntity *pEntity )
{
if( !m_pCamoTextureVar )
{
return;
}
m_pEnt = pEntity;
ITexture *pCamoTexture = m_pCamoTextureVar->GetTextureValue();
pCamoTexture->Download();
// Mark it so it doesn't get regenerated on task switch
m_pEnt = NULL;
}
示例3: OnBind
//-----------------------------------------------------------------------------
// Called when the texture is bound...
//-----------------------------------------------------------------------------
void CZZMaterialProxy::OnBind( C_BaseEntity *pEntity )
{
if( !m_pTextureVar )
{
return;
}
if(!m_pTextureVar->IsTexture()) // Make sure it is a texture
return;
//ITexture *pTexture = m_pTextureVar->GetTextureValue();
m_pTexture->Download();
// Mark it so it doesn't get regenerated on task switch
//m_pEnt = NULL;
}
示例4: OnFileChange
void CTextureSystem::OnFileChange( const char *pFilename, int context, CTextureSystem::EFileType eFileType )
{
// It requires the forward slashes later...
char fixedSlashes[MAX_PATH];
V_StrSubst( pFilename, "\\", "/", fixedSlashes, sizeof( fixedSlashes ) );
// Get rid of the extension.
if ( V_strlen( fixedSlashes ) < 5 )
{
Assert( false );
return;
}
fixedSlashes[ V_strlen( fixedSlashes ) - 4 ] = 0;
// Handle it based on what type of file we've got.
if ( eFileType == k_eFileTypeVMT )
{
IEditorTexture *pTex = FindActiveTexture( fixedSlashes, NULL, FALSE );
if ( pTex )
{
pTex->Reload( true );
}
else
{
EnumMaterial( fixedSlashes, context );
IEditorTexture *pTex = FindActiveTexture( fixedSlashes, NULL, FALSE );
if ( pTex )
{
GetMainWnd()->m_TextureBar.NotifyNewMaterial( pTex );
GetMainWnd()->GetFaceEditSheet()->NotifyNewMaterial( pTex );
}
}
}
else if ( eFileType == k_eFileTypeVTF )
{
// Whether a VTF was added, removed, or modified, we do the same thing.. refresh it and any materials that reference it.
ITexture *pTexture = materials->FindTexture( fixedSlashes, TEXTURE_GROUP_UNACCOUNTED, false );
if ( pTexture )
{
pTexture->Download( NULL );
ReloadMaterialsUsingTexture( pTexture );
}
}
}
示例5: OnBind
void CPlayerTextureProxy::OnBind( C_BaseEntity *pEnt )
{
// Bail if no base variable
if ( !m_pBaseTextureVar )
return;
CTeamKitInfo *pKitInfo;
const char *teamFolder;
const char *kitFolder;
int skinIndex;
int shirtNumber;
const char *shirtName;
bool isKeeper;
ITexture *pDetailTexture;
CProceduralRegenerator **pProcReg;
if (dynamic_cast<C_SDKPlayer *>(pEnt))
{
C_SDKPlayer *pPl = dynamic_cast<C_SDKPlayer *>(pEnt);
C_Team *pTeam = GetGlobalTeam(g_PR->GetTeam(pPl->index));
teamFolder = pTeam->GetFolderName();
kitFolder = pTeam->GetKitFolderName();
pKitInfo = pTeam->GetKitInfo();
skinIndex = g_PR->GetSkinIndex(pPl->index);
shirtNumber = g_PR->GetShirtNumber(pPl->index);
shirtName = g_PR->GetShirtName(pPl->index);
isKeeper = g_PR->GetTeamPosType(pPl->index) == POS_GK;
int teamIndex = pTeam->GetTeamNumber() - TEAM_A;
int posIndex = g_PR->GetTeamPosIndex(pPl->index);
pDetailTexture = materials->FindTexture(VarArgs("models/player/default/detail_%d_%d", teamIndex, posIndex), NULL, true);
pProcReg = &m_pTextureRegen[teamIndex][posIndex];
}
else if (dynamic_cast<C_ReplayPlayer *>(pEnt))
{
C_ReplayPlayer *pReplayPl = dynamic_cast<C_ReplayPlayer *>(pEnt);
C_Team *pTeam = GetGlobalTeam(pReplayPl->m_nTeamNumber);
teamFolder = pTeam->GetFolderName();
kitFolder = pTeam->GetKitFolderName();
pKitInfo = pTeam->GetKitInfo();
skinIndex = pReplayPl->m_nSkinIndex;
shirtNumber = pReplayPl->m_nShirtNumber;
shirtName = pReplayPl->m_szShirtName;
isKeeper = pReplayPl->m_bIsKeeper;
int teamIndex = pReplayPl->m_nTeamNumber - TEAM_A;
int posIndex = pReplayPl->m_nTeamPosIndex;
pDetailTexture = materials->FindTexture(VarArgs("models/player/default/detail_%d_%d", teamIndex, posIndex), NULL, true);
pProcReg = &m_pTextureRegen[teamIndex][posIndex];
}
else if (dynamic_cast<C_BaseAnimatingOverlay *>(pEnt))
{
C_BaseAnimatingOverlay *pPlayerModelPreview = dynamic_cast<C_BaseAnimatingOverlay *>(pEnt);
CAppearanceSettingPanel *pPanel = (CAppearanceSettingPanel *)iosOptionsMenu->GetPanel()->GetSettingPanel(SETTING_PANEL_APPEARANCE);
pPanel->GetPlayerTeamInfo(&teamFolder, &kitFolder);
pKitInfo = CTeamInfo::FindTeamByKitName(VarArgs("%s/%s", teamFolder, kitFolder));
skinIndex = pPanel->GetPlayerSkinIndex();
shirtNumber = pPanel->GetPlayerOutfieldShirtNumber();
shirtName = pPanel->GetPlayerShirtName();
isKeeper = false;
pDetailTexture = materials->FindTexture("models/player/default/detail_preview", NULL, true);
pProcReg = &m_pPreviewTextureRegen;
}
else
{
return;
}
if (!Q_strcmp(m_szTextureType, "shirt") || !Q_strcmp(m_szTextureType, "keepershirt"))
{
if (!(*pProcReg))
*pProcReg = new CProceduralRegenerator();
pDetailTexture->SetTextureRegenerator(*pProcReg);
m_pDetailTextureVar->SetTextureValue(pDetailTexture);
bool needsUpdate;
if (isKeeper)
needsUpdate = (*pProcReg)->SetPlayerInfo(shirtName, shirtNumber, pKitInfo->m_KeeperShirtNameColor, pKitInfo->m_nKeeperShirtNameOffset, pKitInfo->m_KeeperShirtNumberColor, pKitInfo->m_nKeeperShirtNumberOffset, true, pKitInfo->m_pFontAtlas);
else
needsUpdate = (*pProcReg)->SetPlayerInfo(shirtName, shirtNumber, pKitInfo->m_OutfieldShirtNameColor, pKitInfo->m_nOutfieldShirtNameOffset, pKitInfo->m_OutfieldShirtNumberColor, pKitInfo->m_nOutfieldShirtNumberOffset, false, pKitInfo->m_pFontAtlas);
if (needsUpdate)
pDetailTexture->Download();
}
char texture[128];
if (Q_stricmp(m_szTextureType, "shirt") == 0)
//.........这里部分代码省略.........