[Scummvm-cvs-logs] CVS: scummvm/backends/x11 x11.cpp,1.18,1.19

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


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

Modified Files:
	x11.cpp 
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: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/x11/x11.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- x11.cpp	18 Sep 2003 02:07:16 -0000	1.18
+++ x11.cpp	27 Sep 2003 16:54:10 -0000	1.19
@@ -89,15 +89,12 @@
 	// 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();
 	
@@ -121,7 +118,7 @@
 	uint32 property(int param, Property *value);
 
 	// Add a callback timer
-	void set_timer(int timer, int (*callback) (int));
+	void set_timer(TimerProc callback, int interval);
 
 	// Mutex handling
 	MutexRef create_mutex();
@@ -199,7 +196,7 @@
 };
 
 typedef struct {
-	OSystem::SoundProc *sound_proc;
+	OSystem::SoundProc sound_proc;
 	void *param;
 	byte format;
 } THREAD_PARAM;
@@ -212,7 +209,7 @@
 	/* Init sound */
 	int sound_fd, param, frag_size;
 	uint8 sound_buffer[FRAG_SIZE];
-	OSystem::SoundProc *sound_proc = ((THREAD_PARAM *) params)->sound_proc;
+	OSystem::SoundProc sound_proc = ((THREAD_PARAM *) params)->sound_proc;
 	void *proc_param = ((THREAD_PARAM *) params)->param;
 
 #ifdef CAPTURE_SOUND
@@ -441,7 +438,7 @@
 	palette = (uint16 *)calloc(256, sizeof(uint16));
 }
 
-bool OSystem_X11::set_sound_proc(SoundProc *proc, void *param, SoundFormat format)
+bool OSystem_X11::set_sound_proc(SoundProc proc, void *param, SoundFormat format)
 {
 	static THREAD_PARAM thread_param;
 
@@ -779,12 +776,6 @@
 	new_shake_pos = shake_pos;
 }
 
-void OSystem_X11::create_thread(ThreadProc *proc, void *param)
-{
-	pthread_t *thread = (pthread_t *) malloc(sizeof(pthread_t));
-	pthread_create(thread, NULL, (void *(*)(void *))proc, param);
-}
-
 uint32 OSystem_X11::property(int param, Property *value)
 {
 	switch (param) {
@@ -1029,7 +1020,7 @@
 	return false;
 }
 
-void OSystem_X11::set_timer(int timer, int (*callback) (int))
+void OSystem_X11::set_timer(TimerProc callback, int interval)
 {
 	if (callback != NULL) {
 		_timer_duration = timer;





More information about the Scummvm-git-logs mailing list