aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2013-08-03 04:07:44 +0200
committerJohannes Schickel2013-08-03 04:14:08 +0200
commit9a80fa88e0742c38eeb32fd91334570fff6c60ae (patch)
tree655b8f1c6080f291a545ad1cd7cb5dbdc4b0a23c
parentd5298006f3af4af61443e4b4a91d4cef5ae84f89 (diff)
downloadscummvm-rg350-9a80fa88e0742c38eeb32fd91334570fff6c60ae.tar.gz
scummvm-rg350-9a80fa88e0742c38eeb32fd91334570fff6c60ae.tar.bz2
scummvm-rg350-9a80fa88e0742c38eeb32fd91334570fff6c60ae.zip
SDL: Do not set Surface::pixels directly anymore.
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp25
1 files changed, 10 insertions, 15 deletions
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);