1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-10 06:39:49 +00:00
OpenMW/apps/openmw/mwworld/action.cpp

37 lines
838 B
C++
Raw Normal View History

2012-07-27 10:00:10 +00:00
#include "action.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/soundmanager.hpp"
2012-07-27 10:00:10 +00:00
MWWorld::Action::Action() {}
MWWorld::Action::~Action() {}
void MWWorld::Action::execute (const Ptr& actor)
{
if (!mSoundId.empty())
{
if (onActor)
{
std::cout << "Douglas - Som Normal" << std::endl;
MWBase::Environment::get().getSoundManager()->playSound(mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
else
{
std::cout << "Douglas - Som 3D" << std::endl;
MWBase::Environment::get().getSoundManager()->playSound3D (actor, mSoundId, 1.0, 1.0,
MWBase::SoundManager::Play_NoTrack);
}
}
2012-07-27 10:00:10 +00:00
executeImp (actor);
}
void MWWorld::Action::setSound (const std::string& id, const bool onActorValue)
{
mSoundId = id;
onActor = onActorValue;
}