diff options
author | Narek Mailian | 2013-08-05 17:59:36 +0200 |
---|---|---|
committer | Narek Mailian | 2013-08-08 08:35:08 +0200 |
commit | 1f1d35bd3d31fe3430b9b5227b6127cfd52e52a2 (patch) | |
tree | 68f67447159105370896a3e6f11accf9b0a647a8 | |
parent | f545a2f08fc8989fa22726ce0b74e03ece099300 (diff) | |
download | scummvm-rg350-1f1d35bd3d31fe3430b9b5227b6127cfd52e52a2.tar.gz scummvm-rg350-1f1d35bd3d31fe3430b9b5227b6127cfd52e52a2.tar.bz2 scummvm-rg350-1f1d35bd3d31fe3430b9b5227b6127cfd52e52a2.zip |
GRAPHICS: Allow VectorRenderer and ThemeEngine to init with 4BPP
-rw-r--r-- | graphics/VectorRendererSpec.cpp | 10 | ||||
-rw-r--r-- | gui/ThemeEngine.cpp | 10 |
2 files changed, 15 insertions, 5 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index c60d9ca231..1e01744fad 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -283,10 +283,16 @@ VectorRenderer *createRenderer(int mode) { PixelFormat format = g_system->getOverlayFormat(); switch (mode) { case GUI::ThemeEngine::kGfxStandard: - return new VectorRendererSpec<OverlayColor>(format); + if (g_system->getOverlayFormat().bytesPerPixel == 4) + return new VectorRendererSpec<uint32>(format); + else if (g_system->getOverlayFormat().bytesPerPixel == 2) + return new VectorRendererSpec<uint16>(format); #ifndef DISABLE_FANCY_THEMES case GUI::ThemeEngine::kGfxAntialias: - return new VectorRendererAA<OverlayColor>(format); + if (g_system->getOverlayFormat().bytesPerPixel == 4) + return new VectorRendererAA<uint32>(format); + else if (g_system->getOverlayFormat().bytesPerPixel == 2) + return new VectorRendererAA<uint16>(format); #endif default: break; diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index b7199fbf68..561c0244a2 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -498,9 +498,13 @@ void ThemeEngine::setGraphicsMode(GraphicsMode mode) { #ifndef DISABLE_FANCY_THEMES case kGfxAntialias: #endif - _bytesPerPixel = sizeof(uint16); - break; - + if (g_system->getOverlayFormat().bytesPerPixel == 4) { + _bytesPerPixel = sizeof(uint32); + break; + } else if (g_system->getOverlayFormat().bytesPerPixel == 2) { + _bytesPerPixel = sizeof(uint16); + break; + } default: error("Invalid graphics mode"); } |