[Scummvm-cvs-logs] CVS: scummvm/backends/x11 x11.cpp,1.32,1.33

Max Horn fingolfin at users.sourceforge.net
Tue Sep 28 13:28:52 CEST 2004


Update of /cvsroot/scummvm/scummvm/backends/x11
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3612/backends/x11

Modified Files:
	x11.cpp 
Log Message:
Rename remaining OSystem methods to match our coding guidelines

Index: x11.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/x11/x11.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- x11.cpp	4 Sep 2004 01:31:03 -0000	1.32
+++ x11.cpp	28 Sep 2004 20:19:24 -0000	1.33
@@ -108,17 +108,17 @@
 	void setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, byte keycolor);
 
 	// Shaking is used in SCUMM. Set current shake position.
-	void set_shake_pos(int shake_pos);
+	void setShakePos(int shake_pos);
 
 	// Get the number of milliseconds since the program was started.
-	uint32 get_msecs();
+	uint32 getMillis();
 
 	// Delay for a specified amount of milliseconds
-	void delay_msecs(uint msecs);
+	void delayMillis(uint msecs);
 
 	// Get the next event.
 	// Returns true if an event was retrieved.  
-	bool poll_event(Event *event);
+	bool pollEvent(Event &event);
 
 	// Set function that generates samples 
 	bool setSoundCallback(SoundProc proc, void *param);
@@ -133,16 +133,16 @@
 
 	// Poll cdrom status
 	// Returns true if cd audio is playing
-	bool poll_cdrom();
+	bool pollCD();
 
 	// Play cdrom audio track
-	void play_cdrom(int track, int num_loops, int start_frame, int duration);
+	void playCD(int track, int num_loops, int start_frame, int duration);
 
 	// Stop cdrom audio track
-	void stop_cdrom();
+	void stopCD();
 
 	// Update cdrom audio status
-	void update_cdrom();
+	void updateCD();
 
 	// Quit
 	void quit();
@@ -462,7 +462,7 @@
 }
 
 
