From 985c02ee7da43fb66b61d6e3c5530e78bd2d8286 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 3 Nov 2008 13:44:59 +0000 Subject: Committed my patch #2216641 "GRAPHICS: PixelFormat introduction". svn-id: r34875 --- backends/platform/sdl/graphics.cpp | 12 ++++++++++++ backends/platform/sdl/sdl.h | 2 ++ 2 files changed, 14 insertions(+) (limited to 'backends/platform') diff --git a/backends/platform/sdl/graphics.cpp b/backends/platform/sdl/graphics.cpp index 96b74ecba7..1dde92af72 100644 --- a/backends/platform/sdl/graphics.cpp +++ b/backends/platform/sdl/graphics.cpp @@ -396,6 +396,18 @@ void OSystem_SDL::loadGFXMode() { if (_overlayscreen == NULL) error("allocating _overlayscreen failed"); + _overlayFormat.bytesPerPixel = _overlayscreen->format->BytesPerPixel; + + _overlayFormat.rLoss = _overlayscreen->format->Rloss; + _overlayFormat.gLoss = _overlayscreen->format->Gloss; + _overlayFormat.bLoss = _overlayscreen->format->Bloss; + _overlayFormat.aLoss = _overlayscreen->format->Aloss; + + _overlayFormat.rShift = _overlayscreen->format->Rshift; + _overlayFormat.gShift = _overlayscreen->format->Gshift; + _overlayFormat.bShift = _overlayscreen->format->Bshift; + _overlayFormat.aShift = _overlayscreen->format->Ashift; + _tmpscreen2 = SDL_CreateRGBSurface(SDL_SWSURFACE, _overlayWidth + 3, _overlayHeight + 3, 16, _hwscreen->format->Rmask, diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h index 602cf8d24d..8c89af05a7 100644 --- a/backends/platform/sdl/sdl.h +++ b/backends/platform/sdl/sdl.h @@ -176,6 +176,7 @@ public: void deleteMutex(MutexRef mutex); // Overlay + virtual Graphics::PixelFormat getOverlayFormat() const { return _overlayFormat; } virtual void showOverlay(); virtual void hideOverlay(); virtual void clearOverlay(); @@ -246,6 +247,7 @@ protected: SDL_Surface *_overlayscreen; int _overlayWidth, _overlayHeight; bool _overlayVisible; + Graphics::PixelFormat _overlayFormat; // Audio int _samplesPerSec; -- cgit v1.2.3