[Scummvm-cvs-logs] CVS: scummvm/backends/PalmOS/Src palm.cpp,1.23,1.24 palm.h,1.17,1.18

Max Horn fingolfin at users.sourceforge.net
Sat Sep 27 09:55:05 CEST 2003


Update of /cvsroot/scummvm/scummvm/backends/PalmOS/Src
In directory sc8-pr-cvs1:/tmp/cvs-serv9425/PalmOS/Src

Modified Files:
	palm.cpp palm.h 
Log Message:
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

Index: palm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/palm.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- palm.cpp	23 Sep 2003 16:01:52 -0000	1.23
+++ palm.cpp	27 Sep 2003 16:54:09 -0000	1.24
@@ -646,22 +646,7 @@
 	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 @@
 	}
 
 	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 @@
 	_paletteDirtyEnd = 0;
 	
 	memset(&_sound, 0, sizeof(SoundDataType));
-	memset(_thread, 0, sizeof(_thread));
-	_threadID = 0;
-	_threadCounter = 0;
 	
 	_currentPalette = NULL;
 
@@ -1350,7 +1327,7 @@
 	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;

Index: palm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/PalmOS/Src/palm.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- palm.h	23 Sep 2003 16:01:52 -0000	1.17
+++ palm.h	27 Sep 2003 16:54:09 -0000	1.18
@@ -31,20 +31,9 @@
 			 	  			 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 @@
 	// 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 @@
 	 * @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 @@
 	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 @@
 	int _offScreenPitch;
 	int _screenPitch;
 	
-	ThreadEmuType _thread[MAX_THREAD];	// 0: midi native, 1:multi-midi (adlib wrapper)
-	UInt8 _threadCounter;
-	UInt8 _threadID;
-
 private:
 	byte *_offScreenP;
 





More information about the Scummvm-git-logs mailing list