mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-22 07:53:52 +00:00
Handle "sound:" animation events
This commit is contained in:
parent
3c32385e17
commit
46728ab27f
1 changed files with 6 additions and 4 deletions
|
@ -21,6 +21,9 @@
|
|||
|
||||
#include "../mwrender/animation.hpp"
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/soundmanager.hpp"
|
||||
|
||||
#include "../mwworld/class.hpp"
|
||||
|
||||
namespace MWMechanics
|
||||
|
@ -56,11 +59,10 @@ CharacterController::CharacterController(const CharacterController &rhs)
|
|||
|
||||
void CharacterController::markerEvent(const std::string &evt)
|
||||
{
|
||||
std::string::size_type gp = evt.find(':');
|
||||
if(gp >= evt.length()-2)
|
||||
if(evt.compare(0, 6, "sound:") == 0)
|
||||
{
|
||||
std::cerr<< "Unexpected animation marker: \""<<evt<<"\"" <<std::endl;
|
||||
return;
|
||||
MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
|
||||
sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue