aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/sdl
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 17:26:04 +0200
committerJohannes Schickel2011-04-17 20:56:16 +0200
commit0b14f6aa1787c3be6c402f6a541a659c88a790a6 (patch)
treeb8de3ae0439e2bc3c495e357beecf5068cbd38b6 /backends/graphics/sdl
parent911b7b311f1a5229098f459ee112d06bf7c47a4f (diff)
downloadscummvm-rg350-0b14f6aa1787c3be6c402f6a541a659c88a790a6.tar.gz
scummvm-rg350-0b14f6aa1787c3be6c402f6a541a659c88a790a6.tar.bz2
scummvm-rg350-0b14f6aa1787c3be6c402f6a541a659c88a790a6.zip
SDL: Properly setup internal Surface formats.
Diffstat (limited to 'backends/graphics/sdl')
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index 67b979a830..5279af9896 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -1288,8 +1288,10 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() {
_framebuffer.pitch = _screen->pitch;
#ifdef USE_RGB_COLOR
_framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
+ _framebuffer.format = _screenFormat;
#else
_framebuffer.bytesPerPixel = 1;
+ _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8();
#endif
return &_framebuffer;
@@ -2055,6 +2057,11 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
dst.h = _osdSurface->h;
dst.pitch = _osdSurface->pitch;
dst.bytesPerPixel = _osdSurface->format->BytesPerPixel;
+ dst.format = Graphics::PixelFormat(_osdSurface->format->BytesPerPixel,
+ 8 - _osdSurface->format->Rloss, 8 - _osdSurface->format->Gloss,
+ 8 - _osdSurface->format->Bloss, 8 - _osdSurface->format->Aloss,
+ _osdSurface->format->Rshift, _osdSurface->format->Gshift,
+ _osdSurface->format->Bshift, _osdSurface->format->Ashift);
// The font we are going to use:
const Graphics::Font *font = FontMan.getFontByUsage(Graphics::FontManager::kOSDFont);