mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-01 19:37:55 +03:00
Use SDL thread
This commit is contained in:
+6
-5
@@ -29,8 +29,7 @@ MAKO::MAKO(NACT* parent) : nact(parent)
|
||||
params.mako = this;
|
||||
params.current_music = params.next_music = 0;
|
||||
params.request_fill = params.terminate = false;
|
||||
hThread = (HANDLE)_beginthread(thread, 0, ¶ms);
|
||||
SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
|
||||
hThread = SDL_CreateThread(thread, "MidiThread", ¶ms);
|
||||
}
|
||||
|
||||
MAKO::~MAKO()
|
||||
@@ -38,7 +37,7 @@ MAKO::~MAKO()
|
||||
// MIDI再生スレッド終了
|
||||
params.terminate = true;
|
||||
if(hThread) {
|
||||
WaitForSingleObject(hThread, INFINITE);
|
||||
SDL_WaitThread(hThread, NULL);
|
||||
}
|
||||
hThread = NULL;
|
||||
|
||||
@@ -48,11 +47,13 @@ MAKO::~MAKO()
|
||||
#endif
|
||||
}
|
||||
|
||||
void MAKO::thread(PVOID pvoid)
|
||||
int MAKO::thread(void* pvoid)
|
||||
{
|
||||
volatile PPARAMS pparams;
|
||||
pparams = (PPARAMS)pvoid;
|
||||
|
||||
SDL_SetThreadPriority(SDL_THREAD_PRIORITY_HIGH);
|
||||
|
||||
// MIDI初期化
|
||||
pparams->mako->initialize_midi();
|
||||
|
||||
@@ -92,7 +93,7 @@ void MAKO::thread(PVOID pvoid)
|
||||
pparams->mako->stop_midi();
|
||||
pparams->mako->release_midi();
|
||||
|
||||
_endthread();
|
||||
return 0;
|
||||
}
|
||||
|
||||
void MAKO::play_music(int page)
|
||||
|
||||
Reference in New Issue
Block a user