diff options
Diffstat (limited to 'gui/widget.cpp')
-rw-r--r-- | gui/widget.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index 61f4a0e249..7a694860d6 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -573,11 +573,12 @@ void GraphicsWidget::setGfx(int w, int h, int r, int g, int b) { if (h == -1) h = _h; + Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat(); + _gfx.free(); - _gfx.create(w, h, sizeof(OverlayColor)); + _gfx.create(w, h, overlayFormat); OverlayColor *dst = (OverlayColor *)_gfx.pixels; - Graphics::PixelFormat overlayFormat = g_system->getOverlayFormat(); OverlayColor fillCol = overlayFormat.RGBToColor(r, g, b); while (h--) { for (int i = 0; i < w; ++i) { |