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

drmccoy at users.sourceforge.net drmccoy at users.sourceforge.net
Sun Jan 16 23:28:49 CET 2011


Revision: 55271
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55271&view=rev
Author:   drmccoy
Date:     2011-01-16 22:28:49 +0000 (Sun, 16 Jan 2011)

Log Message:
-----------
GOB: Add a method to get a true palette color

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

Modified: scummvm/trunk/engines/gob/draw.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw.cpp	2011-01-16 22:28:20 UTC (rev 55270)
+++ scummvm/trunk/engines/gob/draw.cpp	2011-01-16 22:28:49 UTC (rev 55271)
@@ -295,6 +295,15 @@
 	}
 }
 
+uint32 Draw::getColor(uint8 index) const {
+	if (!_vm->isTrueColor())
+		return index;
+
+	return _vm->getPixelFormat().RGBToColor(_vgaPalette[index].red   << 2,
+	                                        _vgaPalette[index].green << 2,
+	                                        _vgaPalette[index].blue  << 2);
+}
+
 void Draw::dirtiedRect(int16 surface,
 		int16 left, int16 top, int16 right, int16 bottom) {
 

Modified: scummvm/trunk/engines/gob/draw.h
===================================================================
--- scummvm/trunk/engines/gob/draw.h	2011-01-16 22:28:20 UTC (rev 55270)
+++ scummvm/trunk/engines/gob/draw.h	2011-01-16 22:28:49 UTC (rev 55271)
@@ -173,6 +173,8 @@
 	void setPalette();
 	void clearPalette();
 
+	uint32 getColor(uint8 index) const;
+
 	void dirtiedRect(int16 surface, int16 left, int16 top, int16 right, int16 bottom);
 	void dirtiedRect(SurfacePtr surface, int16 left, int16 top, int16 right, int16 bottom);
 


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