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

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Mon May 29 07:57:01 CEST 2006


Revision: 22743
Author:   lordhoto
Date:     2006-05-29 07:38:56 -0700 (Mon, 29 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22743&view=rev

Log Message:
-----------
- adds option to fill GraphicsWidgets with a special color
- updates builtin theme config for my next commit
- bumps theme config

Modified Paths:
--------------
    scummvm/trunk/gui/theme-config.cpp
    scummvm/trunk/gui/widget.cpp
    scummvm/trunk/gui/widget.h
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp	2006-05-29 14:30:21 UTC (rev 22742)
+++ scummvm/trunk/gui/theme-config.cpp	2006-05-29 14:38:56 UTC (rev 22743)
@@ -293,6 +293,9 @@
 "scummsaveload_thumbnail=(parent.w - (kThumbnailWidth + 18)) 22\n"
 "scummsaveload_thumbnail.hPad=4\n"
 "scummsaveload_thumbnail.vPad=4\n"
+"scummsaveload_thumbnail.fillR=0\n"
+"scummsaveload_thumbnail.fillG=0\n"
+"scummsaveload_thumbnail.fillB=0\n"
 "scummsaveload_cancel=(parent.w - 2 * (buttonWidth + 10)) (parent.h - buttonHeight - 8) buttonWidth buttonHeight\n"
 "scummsaveload_choose=(prev.x2 + 10) prev.y prev.w prev.h\n"
 "scummsaveload_extinfo.visible=true\n"

Modified: scummvm/trunk/gui/widget.cpp
===================================================================
--- scummvm/trunk/gui/widget.cpp	2006-05-29 14:30:21 UTC (rev 22742)
+++ scummvm/trunk/gui/widget.cpp	2006-05-29 14:38:56 UTC (rev 22743)
@@ -350,6 +350,25 @@
 	memcpy(_gfx.pixels, gfx->pixels, gfx->h * gfx->pitch);
 }
 
+void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) {
+	if (w == -1)
+		w = _w;
+	if (h == -1)
+		h = _h;
+
+	_gfx.free();
+	_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);
+	while (h--) {
+		for (int i = 0; i < w; ++i) {
+			*dst++ = fillCol;
+		}
+	}
+}
+
 void GraphicsWidget::drawWidget(bool hilite) {
 	if (sizeof(OverlayColor) == _gfx.bytesPerPixel && _gfx.pixels) {
 		g_gui.theme()->drawSurface(Common::Rect(_x, _y, _x+_w, _y+_h), _gfx, Theme::kStateEnabled,  _alpha);

Modified: scummvm/trunk/gui/widget.h
===================================================================
--- scummvm/trunk/gui/widget.h	2006-05-29 14:30:21 UTC (rev 22742)
+++ scummvm/trunk/gui/widget.h	2006-05-29 14:38:56 UTC (rev 22743)
@@ -270,6 +270,7 @@
 	~GraphicsWidget();
 
 	void setGfx(const Graphics::Surface *gfx);
+	void setGfx(int w, int h, int r, int g, int b);
 
 	void useAlpha(int alpha) { _alpha = alpha; }
 


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