mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 21:06:43 +00:00
Handle the "sound" events in runAnimation
This commit is contained in:
parent
df8889dcc4
commit
d77d035d3a
2 changed files with 15 additions and 14 deletions
|
@ -24,7 +24,6 @@
|
||||||
#include "../mwrender/animation.hpp"
|
#include "../mwrender/animation.hpp"
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
#include "../mwbase/soundmanager.hpp"
|
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
@ -134,19 +133,6 @@ CharacterController::~CharacterController()
|
||||||
|
|
||||||
void CharacterController::markerEvent(float time, const std::string &evt)
|
void CharacterController::markerEvent(float time, const std::string &evt)
|
||||||
{
|
{
|
||||||
if(evt.compare(0, 7, "sound: ") == 0)
|
|
||||||
{
|
|
||||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
|
||||||
sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(evt.compare(0, 10, "soundgen: ") == 0)
|
|
||||||
{
|
|
||||||
// FIXME: Lookup the SoundGen (SNDG) for the specified sound that corresponds
|
|
||||||
// to this actor type
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(evt == "stop")
|
if(evt == "stop")
|
||||||
{
|
{
|
||||||
if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1])
|
if(mAnimQueue.size() >= 2 && mAnimQueue[0] == mAnimQueue[1])
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <OgreSceneManager.h>
|
#include <OgreSceneManager.h>
|
||||||
|
|
||||||
#include "../mwbase/environment.hpp"
|
#include "../mwbase/environment.hpp"
|
||||||
|
#include "../mwbase/soundmanager.hpp"
|
||||||
#include "../mwbase/world.hpp"
|
#include "../mwbase/world.hpp"
|
||||||
|
|
||||||
#include "../mwmechanics/character.hpp"
|
#include "../mwmechanics/character.hpp"
|
||||||
|
@ -406,6 +407,20 @@ Ogre::Vector3 Animation::runAnimation(float timepassed)
|
||||||
/* Do nothing */
|
/* Do nothing */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(evt.compare(0, 7, "sound: ") == 0)
|
||||||
|
{
|
||||||
|
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||||
|
sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(evt.compare(0, 10, "soundgen: ") == 0)
|
||||||
|
{
|
||||||
|
// FIXME: Lookup the SoundGen (SNDG) for the specified sound that corresponds
|
||||||
|
// to this actor type
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if(evt == "loop stop")
|
if(evt == "loop stop")
|
||||||
{
|
{
|
||||||
if(mLooping)
|
if(mLooping)
|
||||||
|
|
Loading…
Reference in a new issue