diff options
-rw-r--r-- | backends/graphics/sdl/sdl-graphics.cpp | 7 |
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); |