From 49d2a22b428864ccf2298b67841d4cb3cf33b659 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 27 Sep 2003 16:54:11 +0000 Subject: OSystem changes: removed create_thread() method (not needed anymore; 'pure' threads aren't very portable anyway, better we only use timers); introduced OSystem::TimerProc type svn-id: r10430 --- backends/sdl/sdl-common.cpp | 8 ++------ backends/sdl/sdl-common.h | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) (limited to 'backends/sdl') diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp index 7a407ad385..ecfc114844 100644 --- a/backends/sdl/sdl-common.cpp +++ b/backends/sdl/sdl-common.cpp @@ -83,7 +83,7 @@ void OSystem_SDL_Common::init_intern(int gfx_mode, bool full_screen, bool aspect } } -void OSystem_SDL_Common::set_timer(int timer, int (*callback)(int)) { +void OSystem_SDL_Common::set_timer(TimerProc callback, int timer) { SDL_SetTimer(timer, (SDL_TimerCallback) callback); } @@ -507,10 +507,6 @@ void OSystem_SDL_Common::delay_msecs(uint msecs) { SDL_Delay(msecs); } -void OSystem_SDL_Common::create_thread(ThreadProc *proc, void *param) { - SDL_CreateThread(proc, param); -} - static int mapKey(SDLKey key, SDLMod mod, Uint16 unicode) { if (key >= SDLK_F1 && key <= SDLK_F9) { @@ -900,7 +896,7 @@ bool OSystem_SDL_Common::poll_event(Event *event) { return false; } -bool OSystem_SDL_Common::set_sound_proc(SoundProc *proc, void *param, SoundFormat format) { +bool OSystem_SDL_Common::set_sound_proc(SoundProc proc, void *param, SoundFormat format) { SDL_AudioSpec desired; memset(&desired, 0, sizeof(desired)); diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h index a36ea2dbff..78ecba892b 100644 --- a/backends/sdl/sdl-common.h +++ b/backends/sdl/sdl-common.h @@ -28,7 +28,6 @@ #include "backends/intern.h" #include -#include class OSystem_SDL_Common : public OSystem { public: @@ -68,15 +67,12 @@ public: // Delay for a specified amount of milliseconds void delay_msecs(uint msecs); - // Create a thread - void create_thread(ThreadProc *proc, void *param); - // Get the next event. // Returns true if an event was retrieved. bool poll_event(Event *event); // Set function that generates samples - bool set_sound_proc(SoundProc *proc, void *param, SoundFormat format); + bool set_sound_proc(SoundProc proc, void *param, SoundFormat format); void clear_sound_proc(); @@ -100,7 +96,7 @@ public: uint32 property(int param, Property *value); // Add a callback timer - void set_timer(int timer, int (*callback)(int)); + void set_timer(TimerProc callback, int timer); // Mutex handling MutexRef create_mutex(); -- cgit v1.2.3