From 0b14f6aa1787c3be6c402f6a541a659c88a790a6 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 17:26:04 +0200 Subject: SDL: Properly setup internal Surface formats. --- backends/graphics/sdl/sdl-graphics.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'backends/graphics/sdl') 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); -- cgit v1.2.3