aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src
diff options
context:
space:
mode:
authorMax Horn2003-09-27 16:54:11 +0000
committerMax Horn2003-09-27 16:54:11 +0000
commit49d2a22b428864ccf2298b67841d4cb3cf33b659 (patch)
tree11f1ebd799bec7e853bc71671fa045fe9467774c /backends/PalmOS/Src
parente19e7c879a1fc88458a3e26715875e60512d755b (diff)
downloadscummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.tar.gz
scummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.tar.bz2
scummvm-rg350-49d2a22b428864ccf2298b67841d4cb3cf33b659.zip
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
Diffstat (limited to 'backends/PalmOS/Src')
-rw-r--r--backends/PalmOS/Src/palm.cpp27
-rw-r--r--backends/PalmOS/Src/palm.h24
2 files changed, 5 insertions, 46 deletions
diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp
index a1bf3a760a..a9e4ef0691 100644
--- a/backends/PalmOS/Src/palm.cpp
+++ b/backends/PalmOS/Src/palm.cpp
@@ -646,22 +646,7 @@ void OSystem_PALMOS::delay_msecs(uint msecs) {
SysTaskDelay((SysTicksPerSecond()*msecs)/1000);
}
-void OSystem_PALMOS::create_thread(ThreadProc *proc, void *param) {
- if (_threadCounter == MAX_THREAD) {
- warning("Cannot create thread.");
- return;
- }
-
- _thread[_threadCounter].active = true;
- _thread[_threadCounter].proc = proc;
- _thread[_threadCounter].param = param;
- _thread[_threadCounter].old_time = get_msecs();
- _thread[_threadCounter].sleep = true;
-
- _threadCounter++;
-}
-
-void OSystem_PALMOS::set_timer(int timer, int (*callback)(int)) {
+void OSystem_PALMOS::set_timer(TimerProc callback, int timer) {
if (callback != NULL) {
_timer.duration = timer;
_timer.next_expiry = get_msecs() + timer;
@@ -729,11 +714,6 @@ bool OSystem_PALMOS::poll_event(Event *event) {
}
current_msecs = get_msecs();
- //thread handler
- for(_threadID = 0; _threadID < _threadCounter; _threadID++) {
- if (_thread[_threadID].active)
- _thread[_threadID].proc(_thread[_threadID].param);
- }
// sound handler
if(_sound.active)
@@ -1242,9 +1222,6 @@ OSystem_PALMOS::OSystem_PALMOS() {
_paletteDirtyEnd = 0;
memset(&_sound, 0, sizeof(SoundDataType));
- memset(_thread, 0, sizeof(_thread));
- _threadID = 0;
- _threadCounter = 0;
_currentPalette = NULL;
@@ -1350,7 +1327,7 @@ void OSystem_PALMOS::move_screen(int dx, int dy, int height) {
SysTaskDelay(1);
}
-bool OSystem_PALMOS::set_sound_proc(SoundProc *proc, void *param, SoundFormat format) {
+bool OSystem_PALMOS::set_sound_proc(SoundProc proc, void *param, SoundFormat format) {
_sound.active = true;
_sound.proc = proc;
_sound.param = param;
diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h
index f2d157e623..e9d6fc93d6 100644
--- a/backends/PalmOS/Src/palm.h
+++ b/backends/PalmOS/Src/palm.h
@@ -31,20 +31,9 @@ Err HwrDisplayPalette(UInt8 operation, Int16 startIndex,
UInt16 paletteEntries, RGBColorType *tableP)
SYS_TRAP(sysTrapHwrDisplayPalette);
-#define MAX_THREAD 2
-
-typedef struct {
- bool active;
- OSystem::ThreadProc *proc;
- void *param;
- bool sleep;
- int old_time;
-
-} ThreadEmuType, *ThreadEmuPtr;
-
typedef struct {
bool active;
- OSystem::SoundProc *proc;
+ OSystem::SoundProc proc;
void *param;
OSystem::SoundFormat format;
SndStreamRef sndRefNum;
@@ -95,9 +84,6 @@ 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);
@@ -113,7 +99,7 @@ public:
* @param param an arbitrary parameter which is stored and passed to proc.
* @param format the sample type format.
*/
- bool set_sound_proc(SoundProc *proc, void *param, SoundFormat format);
+ bool set_sound_proc(SoundProc proc, void *param, SoundFormat format);
/**
* Remove any audio callback previously set via set_sound_proc, thus effectively
@@ -137,7 +123,7 @@ public:
void update_cdrom();
// Add a callback timer
- void set_timer(int timer, int (*callback)(int));
+ void set_timer(TimerProc callback, int timer);
// Mutex handling
MutexRef create_mutex();
@@ -200,10 +186,6 @@ public:
int _offScreenPitch;
int _screenPitch;
- ThreadEmuType _thread[MAX_THREAD]; // 0: midi native, 1:multi-midi (adlib wrapper)
- UInt8 _threadCounter;
- UInt8 _threadID;
-
private:
byte *_offScreenP;