1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00

Implemented playSound method

This commit is contained in:
Timmy Sjöstedt 2016-05-24 22:33:27 +02:00
parent 91c1374b89
commit 59a7189ab3
2 changed files with 7 additions and 1 deletions

View File

@ -16,7 +16,7 @@ public:
bool loadSound(const std::string& name, const std::string& fileName);
bool isLoaded(const std::string& name);
void playSound(const std::string& fileName);
void playSound(const std::string& name);
bool playBackground(const std::string& fileName);

View File

@ -99,6 +99,12 @@ bool SoundManager::isLoaded(const std::string& name)
return false;
}
void SoundManager::playSound(const std::string& name)
{
if (sounds.find(name) != sounds.end()) {
alSourcePlay(sounds[name].buffer.source);
}
}
bool SoundManager::playBackground(const std::string& fileName)
{