aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2005-05-08 23:39:37 +0000
committerMax Horn2005-05-08 23:39:37 +0000
commit74aed6382b4bab2b8bfa2c9ae41a08eaac082cae (patch)
tree18bd520229b50f8b9380e4db3c6e11e4acdacb97 /gui
parent5702c16c16dcf8c4971e9c4f0232340366dc1916 (diff)
downloadscummvm-rg350-74aed6382b4bab2b8bfa2c9ae41a08eaac082cae.tar.gz
scummvm-rg350-74aed6382b4bab2b8bfa2c9ae41a08eaac082cae.tar.bz2
scummvm-rg350-74aed6382b4bab2b8bfa2c9ae41a08eaac082cae.zip
cleanup
svn-id: r17980
Diffstat (limited to 'gui')
-rw-r--r--gui/widget.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp
index 6bc483e63d..582f7b902b 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -290,9 +290,7 @@ GraphicsWidget::~GraphicsWidget() {
void GraphicsWidget::setGfx(const Graphics::Surface *gfx) {
_gfx.free();
- if (!gfx)
- return;
- if (!gfx->pixels)
+ if (!gfx || !gfx->pixels)
return;
// TODO: add conversion to OverlayColor
@@ -306,17 +304,8 @@ void GraphicsWidget::drawWidget(bool hilite) {
// this widget might be used for other things than rendering savegame
// graphics/previews...
g_gui.drawString("No preview", _x, _y + _h / 2 - g_gui.getFontHeight() / 2, _w, g_gui._textcolor, Graphics::kTextAlignCenter);
- return;
- }
-
- uint drawWidth = _gfx.w, drawHeight = _gfx.h;
-
- if (_w < _gfx.w)
- drawWidth = _w;
- if (_h < _gfx.h)
- drawHeight = _h;
-
- g_gui.drawSurface(_gfx, _x, _y);
+ } else
+ g_gui.drawSurface(_gfx, _x, _y);
}
} // End of namespace GUI