CherryPicked commit "Reworked ResourceLoader"

Conflicts:
	src/Nazara/Utility/Loaders/MD2/Loader.cpp

Former-commit-id: 708c34c80f78cca224012149cf1d8faf37922463
This commit is contained in:
Lynix
2013-03-23 22:49:06 +01:00
parent 7754ca36a4
commit b4c7818200
10 changed files with 209 additions and 102 deletions

View File

@@ -20,7 +20,7 @@ struct NzMusicImpl
ALenum audioFormat;
std::vector<nzInt16> chunkSamples;
NzSoundStream* stream;
NzThread* thread = nullptr;
NzThread thread;
bool loop = false;
bool playing = false;
bool paused = false;
@@ -178,8 +178,7 @@ bool NzMusic::Play()
}*/
m_impl->playing = true;
m_impl->thread = new NzThread(&NzMusic::MusicThread, this);
m_impl->thread->Launch();
m_impl->thread = NzThread(&NzMusic::MusicThread, this);
return true;
}
@@ -197,9 +196,7 @@ void NzMusic::Stop()
if (m_impl->playing)
{
m_impl->playing = false;
m_impl->thread->Join();
delete m_impl->thread;
m_impl->thread = nullptr;
m_impl->thread.Join();
}
}