1
0
Fork 0
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:
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 "../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);
}
}