aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-03 13:44:59 +0000
committerJohannes Schickel2008-11-03 13:44:59 +0000
commit985c02ee7da43fb66b61d6e3c5530e78bd2d8286 (patch)
tree44bc31e701a7b020486ab407560d6d9c0e0329b2 /backends/platform/sdl
parentd0c9b0cb233a00094f18269d94b7d0fb64433099 (diff)
downloadscummvm-rg350-985c02ee7da43fb66b61d6e3c5530e78bd2d8286.tar.gz
scummvm-rg350-985c02ee7da43fb66b61d6e3c5530e78bd2d8286.tar.bz2
scummvm-rg350-985c02ee7da43fb66b61d6e3c5530e78bd2d8286.zip
Committed my patch #2216641 "GRAPHICS: PixelFormat introduction".
svn-id: r34875
Diffstat (limited to 'backends/platform/sdl')
-rw-r--r--backends/platform/sdl/graphics.cpp12
-rw-r--r--backends/platform/sdl/sdl.h2
2 files changed, 14 insertions, 0 deletions
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;