-uint32 OSystem_X11::get_msecs() {
+uint32 OSystem_X11::getMillis() {
 	struct timeval current_time;
 	gettimeofday(&current_time, NULL);
 	return (uint32)(((current_time.tv_sec - start_time.tv_sec) * 1000) +
@@ -789,7 +789,7 @@
 	_mouse_state_changed = true;
 }
 
-void OSystem_X11::set_shake_pos(int shake_pos) {
+void OSystem_X11::setShakePos(int shake_pos) {
 	if (new_shake_pos != shake_pos) {
 		if (_mouse_state_changed == false) {
 			undraw_mouse();
@@ -807,26 +807,26 @@
 	return false;
 }
 
-bool OSystem_X11::poll_cdrom() {
+bool OSystem_X11::pollCD() {
 	return false;
 }
 
-void OSystem_X11::play_cdrom(int track, int num_loops, int start_frame, int duration) {
+void OSystem_X11::playCD(int track, int num_loops, int start_frame, int duration) {
 }
 
-void OSystem_X11::stop_cdrom() {
+void OSystem_X11::stopCD() {
 }
 
-void OSystem_X11::update_cdrom() {
+void OSystem_X11::updateCD() {
 }
 
-void OSystem_X11::delay_msecs(uint msecs) {
+void OSystem_X11::delayMillis(uint msecs) {
 	usleep(msecs * 1000);
 }
 
-bool OSystem_X11::poll_event(Event *scumm_event) {
+bool OSystem_X11::pollEvent(Event &scumm_event) {
 	/* First, handle timers */
-	uint32 current_msecs = get_msecs();
+	uint32 current_msecs = getMillis();
 
 	if (_timer_active && (current_msecs >= _timer_next_expiry)) {
 		_timer_duration = _timer_callback(_timer_duration);
@@ -923,10 +923,10 @@
 					}
 				}
 				if (keycode != -1) {
-					scumm_event->event_code = EVENT_KEYDOWN;
-					scumm_event->kbd.keycode = keycode;
-					scumm_event->kbd.ascii = (ascii != -1 ? ascii : keycode);
-					scumm_event->kbd.flags = mode;
+					scumm_event.event_code = EVENT_KEYDOWN;
+					scumm_event.kbd.keycode = keycode;
+					scumm_event.kbd.ascii = (ascii != -1 ? ascii : keycode);
+					scumm_event.kbd.flags = mode;
 					return true;
 				}
 		}
@@ -965,10 +965,10 @@
 					}
 				}
 				if (keycode != -1) {
-					scumm_event->event_code = EVENT_KEYUP;
-					scumm_event->kbd.keycode = keycode;
-					scumm_event->kbd.ascii = (ascii != -1 ? ascii : keycode);
-					scumm_event->kbd.flags = mode;
+					scumm_event.event_code = EVENT_KEYUP;
+					scumm_event.kbd.keycode = keycode;
+					scumm_event.kbd.ascii = (ascii != -1 ? ascii : keycode);
+					scumm_event.kbd.flags = mode;
 					return true;
 				}
 			}
@@ -978,14 +978,14 @@
 			if (report_presses != 0) {
 				if (event.xbutton.button == 1) {
 					if (fake_right_mouse == 0) {
-						scumm_event->event_code = EVENT_LBUTTONDOWN;
+						scumm_event.event_code = EVENT_LBUTTONDOWN;
 					} else {
-						scumm_event->event_code = EVENT_RBUTTONDOWN;
+						scumm_event.event_code = EVENT_RBUTTONDOWN;
 					}
 				} else if (event.xbutton.button == 3)
-					scumm_event->event_code = EVENT_RBUTTONDOWN;
-				scumm_event->mouse.x = event.xbutton.x - scumm_x;
-				scumm_event->mouse.y = event.xbutton.y - scumm_y;
+					scumm_event.event_code = EVENT_RBUTTONDOWN;
+				scumm_event.mouse.x = event.xbutton.x - scumm_x;
+				scumm_event.mouse.y = event.xbutton.y - scumm_y;
 				return true;
 			}
 			break;
@@ -994,23 +994,23 @@
 			if (report_presses != 0) {
 				if (event.xbutton.button == 1) {
 					if (fake_right_mouse == 0) {
-						scumm_event->event_code = EVENT_LBUTTONUP;
+						scumm_event.event_code = EVENT_LBUTTONUP;
 					} else {
-						scumm_event->event_code = EVENT_RBUTTONUP;
+						scumm_event.event_code = EVENT_RBUTTONUP;
 					}
 				} else if (event.xbutton.button == 3)
-					scumm_event->event_code = EVENT_RBUTTONUP;
-				scumm_event->mouse.x = event.xbutton.x - scumm_x;
-				scumm_event->mouse.y = event.xbutton.y - scumm_y;
+					scumm_event.event_code = EVENT_RBUTTONUP;
+				scumm_event.mouse.x = event.xbutton.x - scumm_x;
+				scumm_event.mouse.y = event.xbutton.y - scumm_y;
 				return true;
 			}
 			break;
 
 		case MotionNotify:
-			scumm_event->event_code = EVENT_MOUSEMOVE;
-			scumm_event->mouse.x = event.xmotion.x - scumm_x;
-			scumm_event->mouse.y = event.xmotion.y - scumm_y;
-			set_mouse_pos(scumm_event->mouse.x, scumm_event->mouse.y);
+			scumm_event.event_code = EVENT_MOUSEMOVE;
+			scumm_event.mouse.x = event.xmotion.x - scumm_x;
+			scumm_event.mouse.y = event.xmotion.y - scumm_y;
+			set_mouse_pos(scumm_event.mouse.x, scumm_event.mouse.y);
 			return true;
 
 		case ConfigureNotify:{
@@ -1036,7 +1036,7 @@
 void OSystem_X11::setTimerCallback(TimerProc callback, int interval) {
 	if (callback != NULL) {
 		_timer_duration = interval;
-		_timer_next_expiry = get_msecs() + interval;
+		_timer_next_expiry = getMillis() + interval;
 		_timer_callback = callback;
 		_timer_active = true;
 	} else {





More information about the Scummvm-git-logs mailing list