[Scummvm-cvs-logs] CVS: scummvm/common scummsys.h,1.44,1.45 system.h,1.53,1.54 timer.cpp,1.25,1.26 util.cpp,1.40,1.41

Max Horn fingolfin at users.sourceforge.net
Sat Feb 28 05:17:05 CET 2004


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32588/common

Modified Files:
	scummsys.h system.h timer.cpp util.cpp 
Log Message:
renamed more OSystem methods to follow our naming scheme; renamed NewGuiColor to OverlayColor; fixed some calls to error() in the SDL backend

Index: scummsys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scummsys.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- scummsys.h	6 Jan 2004 12:45:28 -0000	1.44
+++ scummsys.h	28 Feb 2004 12:57:52 -0000	1.45
@@ -420,10 +420,10 @@
 	
 #if defined(NEWGUI_256)
 	// 256 color only on PalmOS
-	typedef byte NewGuiColor;
+	typedef byte OverlayColor;
 #else
 	// 15/16 bit color mode everywhere else...
-	typedef int16 NewGuiColor;
+	typedef int16 OverlayColor;
 #endif
 
 /*

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- system.h	24 Feb 2004 22:39:38 -0000	1.53
+++ system.h	28 Feb 2004 12:57:52 -0000	1.54
@@ -153,28 +153,32 @@
 	virtual int16 get_width() = 0;
 
 	/** Set colors of the palette. */
-	virtual void set_palette(const byte *colors, uint start, uint num) = 0;
+	virtual void setPalette(const byte *colors, uint start, uint num) = 0;
 
 	/**
 	 * Draw a bitmap to screen.
 	 * The screen will not be updated to reflect the new bitmap, you have
-	 * to call update_screen to do that.
-	 * @see update_screen
+	 * to call updateScreen to do that.
+	 * @see updateScreen
 	 */
 	virtual void copy_rect(const byte *buf, int pitch, int x, int y, int w, int h) = 0;
 
+	/** Update the dirty areas of the screen. */
+	virtual void updateScreen() = 0;
+
 	/**
 	 * Moves the screen content by the offset specified via dx/dy.
 	 * Only the region from x=0 till x=height-1 is affected.
 	 * @param dx	the horizontal offset.
 	 * @param dy	the vertical offset.
 	 * @param height	the number of lines which in which the move will be done.
+	 *
+	 * @todo This is a rather special screen effect, only used by the SCUMM
+	 *       frontend - we should consider removing it from the backend API
+	 *       and instead implement the functionality in the frontend.
 	 */
 	virtual void move_screen(int dx, int dy, int height) = 0;
 
-	/** Update the dirty areas of the screen. */
-	virtual void update_screen() = 0;
-
 	/**
 	 * Set current shake position, a feature needed for some SCUMM screen effects.
 	 * The effect causes the displayed graphics to be shifted upwards by the specified 
@@ -183,31 +187,13 @@
 	 * be lost - that is, to restore the original view, the game engine only has to
 	 * call this method again with a 0 offset. No calls to copy_rect are necessary.
 	 * @param shakeOffset	the shake offset
+	 *
+	 * @todo This is a rather special screen effect, only used by the SCUMM
+	 *       frontend - we should consider removing it from the backend API
+	 *       and instead implement the functionality in the frontend.
 	 */
 	virtual void set_shake_pos(int shakeOffset) = 0;
 
-	/** Convert the given RGB triplet into a NewGuiColor. A NewGuiColor can be
-	 * 8bit, 16bit or 32bit, depending on the target system. The default
-	 * implementation generates a 16 bit color value, in the 565 format
-	 * (that is, 5 bits red, 6 bits green, 5 bits blue).
-	 * @see colorToRGB
-	 */
-	virtual NewGuiColor RGBToColor(uint8 r, uint8 g, uint8 b) {
-		return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F));
-	}
-
-	/** Convert the given NewGuiColor into a RGB triplet. A NewGuiColor can be
-	 * 8bit, 16bit or 32bit, depending on the target system. The default
-	 * implementation takes a 16 bit color value and assumes it to be in 565 format
-	 * (that is, 5 bits red, 6 bits green, 5 bits blue).
-	 * @see RGBToColor
-	 */
-	virtual void colorToRGB(NewGuiColor color, uint8 &r, uint8 &g, uint8 &b) {
-		r = (((color >> 11) & 0x1F) << 3);
-		g = (((color >> 5) & 0x3F) << 2);
-		b = ((color&0x1F) << 3);
-	}
-
 	//@}
 
 
@@ -361,7 +347,7 @@
 	 */
 	virtual void update_cdrom() = 0;
 
