aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 16:34:58 +0200
committerJohannes Schickel2011-04-17 16:34:58 +0200
commit2329a00873e2cea79dae2ffe1839501e05b39fe4 (patch)
treecf8c659988492c047ce1d666482624068c1be3bc /gui
parent23479d07f33e4f8548d32264fedd66d46dae43c1 (diff)
downloadscummvm-rg350-2329a00873e2cea79dae2ffe1839501e05b39fe4.tar.gz
scummvm-rg350-2329a00873e2cea79dae2ffe1839501e05b39fe4.tar.bz2
scummvm-rg350-2329a00873e2cea79dae2ffe1839501e05b39fe4.zip
GUI: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
Diffstat (limited to 'gui')
-rw-r--r--gui/ThemeEngine.cpp6
-rw-r--r--gui/widget.cpp5
2 files changed, 6 insertions, 5 deletions
diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 82104eb7ae..e63724980e 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -373,8 +373,8 @@ const char *ThemeEngine::findModeConfigName(GraphicsMode mode) {
bool ThemeEngine::init() {
// reset everything and reload the graphics
_initOk = false;
- setGraphicsMode(_graphicsMode);
_overlayFormat = _system->getOverlayFormat();
+ setGraphicsMode(_graphicsMode);
if (_screen.pixels && _backBuffer.pixels) {
_initOk = true;
@@ -499,10 +499,10 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) {
uint32 height = _system->getOverlayHeight();
_backBuffer.free();
- _backBuffer.create(width, height, _bytesPerPixel);
+ _backBuffer.create(width, height, _overlayFormat);
_screen.free();
- _screen.create(width, height, _bytesPerPixel);
+ _screen.create(width, height, _overlayFormat);
delete _vectorRenderer;
_vectorRenderer = Graphics::createRenderer(mode);
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) {