[Scummvm-cvs-logs] SF.net SVN: scummvm:[55573] scummvm/trunk/engines/gob

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Thu Jan 27 21:50:19 CET 2011


Revision: 55573
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55573&view=rev
Author:   drmccoy
Date:     2011-01-27 20:50:18 +0000 (Thu, 27 Jan 2011)

Log Message:
-----------
GOB: Add Pixel::isValid() and ConstPixel::isValid()

Modified Paths:
--------------
    scummvm/trunk/engines/gob/surface.cpp
    scummvm/trunk/engines/gob/surface.h

Modified: scummvm/trunk/engines/gob/surface.cpp
===================================================================
--- scummvm/trunk/engines/gob/surface.cpp	2011-01-27 20:42:19 UTC (rev 55572)
+++ scummvm/trunk/engines/gob/surface.cpp	2011-01-27 20:50:18 UTC (rev 55573)
@@ -103,7 +103,11 @@
 		*((uint16 *) _vidMem) = (uint16) p;
 }
 
+bool Pixel::isValid() const {
+	return (_vidMem >= _min) && (_vidMem < _max);
+}
 
+
 ConstPixel::ConstPixel(const byte *vidMem, uint8 bpp, const byte *min, const byte *max) :
 	_vidMem(vidMem), _bpp(bpp), _min(min), _max(max) {
 
@@ -157,7 +161,11 @@
 	return 0;
 }
 
+bool ConstPixel::isValid() const {
+	return (_vidMem >= _min) && (_vidMem < _max);
+}
 
+
 Surface::Surface(uint16 width, uint16 height, uint8 bpp, byte *vidMem) :
 	_width(width), _height(height), _bpp(bpp), _vidMem(vidMem) {
 

Modified: scummvm/trunk/engines/gob/surface.h
===================================================================
--- scummvm/trunk/engines/gob/surface.h	2011-01-27 20:42:19 UTC (rev 55572)
+++ scummvm/trunk/engines/gob/surface.h	2011-01-27 20:50:18 UTC (rev 55573)
@@ -49,6 +49,8 @@
 	uint32 get() const;
 	void set(uint32 p);
 
+	bool isValid() const;
+
 private:
 	byte *_vidMem;
 	byte *_min, *_max;
@@ -71,6 +73,8 @@
 
 	uint32 get() const;
 
+	bool isValid() const;
+
 private:
 	const byte *_vidMem;
 	const byte *_min, *_max;


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