From 13f93494578818b5a1272d793f7412b6810f3321 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Tue, 12 Jun 2012 04:16:51 +0200 Subject: GUI: Take advantage of Surface::fillRect in GraphicsWidget::setGfx. --- gui/widget.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'gui') diff --git a/gui/widget.cpp b/gui/widget.cpp index fc6510b976..657245c815 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -643,14 +643,7 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) { _gfx.free(); _gfx.create(w, h, overlayFormat); - - OverlayColor *dst = (OverlayColor *)_gfx.pixels; - OverlayColor fillCol = overlayFormat.RGBToColor(r, g, b); - while (h--) { - for (int i = 0; i < w; ++i) { - *dst++ = fillCol; - } - } + _gfx.fillRect(Common::Rect(0, 0, w, h), _gfx.format.RGBToColor(r, g, b)); } void GraphicsWidget::drawWidget() { -- cgit v1.2.3