mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-14 01:19:59 +00:00
Handle "sound:" animation events
This commit is contained in:
parent
3c32385e17
commit
46728ab27f
@ -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…
x
Reference in New Issue
Block a user