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


C++ ISound::drop方法代码示例

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


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

示例1: switch

void AudioDevice::playSound2D(const std::string& soundfile, SoundType type) {
    if ((m_engine != NULL) && ! soundfile.empty()) {
        FileSystem::markFileUsed(soundfile);

        const bool loop = (type == MUSIC);
        ISound* sound = m_engine->play2D(soundfile.c_str(), loop, START_PAUSED, RETURN_REFERENCE);

        switch (type) {
        case MUSIC:
            sound->setVolume(m_musicVolume * MUSIC_VOLUME_CONSTANT);
            if (m_music) {
                // Stop the previous music and replace it with this
                m_music->stop();
                m_music->drop();
            }
            m_music = sound;
            sound->setIsPaused(false);
            break;

        case UI:
            sound->setVolume(m_uiVolume * UI_VOLUME_CONSTANT);
            sound->setIsPaused(false);
            sound->drop();
            break;

        case EFFECT:
            sound->setVolume(m_effectVolume * EFFECT_VOLUME_CONSTANT);
            sound->setPlaybackSpeed(speedAdjust(m_timeScaleAtListener));
            sound->setIsPaused(false);
            sound->drop();
            break;
        }
    }
}
开发者ID:jackpoz,项目名称:G3D-backup,代码行数:34,代码来源:AudioDevice.cpp

示例2: applyRocketsMoves

void Game::applyRocketsMoves()
{
	// Fly thier ways
	rockets->fly(timer.delta);
	effects->drawRocketUpEffect(timer.delta);
	effects->drawRocketDownEffect(timer.delta);
	
	// Getting all nodes rockets hited & indecies for rockets
	array<u32> *Findecies, *Eindecies;
	Findecies = new array<u32>();
	Eindecies = new array<u32>();
	array<ISceneNode *> nodes = rockets->checkRockets(Findecies, Eindecies);
	effects->deleteRocketUp(Findecies);
	effects->deleteRocketDown(Eindecies);

	for (u32 i = 0; i < nodes.size(); i++)
	{
		vector3df pos = IDLE_VECTOR;

		// Checking fot fighter damage and death
		if (nodes[i] == fighter->getNode())
		{
			fighter->damage(FIGHTER_DAMAGE);
			if (fighter->isDead())
			{
				if (soundPlay)
				{
					ISound *bang = sound->play2D("sounds/bang.wav", false, true);
					bang->setVolume(0.1f);
					bang->setIsPaused(false);
					bang->drop();
				}
				state = OVER;
				engine->hideCursor(false);
				drop();
				gui->lose(engine->getGUI(), texManager);
				return;
			}
		}

		// Checking for enemies damage and death
		else if (enemies->checkNode(nodes[i], engine->getManager(), &score, sound, soundPlay, &pos))
		{
			state = OVER;
			engine->hideCursor(false);
			drop();
			gui->win(engine->getGUI(), texManager);
			return;
		}

		if (pos != vector3df(IDLE_VECTOR))
			effects->addDeath(engine->getManager(), texManager->getEffectsTexture()[0], pos);
	}

	// Refrashing score and health
	gui->setScore(score);
	if (!fighter->isDead())
		gui->setHealth(fighter->getHealth());
}
开发者ID:getNick,项目名称:test,代码行数:59,代码来源:Game.cpp

示例3: main


//.........这里部分代码省略.........
						pTextEnemiesKilled->setVisible ( true );
						pTextRocketsLaunched->setVisible ( true );
					}
				}
				
				// If exiting make all invisible //
				if ( Global::myEventReceiver->IsKeyDown ( irr::KEY_ESCAPE ) && isEnd )
				{
					context.isInGame = false;
					isLevelFinished = true;
					isEnd = false;

					pTextVictory->setText ( L"" );
					pTextToExit->setText ( L"" );
					pTextEnemiesKilled->setText ( L"" );
					pTextRocketsLaunched->setText ( L"" );

					pTextVictory->setVisible ( false );
					pTextToExit->setVisible ( false );
					pTextEnemiesKilled->setVisible ( false );
					pTextRocketsLaunched->setVisible ( false );
						
					pFighter->getMeshSceneNode ()->setPosition ( core::vector3df ( 0, downBorder, 0 ) );

					for ( int i = 0; i < rockets.getArraySize (); i++ )
						rockets.getRockets()->at ( i )->getMeshSceneNode ()->setPosition ( 
							core::vector3df ( 0, upBorder + 100, 0 ) );

					// Pausing thrusters sound //
					if(pSoundThruster)
					{
						pSoundThruster->stop ();

						pSoundThruster->drop ();
						pSoundThruster = nullptr;
					}

					isThrusterSoundActive = false;
					
					continue;
				}

				if ( Global::myEventReceiver->IsKeyDown ( irr::KEY_ESCAPE ) && ! isEnd )
				{
					context.isInGame = false;

#if !defined(_DEBUG)
					// Pausing thrusters sound //
					pSoundThruster->stop ();

					pSoundThruster->drop ();
					pSoundThruster = nullptr;

					isThrusterSoundActive = false;
#endif
				}

				float currentSpeed = pFighter->getSpeed (); // getting the cuurrent speed of the fighter
		
				// Ghange!!!
				core::vector3df nodePosition = pFighter->getMeshSceneNode ()->getPosition (); // getting fighter position

				// Side movement //
				if ( ! isEnd )
				{
					float deltaTime = (f32)timer.getDeltaTime() / 100;
开发者ID:ValdamireGido,项目名称:spacebattle,代码行数:67,代码来源:main.cpp


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