mirror of
https://github.com/edubart/otclient.git
synced 2025-10-20 06:23:26 +02:00
Use boost::thread instead of std::thread
This commit is contained in:
@@ -96,9 +96,9 @@ void SoundManager::poll()
|
||||
|
||||
for(auto it = m_streamFiles.begin(); it != m_streamFiles.end();) {
|
||||
StreamSoundSourcePtr source = it->first;
|
||||
std::future<SoundFilePtr>& future = it->second;
|
||||
stdext::future<SoundFilePtr>& future = it->second;
|
||||
|
||||
if(std::is_ready(future)) {
|
||||
if(stdext::is_ready(future)) {
|
||||
SoundFilePtr sound = future.get();
|
||||
if(sound)
|
||||
source->setSoundFile(sound);
|
||||
@@ -264,7 +264,7 @@ SoundSourcePtr SoundManager::createSoundSource(const std::string& filename)
|
||||
source = combinedSource;
|
||||
#else
|
||||
StreamSoundSourcePtr streamSource(new StreamSoundSource);
|
||||
m_streamFiles[streamSource] = m_loadJobs [=]() -> SoundFilePtr {
|
||||
m_streamFiles[streamSource] = g_asyncDispatcher.schedule([=]() -> SoundFilePtr {
|
||||
try {
|
||||
return SoundFile::loadSoundFile(filename);
|
||||
} catch(std::exception& e) {
|
||||
|
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "declarations.h"
|
||||
#include "soundchannel.h"
|
||||
#include <framework/stdext/thread.h>
|
||||
|
||||
//@bindsingleton g_sounds
|
||||
class SoundManager
|
||||
@@ -57,7 +58,7 @@ private:
|
||||
ALCdevice *m_device;
|
||||
ALCcontext *m_context;
|
||||
|
||||
std::map<StreamSoundSourcePtr, std::future<SoundFilePtr>> m_streamFiles;
|
||||
std::map<StreamSoundSourcePtr, stdext::future<SoundFilePtr>> m_streamFiles;
|
||||
std::unordered_map<std::string, SoundBufferPtr> m_buffers;
|
||||
std::vector<SoundSourcePtr> m_sources;
|
||||
stdext::boolean<true> m_audioEnabled;
|
||||
|
Reference in New Issue
Block a user