From 9a80fa88e0742c38eeb32fd91334570fff6c60ae Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sat, 3 Aug 2013 04:07:44 +0200 Subject: SDL: Do not set Surface::pixels directly anymore. --- .../graphics/surfacesdl/surfacesdl-graphics.cpp | 25 +++++++++------------- 1 file changed, 10 insertions(+), 15 deletions(-) (limited to 'backends') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 860ed0f4a3..871c6c49b2 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -1308,15 +1308,13 @@ Graphics::Surface *SurfaceSdlGraphicsManager::lockScreen() { if (SDL_LockSurface(_screen) == -1) error("SDL_LockSurface failed: %s", SDL_GetError()); - _framebuffer.pixels = _screen->pixels; - _framebuffer.w = _screen->w; - _framebuffer.h = _screen->h; - _framebuffer.pitch = _screen->pitch; + _framebuffer.init(_screen->w, _screen->h, _screen->pitch, _screen->pixels, #ifdef USE_RGB_COLOR - _framebuffer.format = _screenFormat; + _screenFormat #else - _framebuffer.format = Graphics::PixelFormat::createFormatCLUT8(); + Graphics::PixelFormat::createFormatCLUT8() #endif + ); return &_framebuffer; } @@ -2062,15 +2060,12 @@ void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) { error("displayMessageOnOSD: SDL_LockSurface failed: %s", SDL_GetError()); Graphics::Surface dst; - dst.pixels = _osdSurface->pixels; - dst.w = _osdSurface->w; - dst.h = _osdSurface->h; - dst.pitch = _osdSurface->pitch; - 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); + dst.init(_osdSurface->w, _osdSurface->h, _osdSurface->pitch, _osdSurface->pixels, + 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::kLocalizedFont); -- cgit v1.2.3