[Scummvm-cvs-logs] SF.net SVN: scummvm:[34888] scummvm/trunk

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon Nov 3 21:15:45 CET 2008


Revision: 34888
          http://scummvm.svn.sourceforge.net/scummvm/?rev=34888&view=rev
Author:   lordhoto
Date:     2008-11-03 20:15:45 +0000 (Mon, 03 Nov 2008)

Log Message:
-----------
Removed dependency on OSystem::RGBToColor, by using Graphics::RGBToColor + Graphics::PixelFormat instead.

Modified Paths:
--------------
    scummvm/trunk/graphics/imagedec.cpp
    scummvm/trunk/gui/widget.cpp

Modified: scummvm/trunk/graphics/imagedec.cpp
===================================================================
--- scummvm/trunk/graphics/imagedec.cpp	2008-11-03 20:00:36 UTC (rev 34887)
+++ scummvm/trunk/graphics/imagedec.cpp	2008-11-03 20:15:45 UTC (rev 34888)
@@ -120,13 +120,14 @@
 	newSurf->create(info.width, info.height, sizeof(OverlayColor));
 	assert(newSurf->pixels);
 	OverlayColor *curPixel = (OverlayColor*)newSurf->pixels + (newSurf->h-1) * newSurf->w;
+	PixelFormat overlayFormat = g_system->getOverlayFormat();
 	int pitchAdd = info.width % 4;
 	for (int i = 0; i < newSurf->h; ++i) {
 		for (int i2 = 0; i2 < newSurf->w; ++i2) {
 			b = stream.readByte();
 			g = stream.readByte();
 			r = stream.readByte();
-			*curPixel = g_system->RGBToColor(r, g, b);
+			*curPixel = RGBToColor(r, g, b, overlayFormat);
 			++curPixel;
 		}
 		stream.seek(pitchAdd, SEEK_CUR);

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2008-11-03 20:00:36 UTC (rev 34887)
+++ scummvm/trunk/gui/widget.cpp	2008-11-03 20:15:45 UTC (rev 34888)
@@ -359,8 +359,8 @@
 	_gfx.create(w, h, sizeof(OverlayColor));
 
 	OverlayColor *dst = (OverlayColor*)_gfx.pixels;
-	// TODO: get rid of g_system usage
-	OverlayColor fillCol = g_system->RGBToColor(r, g, b);
+	Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat();
+	OverlayColor fillCol = Graphics::RGBToColor(r, g, b, overlayFormat);
 	while (h--) {
 		for (int i = 0; i < w; ++i) {
 			*dst++ = fillCol;


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