mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-09 12:22:34 +01:00
Implemented playMusic method
This commit is contained in:
parent
6a14dc3e02
commit
861dbf0c2a
@ -49,6 +49,7 @@ public:
|
||||
~MADStream();
|
||||
|
||||
bool openFromFile(const std::string& loc);
|
||||
void play();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -25,6 +25,7 @@ public:
|
||||
bool playBackground(const std::string& fileName);
|
||||
|
||||
bool loadMusic(const std::string& name, const std::string& fileName);
|
||||
void playMusic(const std::string& name);
|
||||
|
||||
void pause(bool p);
|
||||
|
||||
|
@ -148,3 +148,8 @@ bool MADStream::openFromFile(const std::string& loc)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void MADStream::play()
|
||||
{
|
||||
alCheck(alSourcePlay(alSource));
|
||||
}
|
||||
|
@ -132,6 +132,10 @@ bool SoundManager::loadMusic(const std::string& name, const std::string& fileNam
|
||||
musics.emplace(std::piecewise_construct, std::forward_as_tuple(name), std::forward_as_tuple());
|
||||
return musics[name].openFromFile(fileName);
|
||||
}
|
||||
void SoundManager::playMusic(const std::string& name)
|
||||
{
|
||||
musics[name].play();
|
||||
}
|
||||
|
||||
void SoundManager::pause(bool p)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user