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


C++ ITexture::Release方法代码示例

本文整理汇总了C++中ITexture::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ ITexture::Release方法的具体用法?C++ ITexture::Release怎么用?C++ ITexture::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ITexture的用法示例。


在下文中一共展示了ITexture::Release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ProcessEvent

	virtual void ProcessEvent( EFlowEvent event, SActivationInfo *pActInfo )
	{
		switch (event)
		{
		case eFE_Initialize:
			if (pActInfo->pGraph->GetGraphEntity(0) == 0 && pActInfo->pGraph->GetGraphEntity(1) == 0)
				m_nFaderOffset = MFX_FADER_OFFSET;
			else
				m_nFaderOffset = GAME_FADER_OFFSET;

			if (gEnv->pCryPak->GetLvlResStatus())
			{
				const string& texName = GetPortString(pActInfo, EIP_TextureName);
				if (texName.empty() == false)
				{
					ITexture* pTexture = CHUDFader::LoadTexture(texName.c_str());
					if (pTexture)
						pTexture->Release();
				}
			}

			if (m_bNeedFaderStop)
			{
				StopFader(pActInfo);
				m_bPlaying = false;
				m_bNeedFaderStop = false;
				m_ticket = 0;
			}
			pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
			break;
		case eFE_Activate:
			{
				if (IsPortActive(pActInfo, EIP_FadeIn))
				{
					StopFader(pActInfo);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
					m_direction = -1;
					StartFader(pActInfo);
					m_bPlaying = true;
					m_bNeedFaderStop = true;
					m_postSerializeTrigger = 0;
				}
				if (IsPortActive(pActInfo, EIP_FadeOut))
				{
					StopFader(pActInfo);
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, true);
					m_direction = 1;
					StartFader(pActInfo);
					m_bPlaying = true;
					m_bNeedFaderStop = true;
					m_postSerializeTrigger = 0;
				}
			}
			break;
		case eFE_Update:
			{
				if (m_postSerializeTrigger)
				{
					ActivateOutput(pActInfo, m_postSerializeTrigger < 0 ? EOP_FadedIn : EOP_FadedOut, true);
					m_postSerializeTrigger = 0;
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);
					return;
				}

				CHUDFader* pFader = GetFader(pActInfo);
				if (pFader == 0 || m_bPlaying == false)
				{
					pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);	
					m_bPlaying = false;
					m_ticket = 0;
					return;
				}

				ColorF col = pFader->GetCurrentColor();
				Vec3 vCol (col.r,col.g,col.b);
				ActivateOutput(pActInfo, EOP_FadeColor, vCol);
				if (pFader->IsPlaying(m_ticket) == false)
				{
					if (m_direction < 0.0f)
					{
						ActivateOutput(pActInfo, EOP_FadedIn, true);
						pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);					
						m_bNeedFaderStop = false; 
					}
					else
					{
						ActivateOutput(pActInfo, EOP_FadedOut, true);
						pActInfo->pGraph->SetRegularlyUpdated(pActInfo->myID, false);	
						m_bNeedFaderStop = true; // but needs a stop, if we're faded out (fader is still active then!)
					}
					m_bPlaying = false;
					m_ticket = 0;
				}
			}
			break;
		}
	}
开发者ID:aronarts,项目名称:FireNET,代码行数:97,代码来源:FlowFadeNode.cpp

示例2: VOnInit

void GameProcess::VOnInit(void)
{
    //pSkillInterface =  new SkillInterface();
    
	DialogueInterface* pDialogue = new DialogueInterface( NULL, "DialogueInterface.xml", "Dialogue.xml" );
	pDialogue->SetName( "Dialogue" );
	BaseApplication::Get()->AttachProcess( pDialogue );
	pDialogue->Release();

    Entity* pEntity = Game::CreateEntity();
    ThirdPersonCamera* pCamera = new ThirdPersonCamera();
    pCamera->SetDistanceMax( 50.0f );
    m_pCamera = pCamera;
    pEntity->AddComponent( pCamera );
    pCamera->SetClearColor( ColorF::BLACK );
    pCamera->Release();
    pCamera->SetPosition( Vector4( 2000.0f, 30.0f, 2000.0f ) );
    pCamera->SetDirection( Vector4( 0.0f, 0.0f, 1.0f ) );
    pCamera->Start();
    
    pEntity = Game::CreateEntity();
    
    
    int iWorldSize = 512;
    m_IslandData.Generate( iWorldSize, iWorldSize );
    HeightmapComponent* pComponent = new HeightmapComponent( iWorldSize, iWorldSize, m_IslandData );
    m_pHeightMapEntity = pComponent;
    //pComponent->SetTexture( "sketch.png" );
    m_IslandData.GenerateBiomes();
    ColorF* pColors = new ColorF[ iWorldSize * iWorldSize ];
    for ( int i = 0; i < iWorldSize; ++i )
    {
        for ( int j = 0; j < iWorldSize; ++j )
        {
            ColorF color;
            IslandData::Biome eBiome = m_IslandData.GetBiome( i, j );
            
            if ( eBiome == IslandData::SeaWater )
            {
                color = Color::BLUE;
            }
            
            else if ( eBiome == IslandData::FreshWater )
            {
                color = Color( 0, 191, 255 );
            }
            
            else if ( eBiome == IslandData::Grassland )
            {
                color = Color( 195, 211, 170, 255 );
            }
            
            else if ( eBiome == IslandData::Snow )
            {
                color = Color::WHITE;
            }
            
            else if ( eBiome == IslandData::Bare )
            {
                color = Color( 200, 200, 200, 255 );
            }
            
            else if ( eBiome == IslandData::Scorched )
            {
                color = Color::GREY;
            }
            
            else if ( eBiome == IslandData::Tundra )
            {
                color = Color( 220, 220, 186, 255 );
            }
            
            else if ( eBiome == IslandData::Taiga )
            {
                color = Color( 203, 211, 186, 255 );
            }
            
            else if ( eBiome == IslandData::Shrubland )
            {
                color = Color( 195, 203, 186, 255 );
            }
            
            else if ( eBiome == IslandData::TemperateDesert )
            {
                color = Color( 227, 231, 201, 255 );
            }
            
            else if ( eBiome == IslandData::TemperateRainForest )
            {
                color = Color( 163, 195, 167, 255 );
            }
            
            else if ( eBiome == IslandData::TemperateDecidousForest )
            {
                color = Color( 180, 200, 168, 255 );
            }
            
            else if ( eBiome == IslandData::TropicalRainForest )
            {
                color = Color( 155, 186, 168, 255 );
//.........这里部分代码省略.........
开发者ID:Lunarsong,项目名称:UndeadRising,代码行数:101,代码来源:GameProcess.cpp


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