1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-22 10:53:54 +00:00

Handle "sound:" animation events

This commit is contained in:
Chris Robinson 2013-01-16 15:52:03 -08:00
parent 3c32385e17
commit 46728ab27f

View file

@ -21,6 +21,9 @@
#include "../mwrender/animation.hpp" #include "../mwrender/animation.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/class.hpp" #include "../mwworld/class.hpp"
namespace MWMechanics namespace MWMechanics
@ -56,11 +59,10 @@ CharacterController::CharacterController(const CharacterController &rhs)
void CharacterController::markerEvent(const std::string &evt) void CharacterController::markerEvent(const std::string &evt)
{ {
std::string::size_type gp = evt.find(':'); if(evt.compare(0, 6, "sound:") == 0)
if(gp >= evt.length()-2)
{ {
std::cerr<< "Unexpected animation marker: \""<<evt<<"\"" <<std::endl; MWBase::SoundManager *sndMgr = MWBase::Environment::get().getSoundManager();
return; sndMgr->playSound3D(mPtr, evt.substr(7), 1.0f, 1.0f);
} }
} }