-	//@} 
+	//@}
 
 
 
@@ -374,19 +360,19 @@
 	 * Create a new mutex.
 	 * @return the newly created mutex, or 0 if an error occured.
 	 */
-	virtual MutexRef create_mutex(void) = 0;
+	virtual MutexRef createMutex(void) = 0;
 
 	/**
 	 * Lock the given mutex.
 	 * @param mutex	the mutex to lock.
 	 */
-	virtual void lock_mutex(MutexRef mutex) = 0;
+	virtual void lockMutex(MutexRef mutex) = 0;
 
 	/**
 	 * Unlock the given mutex.
 	 * @param mutex	the mutex to unlock.
 	 */
-	virtual void unlock_mutex(MutexRef mutex) = 0;
+	virtual void unlockMutex(MutexRef mutex) = 0;
 
 	/**
 	 * Delete the given mutex. Make sure the mutex is unlocked before you delete it.
@@ -394,8 +380,8 @@
 	 * program may crash.
 	 * @param mutex	the mutex to delete.
 	 */
-	virtual void delete_mutex(MutexRef mutex) = 0;
-	//@} 
+	virtual void deleteMutex(MutexRef mutex) = 0;
+	//@}
 
 
 	
@@ -404,11 +390,33 @@
 	virtual void show_overlay() = 0;
 	virtual void hide_overlay() = 0;
 	virtual void clear_overlay() = 0;
-	virtual void grab_overlay(NewGuiColor *buf, int pitch) = 0;
-	virtual void copy_rect_overlay(const NewGuiColor *buf, int pitch, int x, int y, int w, int h) = 0;
+	virtual void grab_overlay(OverlayColor *buf, int pitch) = 0;
+	virtual void copy_rect_overlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) = 0;
 	virtual int16 get_overlay_height()	{ return get_height(); }
 	virtual int16 get_overlay_width()	{ return get_width(); }
-	//@} 
+
+	/** Convert the given RGB triplet into a OverlayColor. A OverlayColor can be
+	 * 8bit, 16bit or 32bit, depending on the target system. The default
+	 * implementation generates a 16 bit color value, in the 565 format
+	 * (that is, 5 bits red, 6 bits green, 5 bits blue).
+	 * @see colorToRGB
+	 */
+	virtual OverlayColor RGBToColor(uint8 r, uint8 g, uint8 b) {
+		return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F));
+	}
+
+	/** Convert the given OverlayColor into a RGB triplet. A OverlayColor can be
+	 * 8bit, 16bit or 32bit, depending on the target system. The default
+	 * implementation takes a 16 bit color value and assumes it to be in 565 format
+	 * (that is, 5 bits red, 6 bits green, 5 bits blue).
+	 * @see RGBToColor
+	 */
+	virtual void colorToRGB(OverlayColor color, uint8 &r, uint8 &g, uint8 &b) {
+		r = (((color >> 11) & 0x1F) << 3);
+		g = (((color >> 5) & 0x3F) << 2);
+		b = ((color&0x1F) << 3);
+	}
+	//@}
 
 
 

Index: timer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/timer.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- timer.cpp	6 Jan 2004 12:45:28 -0000	1.25
+++ timer.cpp	28 Feb 2004 12:57:52 -0000	1.26
@@ -33,7 +33,7 @@
 	_timerHandler(0),
 	_lastTime(0) {
 
-	_mutex = _system->create_mutex();
+	_mutex = _system->createMutex();
 
 	g_timer = this;
 
@@ -71,7 +71,7 @@
 	// it is still waiting for the _mutex. So, again depending on the backend,
 	// we might end up unlocking the mutex then immediately deleting it, while
 	// the timer thread is about to lock it.
-	_system->delete_mutex(_mutex);
+	_system->deleteMutex(_mutex);
 }
 
 int Timer::timer_handler(int t) {

Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- util.cpp	14 Feb 2004 16:13:16 -0000	1.40
+++ util.cpp	28 Feb 2004 12:57:52 -0000	1.41
@@ -119,7 +119,7 @@
 	if (_mutexName != NULL)
 		debug(6, "Locking mutex %s", _mutexName);
 	
-	_syst->lock_mutex(_mutex);
+	_syst->lockMutex(_mutex);
 }
 
 void StackLock::unlock() {
@@ -127,7 +127,7 @@
 	if (_mutexName != NULL)
 		debug(6, "Unlocking mutex %s", _mutexName);
 
-	_syst->unlock_mutex(_mutex);
+	_syst->unlockMutex(_mutex);
 }
 
 





More information about the Scummvm-git-logs mailing list