void np::ConstructUpgradeSystem::process( ac::es::EntityPtr e )
{
	ConstructComponent* constructComponent = e->getComponent<ConstructComponent>();

	if ( constructComponent == NULL) return;
	if ( constructComponent->construct != NULL)
	{
		Construct* upgrade = constructComponent->construct->getUpgrade();

		//It's upgrade time, come on, grab your friends
		if(upgrade != NULL)
		{
			OgreFramework::getSingletonPtr()->m_pLog->logMessage( "Removing");

			objectFactory->removeConstruct(e, constructComponent->construct);

			OgreFramework::getSingletonPtr()->m_pLog->logMessage( "Adding");
			objectFactory->setConstruct(e, upgrade);

			OgreOggSound::OgreOggISound* sound = OgreOggSound::OgreOggSoundManager::getSingletonPtr()->getSound( "ConstructBuilt");
			sound->setPlayPosition( 0.0);
			sound->setPosition( e->getComponent<np::GraphicComponent>()->node->_getDerivedPosition());
			sound->play();
		}
	}
}
Пример #2
0
void MenuState::enter()
{
	//if ( loading->getParent() == sheet) sheet->removeChildWindow( loading);
	//sheet->invalidate( true);

	OgreFramework::getSingletonPtr()->m_pLog->logMessage("Entering MenuState...");

    m_pSceneMgr = OgreFramework::getSingletonPtr()->m_pRoot->createSceneManager(ST_GENERIC, "MenuSceneMgr");
	m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.7f, 0.7f, 0.7f));

	OgreOggSound::OgreOggSoundManager::getSingletonPtr()->setSceneManager( m_pSceneMgr);
	OgreOggSound::OgreOggISound* mainLoop = OgreOggSound::OgreOggSoundManager::getSingletonPtr()->createSound( "MenuLoop", "Sanctuary.ogg", true, true);
	mainLoop->disable3D( true);
	mainLoop->setVolume( 1.0);
	mainLoop->play();

    m_pCamera = m_pSceneMgr->createCamera("MenuCam");
    m_pCamera->setPosition(Vector3(0, 25, -50));
    m_pCamera->lookAt(Vector3(0, 0, 0));
    m_pCamera->setNearClipDistance(1);

    m_pCamera->setAspectRatio(Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualWidth()) /
        Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualHeight()));

    OgreFramework::getSingletonPtr()->m_pViewport->setCamera(m_pCamera);

    createScene();

	CEGUI::System::getSingleton().setGUISheet(sheet);
	CEGUI::System::getSingleton().signalRedraw();
}
Пример #3
0
void AudioManager::playGunshot()
{
    OgreOggSound::OgreOggISound* gunShot = mSoundMgr->createSound("gunShot" + std::to_string(static_cast<long long>(gunShots)), "laser.ogg", false, false, false, NULL, true);
    gunShot->markTemporary();
    gunShot->disable3D(true);
    gunShot->setVolume(0.3);
    gunShots++;
    gunShot->play(true);
}
Пример #4
0
void AudioManager::playMain()
{
    OgreOggSound::OgreOggISound* mainSong = mSoundMgr->createSound("background", "DST-TacticalSpace.ogg", true, true, false);
    mainSong->disable3D(true);
    mainSong->play();
}