[Scummvm-cvs-logs] SF.net SVN: scummvm:[42447] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Mon Jul 13 21:08:04 CEST 2009


Revision: 42447
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42447&view=rev
Author:   dkasak13
Date:     2009-07-13 19:08:04 +0000 (Mon, 13 Jul 2009)

Log Message:
-----------
Added Surface::fill() method and made Screen::fillScreen() use that instead of filling the surface manually. Changed Surface to use uint instead of uint8 throughout.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/screen.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/surface.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/surface.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/screen.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/screen.cpp	2009-07-13 18:47:32 UTC (rev 42446)
+++ scummvm/branches/gsoc2009-draci/engines/draci/screen.cpp	2009-07-13 19:08:04 UTC (rev 42447)
@@ -134,11 +134,8 @@
  * Fills the screen with the specified colour and marks the whole screen dirty.
  */
 void Screen::fillScreen(uint8 colour) const {
-	byte *ptr = (byte *)_surface->getBasePtr(0, 0);
-
+	_surface->fill(colour);
 	_surface->markDirty();
-
-	memset(ptr, colour, kScreenWidth * kScreenHeight);
 }
 
 /**

Modified: scummvm/branches/gsoc2009-draci/engines/draci/surface.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/surface.cpp	2009-07-13 18:47:32 UTC (rev 42446)
+++ scummvm/branches/gsoc2009-draci/engines/draci/surface.cpp	2009-07-13 19:08:04 UTC (rev 42447)
@@ -106,15 +106,24 @@
 /**
  * @brief Returns the current transparent colour of the surface
  */
-uint8 Surface::getTransparentColour() {
+uint Surface::getTransparentColour() {
 	return _transparentColour;
 }
 
 /**
  * @brief Sets the surface's transparent colour
  */
-void Surface::setTransparentColour(uint8 colour) {
+void Surface::setTransparentColour(uint colour) {
 	_transparentColour = colour;
 }
 
+/**
+ * @ brief Fills the surface with the specified colour
+ */
+void Surface::fill(uint colour) {
+	byte *ptr = (byte *)getBasePtr(0, 0);
+
+	memset(ptr, colour, w * h);
+}
+
 } // End of namespace Draci

Modified: scummvm/branches/gsoc2009-draci/engines/draci/surface.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/surface.h	2009-07-13 18:47:32 UTC (rev 42446)
+++ scummvm/branches/gsoc2009-draci/engines/draci/surface.h	2009-07-13 19:08:04 UTC (rev 42447)
@@ -42,14 +42,15 @@
 	void markDirty();
 	void markClean();
 	bool needsFullUpdate();
-	uint8 getTransparentColour();
-	void setTransparentColour(uint8 colour);
+	uint getTransparentColour();
+	void setTransparentColour(uint colour);
+	void fill(uint colour);
 
 private:
 	/** The current transparent colour of the surface. See getTransparentColour() and
 	 *	setTransparentColour().
 	 */
-	uint8 _transparentColour;
+	uint _transparentColour;
 	
 	/** Set when the surface is scheduled for a full update. 
 	 *	See markDirty(), markClean(). Accessed via needsFullUpdate().


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list