aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics
diff options
context:
space:
mode:
authorStrangerke2011-06-29 16:15:41 +0200
committerStrangerke2011-06-29 16:15:41 +0200
commitb0c9c9122fc678074aba30068e5b36d347208e65 (patch)
tree79a99db08ec985f2e5f1e216823b1104d5b753fb /backends/graphics
parentf2f3124246a77036f843dee2d83ad28084234ebc (diff)
parentc32a3ea0d30336771bab460ecccb58c4614e6294 (diff)
downloadscummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.gz
scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.tar.bz2
scummvm-rg350-b0c9c9122fc678074aba30068e5b36d347208e65.zip
Merge branch 'master' of github.com:scummvm/scummvm into soltys_wip2
Diffstat (limited to 'backends/graphics')
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp14
-rw-r--r--backends/graphics/dinguxsdl/dinguxsdl-graphics.h10
-rw-r--r--backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp180
-rw-r--r--backends/graphics/gp2xsdl/gp2xsdl-graphics.h46
-rw-r--r--backends/graphics/gph/gph-graphics.cpp107
-rw-r--r--backends/graphics/gph/gph-graphics.h12
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp10
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h4
-rw-r--r--backends/graphics/opengl/gltexture.cpp2
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp24
-rw-r--r--backends/graphics/opengl/opengl-graphics.h4
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp66
-rw-r--r--backends/graphics/openpandora/op-graphics.cpp14
-rw-r--r--backends/graphics/openpandora/op-graphics.h46
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp6
-rw-r--r--backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h4
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp (renamed from backends/graphics/sdl/sdl-graphics.cpp)148
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.h (renamed from backends/graphics/sdl/sdl-graphics.h)16
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.cpp6
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.h4
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.cpp45
-rw-r--r--backends/graphics/wincesdl/wincesdl-graphics.h26
22 files changed, 330 insertions, 464 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
index 8a141e97a5..8075d0d45b 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp
@@ -36,7 +36,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
};
DINGUXSdlGraphicsManager::DINGUXSdlGraphicsManager(SdlEventSource *boss)
- : SdlGraphicsManager(boss) {
+ : SurfaceSdlGraphicsManager(boss) {
}
const OSystem::GraphicsMode *DINGUXSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -415,7 +415,7 @@ void DINGUXSdlGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void DINGUXSdlGraphicsManager::hideOverlay() {
@@ -423,7 +423,7 @@ void DINGUXSdlGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
bool DINGUXSdlGraphicsManager::loadGFXMode() {
@@ -462,7 +462,7 @@ bool DINGUXSdlGraphicsManager::loadGFXMode() {
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
bool DINGUXSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -492,11 +492,11 @@ bool DINGUXSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-SdlGraphicsManager::MousePos* DINGUXSdlGraphicsManager::getMouseCurState() {
+SurfaceSdlGraphicsManager::MousePos *DINGUXSdlGraphicsManager::getMouseCurState() {
return &_mouseCurState;
}
-SdlGraphicsManager::VideoState* DINGUXSdlGraphicsManager::getVideoMode() {
+SurfaceSdlGraphicsManager::VideoState *DINGUXSdlGraphicsManager::getVideoMode() {
return &_videoMode;
}
@@ -507,7 +507,7 @@ void DINGUXSdlGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void DINGUXSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
index 9fb1170503..84a784b771 100644
--- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
+++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.h
@@ -23,16 +23,16 @@
#ifndef BACKENDS_GRAPHICS_SDL_DINGUX_H
#define BACKENDS_GRAPHICS_SDL_DINGUX_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-#include "graphics/scaler/aspect.h" // for aspect2Real
+#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
enum {
GFX_HALF = 12
};
-class DINGUXSdlGraphicsManager : public SdlGraphicsManager {
+class DINGUXSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
DINGUXSdlGraphicsManager(SdlEventSource *boss);
@@ -54,8 +54,8 @@ public:
void undrawMouse();
virtual void warpMouse(int x, int y);
- SdlGraphicsManager::MousePos *getMouseCurState();
- SdlGraphicsManager::VideoState *getVideoMode();
+ SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+ SurfaceSdlGraphicsManager::VideoState *getVideoMode();
virtual void adjustMouseEvent(const Common::Event &event);
};
diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp b/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp
deleted file mode 100644
index 6e5a35a1b1..0000000000
--- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.cpp
+++ /dev/null
@@ -1,180 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#include "common/scummsys.h"
-
-#if defined(GP2X_OLD)
-
-#include "backends/graphics/gp2xsdl/gp2xsdl-graphics.h"
-#include "graphics/scaler/aspect.h"
-#include <SDL_gp2x.h>
-
-static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
- {"Fullscreen", "1x", GFX_NORMAL},
- {0, 0, 0}
-};
-
-GP2XSdlGraphicsManager::GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource), _adjustZoomOnMouse(false) {
-}
-
-const OSystem::GraphicsMode *GP2XSdlGraphicsManager::getSupportedGraphicsModes() const {
- return s_supportedGraphicsModes;
-}
-
-int GP2XSdlGraphicsManager::getDefaultGraphicsMode() const {
- return GFX_NORMAL;
-}
-
-
-bool GP2XSdlGraphicsManager::hasFeature(OSystem::Feature f) {
- if (f == OSystem::kFeatureIconifyWindow)
- return false;
-
- return SdlGraphicsManager::hasFeature(f);
-}
-
-void GP2XSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
- if (f != OSystem::kFeatureIconifyWindow)
- SdlGraphicsManager::setFeatureState(f, enable);
-}
-
-void GP2XSdlGraphicsManager::drawMouse() {
- if (!_mouseVisible || !_mouseSurface) {
- _mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
- return;
- }
-
- SDL_Rect zoomdst;
- SDL_Rect dst;
- int scale;
- int hotX, hotY;
- int tmpScreenWidth, tmpScreenHeight;
-
- // Temp vars to ensure we zoom to the LCD resolution or greater.
- tmpScreenWidth = _videoMode.screenWidth;
- tmpScreenHeight = _videoMode.screenHeight;
-
- if (_videoMode.screenHeight <= 240) {
- tmpScreenHeight = 240;
- }
-
- if (_videoMode.screenWidth <= 320) {
- tmpScreenWidth = 320;
- }
-
- dst.x = _mouseCurState.x;
- dst.y = _mouseCurState.y;
-
- if (!_overlayVisible) {
- scale = _videoMode.scaleFactor;
- dst.w = _mouseCurState.vW;
- dst.h = _mouseCurState.vH;
- hotX = _mouseCurState.vHotX;
- hotY = _mouseCurState.vHotY;
- } else {
- scale = 1;
- dst.w = _mouseCurState.rW;
- dst.h = _mouseCurState.rH;
- hotX = _mouseCurState.rHotX;
- hotY = _mouseCurState.rHotY;
- }
-
- // The mouse is undrawn using virtual coordinates, i.e. they may be
- // scaled and aspect-ratio corrected.
-
- _mouseBackup.x = dst.x - hotX;
- _mouseBackup.y = dst.y - hotY;
- _mouseBackup.w = dst.w;
- _mouseBackup.h = dst.h;
-
- // We draw the pre-scaled cursor image, so now we need to adjust for
- // scaling, shake position and aspect ratio correction manually.
-
- if (!_overlayVisible) {
- dst.y += _currentShakePos;
- }
-
- if (_videoMode.aspectRatioCorrection && !_overlayVisible)
- dst.y = real2Aspect(dst.y);
-
- dst.x = scale * dst.x - _mouseCurState.rHotX;
- dst.y = scale * dst.y - _mouseCurState.rHotY;
- dst.w = _mouseCurState.rW;
- dst.h = _mouseCurState.rH;
-
- // Hacking about with the zoom around mouse pointer stuff.
- if (_adjustZoomOnMouse){
-
- zoomdst.w = (tmpScreenWidth / 2);
- zoomdst.h = (tmpScreenHeight / 2);
-
- // Create a zoomed rect centered on the mouse pointer.
- // Will pan 1/4 of the screen.
-
- if (dst.x > ((tmpScreenWidth / 4) * 3)) {
- zoomdst.x = (tmpScreenWidth / 2);
- } else {
- zoomdst.x = (dst.x - (tmpScreenWidth / 4));
- if (zoomdst.x < 0) {
- zoomdst.x = 0;
- }
- }
-
- if (dst.y > ((tmpScreenHeight / 4) * 3)) {
- zoomdst.y = (tmpScreenHeight / 2);
- } else {
- zoomdst.y = (dst.y - (tmpScreenHeight / 4));
- if (zoomdst.y < 0) {
- zoomdst.y = 0;
- }
- }
- SDL_GP2X_Display(&zoomdst);
- } else {
-
- // Make sure we are looking at the whole screen otherwise.
-
- zoomdst.x = 0;
- zoomdst.y = 0;
- zoomdst.w = (tmpScreenWidth);
- zoomdst.h = (tmpScreenHeight);
-
- SDL_GP2X_Display(&zoomdst);
- };
-
- // Note that SDL_BlitSurface() and addDirtyRect() will both perform any
- // clipping necessary
-
- if (SDL_BlitSurface(_mouseSurface, NULL, _hwscreen, &dst) != 0)
- error("SDL_BlitSurface failed: %s", SDL_GetError());
-
- // The screen will be updated using real surface coordinates, i.e.
- // they will not be scaled or aspect-ratio corrected.
-
- addDirtyRect(dst.x, dst.y, dst.w, dst.h, true);
-}
-
-void GP2XSdlGraphicsManager::toggleZoomOnMouse() {
- _adjustZoomOnMouse = !_adjustZoomOnMouse;
-}
-
-#endif
diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
deleted file mode 100644
index 341b913acd..0000000000
--- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef BACKENDS_GRAPHICS_SDL_GP2X_H
-#define BACKENDS_GRAPHICS_SDL_GP2X_H
-
-#include "backends/graphics/sdl/sdl-graphics.h"
-
-class GP2XSdlGraphicsManager : public SdlGraphicsManager {
-public:
- GP2XSdlGraphicsManager(SdlEventSource *sdlEventSource);
-
- virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
- virtual int getDefaultGraphicsMode() const;
- virtual void drawMouse();
-
- virtual bool hasFeature(OSystem::Feature f);
- virtual void setFeatureState(OSystem::Feature f, bool enable);
-
- // Toggles zoom adjust on mouse
- void toggleZoomOnMouse();
-
-protected:
- bool _adjustZoomOnMouse;
-};
-
-#endif
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index b65028920f..82a32203fb 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -35,8 +35,8 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{0, 0, 0}
};
-GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *boss)
- : SdlGraphicsManager(boss) {
+GPHGraphicsManager::GPHGraphicsManager(SdlEventSource *sdlEventSource)
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
const OSystem::GraphicsMode *GPHGraphicsManager::getSupportedGraphicsModes() const {
@@ -110,21 +110,43 @@ void GPHGraphicsManager::setGraphicsModeIntern() {
blitCursor();
}
-void GPHGraphicsManager::initSize(uint w, uint h) {
+void GPHGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
+#ifdef USE_RGB_COLOR
+ // Avoid redundant format changes
+ Graphics::PixelFormat newFormat;
+ if (!format)
+ newFormat = Graphics::PixelFormat::createFormatCLUT8();
+ else
+ newFormat = *format;
+
+ assert(newFormat.bytesPerPixel > 0);
+
+ if (newFormat != _videoMode.format) {
+ _videoMode.format = newFormat;
+ _transactionDetails.formatChanged = true;
+ _screenFormat = newFormat;
+ }
+#endif
+
+
// Avoid redundant res changes
if ((int)w == _videoMode.screenWidth && (int)h == _videoMode.screenHeight)
return;
_videoMode.screenWidth = w;
_videoMode.screenHeight = h;
+
if (w > 320 || h > 240){
setGraphicsMode(GFX_HALF);
setGraphicsModeIntern();
_sdlEventSource->toggleMouseGrab();
}
+ _videoMode.overlayWidth = 320;
+ _videoMode.overlayHeight = 240;
+
_transactionDetails.sizeChanged = true;
}
@@ -421,7 +443,7 @@ void GPHGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void GPHGraphicsManager::hideOverlay() {
@@ -429,30 +451,69 @@ void GPHGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
-bool GPHGraphicsManager::loadGFXMode() {
-
- /* Forcefully disable aspect ratio correction for games
- that start with a native 240px height resolution
- This corrects games with non-standard resolutions
- such as MM Nes (256x240).
- */
+//bool GPHGraphicsManager::loadGFXMode() {
+
+
+// _videoMode.overlayWidth = 320;
+// _videoMode.overlayHeight = 240;
+// _videoMode.fullscreen = true;
+//
+// /* Forcefully disable aspect ratio correction for games
+// that start with a native 240px height resolution
+// This corrects games with non-standard resolutions
+// such as MM Nes (256x240).
+// */
+// if(_videoMode.screenHeight == 240) {
+// _videoMode.aspectRatioCorrection = false;
+// }
+
+// debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight);
+// if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
+// _videoMode.aspectRatioCorrection = false;
+// setGraphicsMode(GFX_HALF);
+// debug("GraphicsMode set to HALF");
+// } else {
+// setGraphicsMode(GFX_NORMAL);
+// debug("GraphicsMode set to NORMAL");
+// }
+
+
+// if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) {
+// //_videoMode.overlayWidth = _videoMode.screenWidth / 2;
+// //_videoMode.overlayHeight = _videoMode.screenHeight / 2;
+// _videoMode.overlayWidth = 320;
+// _videoMode.overlayHeight = 240;
+// _videoMode.fullscreen = true;
+// } else {
+//
+// _videoMode.overlayWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+// _videoMode.overlayHeight = _videoMode.screenHeight * _videoMode.scaleFactor;
+//
+// if (_videoMode.aspectRatioCorrection)
+// _videoMode.overlayHeight = real2Aspect(_videoMode.overlayHeight);
+//
+// //_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
+// //_videoMode.hardwareHeight = effectiveScreenHeight();
+// _videoMode.hardwareWidth = 320;
+// _videoMode.hardwareHeight = 240;
+//
+// }
+
+// return SurfaceSdlGraphicsManager::loadGFXMode();
+//}
- if(_videoMode.screenHeight == 240) {
- _videoMode.aspectRatioCorrection = false;
- }
-
- debug("Game ScreenMode = %d*%d", _videoMode.screenWidth, _videoMode.screenHeight);
+bool GPHGraphicsManager::loadGFXMode() {
if (_videoMode.screenWidth > 320 || _videoMode.screenHeight > 240) {
_videoMode.aspectRatioCorrection = false;
setGraphicsMode(GFX_HALF);
- debug("GraphicsMode set to HALF");
+// printf("GFX_HALF\n");
} else {
setGraphicsMode(GFX_NORMAL);
- debug("GraphicsMode set to NORMAL");
+// printf("GFX_NORMAL\n");
}
if ((_videoMode.mode == GFX_HALF) && !_overlayVisible) {
@@ -470,7 +531,7 @@ bool GPHGraphicsManager::loadGFXMode() {
_videoMode.hardwareWidth = _videoMode.screenWidth * _videoMode.scaleFactor;
_videoMode.hardwareHeight = effectiveScreenHeight();
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
bool GPHGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -500,11 +561,11 @@ bool GPHGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-SdlGraphicsManager::MousePos* GPHGraphicsManager::getMouseCurState() {
+SurfaceSdlGraphicsManager::MousePos *GPHGraphicsManager::getMouseCurState() {
return &_mouseCurState;
}
-SdlGraphicsManager::VideoState* GPHGraphicsManager::getVideoMode() {
+SurfaceSdlGraphicsManager::VideoState *GPHGraphicsManager::getVideoMode() {
return &_videoMode;
}
@@ -515,7 +576,7 @@ void GPHGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void GPHGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/gph/gph-graphics.h b/backends/graphics/gph/gph-graphics.h
index 6ba2b344a6..45b8618569 100644
--- a/backends/graphics/gph/gph-graphics.h
+++ b/backends/graphics/gph/gph-graphics.h
@@ -23,15 +23,15 @@
#ifndef BACKENDS_GRAPHICS_GPH_H
#define BACKENDS_GRAPHICS_GPH_H
-#include "backends/graphics/sdl/sdl-graphics.h"
-#include "graphics/scaler/aspect.h" // for aspect2Real
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
+#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
enum {
GFX_HALF = 12
};
-class GPHGraphicsManager : public SdlGraphicsManager {
+class GPHGraphicsManager : public SurfaceSdlGraphicsManager {
public:
GPHGraphicsManager(SdlEventSource *boss);
@@ -40,7 +40,7 @@ public:
bool getFeatureState(OSystem::Feature f);
int getDefaultGraphicsMode() const;
- void initSize(uint w, uint h);
+ void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL);
const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
bool setGraphicsMode(const char *name);
bool setGraphicsMode(int mode);
@@ -53,8 +53,8 @@ public:
void undrawMouse();
virtual void warpMouse(int x, int y);
- SdlGraphicsManager::MousePos *getMouseCurState();
- SdlGraphicsManager::VideoState *getVideoMode();
+ SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+ SurfaceSdlGraphicsManager::VideoState *getVideoMode();
virtual void adjustMouseEvent(const Common::Event &event);
};
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index 42db89ee33..732074b7e2 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -46,7 +46,7 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
};
LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
@@ -166,7 +166,7 @@ bool LinuxmotoSdlGraphicsManager::loadGFXMode() {
_videoMode.hardwareHeight = effectiveScreenHeight();
}
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
void LinuxmotoSdlGraphicsManager::drawMouse() {
@@ -457,7 +457,7 @@ void LinuxmotoSdlGraphicsManager::showOverlay() {
_mouseCurState.x = _mouseCurState.x / 2;
_mouseCurState.y = _mouseCurState.y / 2;
}
- SdlGraphicsManager::showOverlay();
+ SurfaceSdlGraphicsManager::showOverlay();
}
void LinuxmotoSdlGraphicsManager::hideOverlay() {
@@ -465,7 +465,7 @@ void LinuxmotoSdlGraphicsManager::hideOverlay() {
_mouseCurState.x = _mouseCurState.x * 2;
_mouseCurState.y = _mouseCurState.y * 2;
}
- SdlGraphicsManager::hideOverlay();
+ SurfaceSdlGraphicsManager::hideOverlay();
}
void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
@@ -475,7 +475,7 @@ void LinuxmotoSdlGraphicsManager::warpMouse(int x, int y) {
y = y / 2;
}
}
- SdlGraphicsManager::warpMouse(x, y);
+ SurfaceSdlGraphicsManager::warpMouse(x, y);
}
void LinuxmotoSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
index c428f00447..938512f323 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
@@ -23,9 +23,9 @@
#ifndef BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
#define BACKENDS_GRAPHICS_SDL_LINUXMOTO_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class LinuxmotoSdlGraphicsManager : public SdlGraphicsManager {
+class LinuxmotoSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
LinuxmotoSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/opengl/gltexture.cpp b/backends/graphics/opengl/gltexture.cpp
index 3d1027b44f..b7f5c90105 100644
--- a/backends/graphics/opengl/gltexture.cpp
+++ b/backends/graphics/opengl/gltexture.cpp
@@ -108,7 +108,7 @@ void GLTexture::refresh() {
void GLTexture::allocBuffer(GLuint w, GLuint h) {
_realWidth = w;
_realHeight = h;
-
+
if (w <= _textureWidth && h <= _textureHeight && !_refresh)
// Already allocated a sufficiently large buffer
return;
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index c0551de386..046be4c669 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -179,7 +179,7 @@ bool OpenGLGraphicsManager::setGraphicsMode(int mode) {
}
int OpenGLGraphicsManager::getGraphicsMode() const {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
return _videoMode.mode;
}
@@ -420,12 +420,12 @@ void OpenGLGraphicsManager::fillScreen(uint32 col) {
}
void OpenGLGraphicsManager::updateScreen() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
internUpdateScreen();
}
void OpenGLGraphicsManager::setShakePos(int shakeOffset) {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
_shakePos = shakeOffset;
}
@@ -440,7 +440,7 @@ void OpenGLGraphicsManager::clearFocusRectangle() {
//
void OpenGLGraphicsManager::showOverlay() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (_overlayVisible)
return;
@@ -451,7 +451,7 @@ void OpenGLGraphicsManager::showOverlay() {
}
void OpenGLGraphicsManager::hideOverlay() {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (!_overlayVisible)
return;
@@ -483,7 +483,7 @@ void OpenGLGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
}
void OpenGLGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+ assert(_transactionMode == kTransactionNone);
if (_overlayTexture == NULL)
return;
@@ -642,7 +642,7 @@ void OpenGLGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int
void OpenGLGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
assert(colors);
-
+
// Save the cursor palette
memcpy(_cursorPalette + start * 3, colors, num * 3);
@@ -1315,7 +1315,7 @@ bool OpenGLGraphicsManager::notifyEvent(const Common::Event &event) {
bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
int width = _videoMode.hardwareWidth;
int height = _videoMode.hardwareHeight;
-
+
// A line of a BMP image must have a size divisible by 4.
// We calculate the padding bytes needed here.
// Since we use a 3 byte per pixel mode, we can use width % 4 here, since
@@ -1358,7 +1358,7 @@ bool OpenGLGraphicsManager::saveScreenshot(const char *filename) {
out.writeUint32LE(0);
out.writeUint32LE(0);
out.writeUint32LE(0);
- out.writeUint32LE(0);
+ out.writeUint32LE(0);
// Write pixel data to BMP
out.write(pixels, lineSize * height);
@@ -1413,7 +1413,7 @@ void OpenGLGraphicsManager::updateOSD() {
int dstX = (_osdSurface.w - width) / 2;
int dstY = (_osdSurface.h - height) / 2;
- // Draw a dark gray rect
+ // Draw a dark gray rect (R = 40, G = 40, B = 40)
const uint16 color = 0x294B;
_osdSurface.fillRect(Common::Rect(dstX, dstY, dstX + width, dstY + height), color);
@@ -1423,9 +1423,9 @@ void OpenGLGraphicsManager::updateOSD() {
dstX, dstY + i * lineHeight + vOffset + lineSpacing, width,
0xFFFF, Graphics::kTextAlignCenter);
}
-
+
// Update the texture
- _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0,
+ _osdTexture->updateBuffer(_osdSurface.pixels, _osdSurface.pitch, 0, 0,
_osdSurface.w, _osdSurface.h);
}
#endif
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 463715aad8..56f7d92a12 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -185,7 +185,7 @@ protected:
/**
* Set the scale factor.
- *
+ *
* This can only be used in a GFX transaction.
*
* @param newScale New scale factor.
@@ -332,7 +332,7 @@ protected:
GLTexture *_osdTexture;
Graphics::Surface _osdSurface;
uint8 _osdAlpha;
- uint32 _osdFadeStartTime;
+ uint32 _osdFadeStartTime;
bool _requireOSDUpdate;
enum {
kOSDFadeOutDelay = 2 * 1000,
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 87457c3c08..bd7dd32e3b 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -54,6 +54,10 @@ OpenGLSdlGraphicsManager::OpenGLSdlGraphicsManager()
SDL_ShowCursor(SDL_DISABLE);
// Get desktop resolution
+ // TODO: In case the OpenGL manager is created *after* a plain SDL manager
+ // has been used, this will return the last setup graphics mode rather
+ // than the desktop resolution. We should really look into a way to
+ // properly retrieve the desktop resolution.
const SDL_VideoInfo *videoInfo = SDL_GetVideoInfo();
if (videoInfo->current_w > 0 && videoInfo->current_h > 0) {
_desktopWidth = videoInfo->current_w;
@@ -110,16 +114,16 @@ void OpenGLSdlGraphicsManager::detectSupportedFormats() {
// use.
const Graphics::PixelFormat RGBList[] = {
#if defined(ENABLE_32BIT)
- Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888
+ Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0), // RGBA8888
#ifndef USE_GLES
Graphics::PixelFormat(4, 8, 8, 8, 8, 16, 8, 0, 24), // ARGB8888
#endif
- Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888
+ Graphics::PixelFormat(3, 8, 8, 8, 0, 16, 8, 0, 0), // RGB888
#endif
- Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565
- Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551
- Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555
- Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444
+ Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0), // RGB565
+ Graphics::PixelFormat(2, 5, 5, 5, 1, 11, 6, 1, 0), // RGB5551
+ Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0), // RGB555
+ Graphics::PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0), // RGBA4444
#ifndef USE_GLES
Graphics::PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12) // ARGB4444
#endif
@@ -302,7 +306,7 @@ bool OpenGLSdlGraphicsManager::loadGFXMode() {
int screenAspectRatio = _videoMode.screenWidth * 10000 / _videoMode.screenHeight;
int desiredAspectRatio = getAspectRatio();
-
+
// Do not downscale dimensions, only enlarge them if needed
if (screenAspectRatio > desiredAspectRatio)
_videoMode.hardwareHeight = (_videoMode.overlayWidth * 10000 + 5000) / desiredAspectRatio;
@@ -385,7 +389,7 @@ void OpenGLSdlGraphicsManager::internUpdateScreen() {
OpenGLGraphicsManager::internUpdateScreen();
// Swap OpenGL buffers
- SDL_GL_SwapBuffers();
+ SDL_GL_SwapBuffers();
}
#ifdef USE_OSD
@@ -394,27 +398,27 @@ void OpenGLSdlGraphicsManager::displayModeChangedMsg() {
if (newModeName) {
const int scaleFactor = getScale();
- char buffer[128];
- sprintf(buffer, "%s: %s\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: %s\n%d x %d -> %d x %d",
_("Current display mode"),
newModeName,
_videoMode.screenWidth * scaleFactor,
_videoMode.screenHeight * scaleFactor,
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
}
void OpenGLSdlGraphicsManager::displayScaleChangedMsg() {
- char buffer[128];
const int scaleFactor = getScale();
- sprintf(buffer, "%s: x%d\n%d x %d -> %d x %d",
+ Common::String osdMessage = Common::String::format(
+ "%s: x%d\n%d x %d -> %d x %d",
_("Current scale"),
scaleFactor,
_videoMode.screenWidth, _videoMode.screenHeight,
_videoMode.overlayWidth, _videoMode.overlayHeight
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
}
#endif
@@ -450,18 +454,18 @@ void OpenGLSdlGraphicsManager::toggleFullScreen(int loop) {
_ignoreResizeFrames = 10;
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFullscreenMode())
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Fullscreen mode"),
_hwscreen->w, _hwscreen->h
);
else
- sprintf(buffer, "%s\n%d x %d",
+ osdMessage = Common::String::format("%s\n%d x %d",
_("Windowed mode"),
_hwscreen->w, _hwscreen->h
);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
}
@@ -478,19 +482,19 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// Alt-S create a screenshot
if (event.kbd.keycode == 's') {
- char filename[20];
+ Common::String filename;
for (int n = 0;; n++) {
SDL_RWops *file;
- sprintf(filename, "scummvm%05d.bmp", n);
- file = SDL_RWFromFile(filename, "r");
+ filename = Common::String::format("scummvm%05d.bmp", n);
+ file = SDL_RWFromFile(filename.c_str(), "r");
if (!file)
break;
SDL_RWclose(file);
}
- if (saveScreenshot(filename))
- debug("Saved screenshot '%s'", filename);
+ if (saveScreenshot(filename.c_str()))
+ debug("Saved screenshot '%s'", filename.c_str());
else
warning("Could not save screenshot");
return true;
@@ -511,18 +515,18 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
setFeatureState(OSystem::kFeatureAspectRatioCorrection, !getFeatureState(OSystem::kFeatureAspectRatioCorrection));
endGFXTransaction();
#ifdef USE_OSD
- char buffer[128];
+ Common::String osdMessage;
if (getFeatureState(OSystem::kFeatureAspectRatioCorrection))
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Enabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Enabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
else
- sprintf(buffer, "%s\n%d x %d -> %d x %d",
- _("Disabled aspect ratio correction"),
+ osdMessage = Common::String::format("%s\n%d x %d -> %d x %d",
+ _("Disabled aspect ratio correction"),
_videoMode.screenWidth, _videoMode.screenHeight,
_hwscreen->w, _hwscreen->h);
- displayMessageOnOSD(buffer);
+ displayMessageOnOSD(osdMessage.c_str());
#endif
internUpdateScreen();
return true;
@@ -557,7 +561,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
// Check if the desktop resolution has been detected
if (_desktopWidth > 0 && _desktopHeight > 0)
// If the new scale factor is too big, do not scale
- if (_videoMode.screenWidth * factor > _desktopWidth ||
+ if (_videoMode.screenWidth * factor > _desktopWidth ||
_videoMode.screenHeight * factor > _desktopHeight)
return false;
@@ -607,7 +611,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
break;
case Common::EVENT_KEYUP:
return isHotkey(event);
- // HACK: Handle special SDL event
+ // HACK: Handle special SDL event
// The new screen size is saved on the mouse event as part of HACK,
// there is no common resize event.
case OSystem_SDL::kSdlEventResize:
diff --git a/backends/graphics/openpandora/op-graphics.cpp b/backends/graphics/openpandora/op-graphics.cpp
index 20ee5dfc36..5f0301a0c8 100644
--- a/backends/graphics/openpandora/op-graphics.cpp
+++ b/backends/graphics/openpandora/op-graphics.cpp
@@ -26,15 +26,13 @@
#include "backends/graphics/openpandora/op-graphics.h"
#include "backends/events/openpandora/op-events.h"
-#include "backends/platform/openpandora/op-sdl.h"
-#include "common/mutex.h"
-#include "common/util.h"
-
+//#include "backends/platform/openpandora/op-sdl.h"
#include "graphics/scaler/aspect.h"
-#include "graphics/surface.h"
+#include "common/mutex.h"
+#include "common/textconsole.h"
-OPGraphicsManager::OPGraphicsManager(SdlEventSource *boss)
- : SdlGraphicsManager(boss) {
+OPGraphicsManager::OPGraphicsManager(SdlEventSource *sdlEventSource)
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
bool OPGraphicsManager::loadGFXMode() {
@@ -49,7 +47,7 @@ bool OPGraphicsManager::loadGFXMode() {
if (_videoMode.screenHeight != 200 && _videoMode.screenHeight != 400)
_videoMode.aspectRatioCorrection = false;
- return SdlGraphicsManager::loadGFXMode();
+ return SurfaceSdlGraphicsManager::loadGFXMode();
}
#endif
diff --git a/backends/graphics/openpandora/op-graphics.h b/backends/graphics/openpandora/op-graphics.h
index b0d4298620..ed26df7475 100644
--- a/backends/graphics/openpandora/op-graphics.h
+++ b/backends/graphics/openpandora/op-graphics.h
@@ -23,7 +23,7 @@
#ifndef BACKENDS_GRAPHICS_OP_H
#define BACKENDS_GRAPHICS_OP_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "graphics/scaler/aspect.h" // for aspect2Real
#include "graphics/scaler/downscaler.h"
@@ -31,32 +31,32 @@ enum {
GFX_HALF = 12
};
-class OPGraphicsManager : public SdlGraphicsManager {
+class OPGraphicsManager : public SurfaceSdlGraphicsManager {
public:
- OPGraphicsManager(SdlEventSource *boss);
-
- bool hasFeature(OSystem::Feature f);
- void setFeatureState(OSystem::Feature f, bool enable);
- bool getFeatureState(OSystem::Feature f);
- int getDefaultGraphicsMode() const;
-
- void initSize(uint w, uint h);
- const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
- bool setGraphicsMode(const char *name);
- bool setGraphicsMode(int mode);
- void setGraphicsModeIntern();
- void internUpdateScreen();
- void showOverlay();
- void hideOverlay();
+ OPGraphicsManager(SdlEventSource *sdlEventSource);
+
+// bool hasFeature(OSystem::Feature f);
+// void setFeatureState(OSystem::Feature f, bool enable);
+// bool getFeatureState(OSystem::Feature f);
+// int getDefaultGraphicsMode() const;
+
+// void initSize(uint w, uint h, const Graphics::PixelFormat *format = NULL);
+// const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+// bool setGraphicsMode(const char *name);
+// bool setGraphicsMode(int mode);
+// void setGraphicsModeIntern();
+// void internUpdateScreen();
+// void showOverlay();
+// void hideOverlay();
bool loadGFXMode();
- void drawMouse();
- void undrawMouse();
- virtual void warpMouse(int x, int y);
+// void drawMouse();
+// void undrawMouse();
+// virtual void warpMouse(int x, int y);
- SdlGraphicsManager::MousePos *getMouseCurState();
- SdlGraphicsManager::VideoState *getVideoMode();
+// SurfaceSdlGraphicsManager::MousePos *getMouseCurState();
+// SurfaceSdlGraphicsManager::VideoState *getVideoMode();
- virtual void adjustMouseEvent(const Common::Event &event);
+// virtual void adjustMouseEvent(const Common::Event &event);
};
#endif /* BACKENDS_GRAPHICS_OP_H */
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
index f6832978a8..95e0875f55 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.cpp
@@ -29,7 +29,7 @@
#include "backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h"
SamsungTVSdlGraphicsManager::SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -41,7 +41,7 @@ bool SamsungTVSdlGraphicsManager::hasFeature(OSystem::Feature f) {
void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
break;
default:
break;
@@ -51,7 +51,7 @@ void SamsungTVSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enabl
bool SamsungTVSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
switch (f) {
case OSystem::kFeatureAspectRatioCorrection:
- return SdlGraphicsManager::getFeatureState(f);
+ return SurfaceSdlGraphicsManager::getFeatureState(f);
default:
return false;
}
diff --git a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
index dc65c3a696..2d0ff636f4 100644
--- a/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
+++ b/backends/graphics/samsungtvsdl/samsungtvsdl-graphics.h
@@ -25,9 +25,9 @@
#if defined(SAMSUNGTV)
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class SamsungTVSdlGraphicsManager : public SdlGraphicsManager {
+class SamsungTVSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
SamsungTVSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 9063f55744..66207b6808 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -24,7 +24,7 @@
#if defined(SDL_BACKEND)
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "backends/events/sdl/sdl-events.h"
#include "backends/platform/sdl/sdl.h"
#include "common/config-manager.h"
@@ -120,7 +120,7 @@ static AspectRatio getDesiredAspectRatio() {
}
#endif
-SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
+SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource)
:
_sdlEventSource(sdlEventSource),
#ifdef USE_OSD
@@ -195,7 +195,7 @@ SdlGraphicsManager::SdlGraphicsManager(SdlEventSource *sdlEventSource)
#endif
}
-SdlGraphicsManager::~SdlGraphicsManager() {
+SurfaceSdlGraphicsManager::~SurfaceSdlGraphicsManager() {
// Unregister the event observer
if (g_system->getEventManager()->getEventDispatcher() != NULL)
g_system->getEventManager()->getEventDispatcher()->unregisterObserver(this);
@@ -214,12 +214,12 @@ SdlGraphicsManager::~SdlGraphicsManager() {
free(_mouseData);
}
-void SdlGraphicsManager::initEventObserver() {
+void SurfaceSdlGraphicsManager::initEventObserver() {
// Register the graphics manager as a event observer
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
}
-bool SdlGraphicsManager::hasFeature(OSystem::Feature f) {
+bool SurfaceSdlGraphicsManager::hasFeature(OSystem::Feature f) {
return
(f == OSystem::kFeatureFullscreenMode) ||
(f == OSystem::kFeatureAspectRatioCorrection) ||
@@ -227,7 +227,7 @@ bool SdlGraphicsManager::hasFeature(OSystem::Feature f) {
(f == OSystem::kFeatureIconifyWindow);
}
-void SdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
+void SurfaceSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
switch (f) {
case OSystem::kFeatureFullscreenMode:
setFullscreenMode(enable);
@@ -248,7 +248,7 @@ void SdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
}
}
-bool SdlGraphicsManager::getFeatureState(OSystem::Feature f) {
+bool SurfaceSdlGraphicsManager::getFeatureState(OSystem::Feature f) {
assert(_transactionMode == kTransactionNone);
switch (f) {
@@ -263,23 +263,23 @@ bool SdlGraphicsManager::getFeatureState(OSystem::Feature f) {
}
}
-const OSystem::GraphicsMode *SdlGraphicsManager::supportedGraphicsModes() {
+const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::supportedGraphicsModes() {
return s_supportedGraphicsModes;
}
-const OSystem::GraphicsMode *SdlGraphicsManager::getSupportedGraphicsModes() const {
+const OSystem::GraphicsMode *SurfaceSdlGraphicsManager::getSupportedGraphicsModes() const {
return s_supportedGraphicsModes;
}
-int SdlGraphicsManager::getDefaultGraphicsMode() const {
+int SurfaceSdlGraphicsManager::getDefaultGraphicsMode() const {
return GFX_DOUBLESIZE;
}
-void SdlGraphicsManager::resetGraphicsScale() {
+void SurfaceSdlGraphicsManager::resetGraphicsScale() {
setGraphicsMode(s_gfxModeSwitchTable[_scalerType][0]);
}
-void SdlGraphicsManager::beginGFXTransaction() {
+void SurfaceSdlGraphicsManager::beginGFXTransaction() {
assert(_transactionMode == kTransactionNone);
_transactionMode = kTransactionActive;
@@ -297,7 +297,7 @@ void SdlGraphicsManager::beginGFXTransaction() {
_oldVideoMode = _videoMode;
}
-OSystem::TransactionError SdlGraphicsManager::endGFXTransaction() {
+OSystem::TransactionError SurfaceSdlGraphicsManager::endGFXTransaction() {
int errors = OSystem::kTransactionSuccess;
assert(_transactionMode != kTransactionNone);
@@ -398,12 +398,12 @@ OSystem::TransactionError SdlGraphicsManager::endGFXTransaction() {
}
#ifdef USE_RGB_COLOR
-Common::List<Graphics::PixelFormat> SdlGraphicsManager::getSupportedFormats() const {
+Common::List<Graphics::PixelFormat> SurfaceSdlGraphicsManager::getSupportedFormats() const {
assert(!_supportedFormats.empty());
return _supportedFormats;
}
-void SdlGraphicsManager::detectSupportedFormats() {
+void SurfaceSdlGraphicsManager::detectSupportedFormats() {
// Clear old list
_supportedFormats.clear();
@@ -487,7 +487,7 @@ void SdlGraphicsManager::detectSupportedFormats() {
}
#endif
-bool SdlGraphicsManager::setGraphicsMode(int mode) {
+bool SurfaceSdlGraphicsManager::setGraphicsMode(int mode) {
Common::StackLock lock(_graphicsMutex);
assert(_transactionMode == kTransactionActive);
@@ -557,7 +557,7 @@ bool SdlGraphicsManager::setGraphicsMode(int mode) {
return true;
}
-void SdlGraphicsManager::setGraphicsModeIntern() {
+void SurfaceSdlGraphicsManager::setGraphicsModeIntern() {
Common::StackLock lock(_graphicsMutex);
ScalerProc *newScalerProc = 0;
@@ -630,12 +630,12 @@ void SdlGraphicsManager::setGraphicsModeIntern() {
blitCursor();
}
-int SdlGraphicsManager::getGraphicsMode() const {
- assert (_transactionMode == kTransactionNone);
+int SurfaceSdlGraphicsManager::getGraphicsMode() const {
+ assert(_transactionMode == kTransactionNone);
return _videoMode.mode;
}
-void SdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
+void SurfaceSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
assert(_transactionMode == kTransactionActive);
#ifdef USE_RGB_COLOR
@@ -665,7 +665,7 @@ void SdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *f
_transactionDetails.sizeChanged = true;
}
-int SdlGraphicsManager::effectiveScreenHeight() const {
+int SurfaceSdlGraphicsManager::effectiveScreenHeight() const {
return _videoMode.scaleFactor *
(_videoMode.aspectRatioCorrection
? real2Aspect(_videoMode.screenHeight)
@@ -713,7 +713,7 @@ static void fixupResolutionForAspectRatio(AspectRatio desiredAspectRatio, int &w
height = bestMode->h;
}
-bool SdlGraphicsManager::loadGFXMode() {
+bool SurfaceSdlGraphicsManager::loadGFXMode() {
_forceFull = true;
#if !defined(__MAEMO__) && !defined(DINGUX) && !defined(GPH_DEVICE) && !defined(LINUXMOTO) && !defined(OPENPANDORA)
@@ -853,7 +853,7 @@ bool SdlGraphicsManager::loadGFXMode() {
return true;
}
-void SdlGraphicsManager::unloadGFXMode() {
+void SurfaceSdlGraphicsManager::unloadGFXMode() {
if (_screen) {
SDL_FreeSurface(_screen);
_screen = NULL;
@@ -888,7 +888,7 @@ void SdlGraphicsManager::unloadGFXMode() {
DestroyScalers();
}
-bool SdlGraphicsManager::hotswapGFXMode() {
+bool SurfaceSdlGraphicsManager::hotswapGFXMode() {
if (!_screen)
return false;
@@ -940,15 +940,15 @@ bool SdlGraphicsManager::hotswapGFXMode() {
return true;
}
-void SdlGraphicsManager::updateScreen() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::updateScreen() {
+ assert(_transactionMode == kTransactionNone);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
internUpdateScreen();
}
-void SdlGraphicsManager::internUpdateScreen() {
+void SurfaceSdlGraphicsManager::internUpdateScreen() {
SDL_Surface *srcSurf, *origSurf;
int height, width;
ScalerProc *scalerProc;
@@ -1191,14 +1191,14 @@ void SdlGraphicsManager::internUpdateScreen() {
_mouseNeedsRedraw = false;
}
-bool SdlGraphicsManager::saveScreenshot(const char *filename) {
+bool SurfaceSdlGraphicsManager::saveScreenshot(const char *filename) {
assert(_hwscreen != NULL);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
return SDL_SaveBMP(_hwscreen, filename) == 0;
}
-void SdlGraphicsManager::setFullscreenMode(bool enable) {
+void SurfaceSdlGraphicsManager::setFullscreenMode(bool enable) {
Common::StackLock lock(_graphicsMutex);
if (_oldVideoMode.setup && _oldVideoMode.fullscreen == enable)
@@ -1210,7 +1210,7 @@ void SdlGraphicsManager::setFullscreenMode(bool enable) {
}
}
-void SdlGraphicsManager::setAspectRatioCorrection(bool enable) {
+void SurfaceSdlGraphicsManager::setAspectRatioCorrection(bool enable) {
Common::StackLock lock(_graphicsMutex);
if (_oldVideoMode.setup && _oldVideoMode.aspectRatioCorrection == enable)
@@ -1222,12 +1222,12 @@ void SdlGraphicsManager::setAspectRatioCorrection(bool enable) {
}
}
-void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int y, int w, int h) {
+ assert(_transactionMode == kTransactionNone);
assert(src);
if (_screen == NULL) {
- warning("SdlGraphicsManager::copyRectToScreen: _screen == NULL");
+ warning("SurfaceSdlGraphicsManager::copyRectToScreen: _screen == NULL");
return;
}
@@ -1272,8 +1272,8 @@ void SdlGraphicsManager::copyRectToScreen(const byte *src, int pitch, int x, int
SDL_UnlockSurface(_screen);
}
-Graphics::Surface *SdlGraphicsManager::lockScreen() {
- assert (_transactionMode == kTransactionNone);
+Graphics::Surface *SurfaceSdlGraphicsManager::lockScreen() {
+ assert(_transactionMode == kTransactionNone);
// Lock the graphics mutex
g_system->lockMutex(_graphicsMutex);
@@ -1299,8 +1299,8 @@ Graphics::Surface *SdlGraphicsManager::lockScreen() {
return &_framebuffer;
}
-void SdlGraphicsManager::unlockScreen() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::unlockScreen() {
+ assert(_transactionMode == kTransactionNone);
// paranoia check
assert(_screenIsLocked);
@@ -1316,14 +1316,14 @@ void SdlGraphicsManager::unlockScreen() {
g_system->unlockMutex(_graphicsMutex);
}
-void SdlGraphicsManager::fillScreen(uint32 col) {
+void SurfaceSdlGraphicsManager::fillScreen(uint32 col) {
Graphics::Surface *screen = lockScreen();
if (screen && screen->pixels)
memset(screen->pixels, col, screen->h * screen->pitch);
unlockScreen();
}
-void SdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) {
+void SurfaceSdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoordinates) {
if (_forceFull)
return;
@@ -1391,15 +1391,15 @@ void SdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool realCoord
}
}
-int16 SdlGraphicsManager::getHeight() {
+int16 SurfaceSdlGraphicsManager::getHeight() {
return _videoMode.screenHeight;
}
-int16 SdlGraphicsManager::getWidth() {
+int16 SurfaceSdlGraphicsManager::getWidth() {
return _videoMode.screenWidth;
}
-void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(colors);
#ifdef USE_RGB_COLOR
@@ -1411,7 +1411,7 @@ void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
// But it could indicate a programming error, so let's warn about it.
if (!_screen)
- warning("SdlGraphicsManager::setPalette: _screen == NULL");
+ warning("SurfaceSdlGraphicsManager::setPalette: _screen == NULL");
const byte *b = colors;
uint i;
@@ -1433,7 +1433,7 @@ void SdlGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
blitCursor();
}
-void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
assert(colors);
#ifdef USE_RGB_COLOR
@@ -1449,7 +1449,7 @@ void SdlGraphicsManager::grabPalette(byte *colors, uint start, uint num) {
}
}
-void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
+void SurfaceSdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
assert(colors);
const byte *b = colors;
uint i;
@@ -1464,13 +1464,13 @@ void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint n
blitCursor();
}
-void SdlGraphicsManager::setShakePos(int shake_pos) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::setShakePos(int shake_pos) {
+ assert(_transactionMode == kTransactionNone);
_newShakePos = shake_pos;
}
-void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
+void SurfaceSdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
#ifdef USE_SDL_DEBUG_FOCUSRECT
// Only enable focus rectangle debug code, when the user wants it
if (!_enableFocusRectDebugCode)
@@ -1480,7 +1480,7 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
_focusRect = rect;
if (rect.left < 0 || rect.top < 0 || rect.right > _videoMode.screenWidth || rect.bottom > _videoMode.screenHeight)
- warning("SdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom);
+ warning("SurfaceSdlGraphicsManager::setFocusRectangle: Got a rect which does not fit inside the screen bounds: %d,%d,%d,%d", rect.left, rect.top, rect.right, rect.bottom);
// It's gross but we actually sometimes get rects, which are not inside the screen bounds,
// thus we need to clip the rect here...
@@ -1492,7 +1492,7 @@ void SdlGraphicsManager::setFocusRectangle(const Common::Rect &rect) {
#endif
}
-void SdlGraphicsManager::clearFocusRectangle() {
+void SurfaceSdlGraphicsManager::clearFocusRectangle() {
#ifdef USE_SDL_DEBUG_FOCUSRECT
// Only enable focus rectangle debug code, when the user wants it
if (!_enableFocusRectDebugCode)
@@ -1510,8 +1510,8 @@ void SdlGraphicsManager::clearFocusRectangle() {
#pragma mark --- Overlays ---
#pragma mark -
-void SdlGraphicsManager::showOverlay() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::showOverlay() {
+ assert(_transactionMode == kTransactionNone);
int x, y;
@@ -1533,8 +1533,8 @@ void SdlGraphicsManager::showOverlay() {
clearOverlay();
}
-void SdlGraphicsManager::hideOverlay() {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::hideOverlay() {
+ assert(_transactionMode == kTransactionNone);
if (!_overlayVisible)
return;
@@ -1557,8 +1557,8 @@ void SdlGraphicsManager::hideOverlay() {
_forceFull = true;
}
-void SdlGraphicsManager::clearOverlay() {
- //assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::clearOverlay() {
+ //assert(_transactionMode == kTransactionNone);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
@@ -1590,8 +1590,8 @@ void SdlGraphicsManager::clearOverlay() {
_forceFull = true;
}
-void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
+ assert(_transactionMode == kTransactionNone);
if (_overlayscreen == NULL)
return;
@@ -1610,8 +1610,8 @@ void SdlGraphicsManager::grabOverlay(OverlayColor *buf, int pitch) {
SDL_UnlockSurface(_overlayscreen);
}
-void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {
+ assert(_transactionMode == kTransactionNone);
if (_overlayscreen == NULL)
return;
@@ -1660,7 +1660,7 @@ void SdlGraphicsManager::copyRectToOverlay(const OverlayColor *buf, int pitch, i
#pragma mark --- Mouse ---
#pragma mark -
-bool SdlGraphicsManager::showMouse(bool visible) {
+bool SurfaceSdlGraphicsManager::showMouse(bool visible) {
if (_mouseVisible == visible)
return visible;
@@ -1671,7 +1671,7 @@ bool SdlGraphicsManager::showMouse(bool visible) {
return last;
}
-void SdlGraphicsManager::setMousePos(int x, int y) {
+void SurfaceSdlGraphicsManager::setMousePos(int x, int y) {
if (x != _mouseCurState.x || y != _mouseCurState.y) {
_mouseNeedsRedraw = true;
_mouseCurState.x = x;
@@ -1679,7 +1679,7 @@ void SdlGraphicsManager::setMousePos(int x, int y) {
}
}
-void SdlGraphicsManager::warpMouse(int x, int y) {
+void SurfaceSdlGraphicsManager::warpMouse(int x, int y) {
int y1 = y;
// Don't change actual mouse position, when mouse is outside of our window (in case of windowed mode)
@@ -1708,7 +1708,7 @@ void SdlGraphicsManager::warpMouse(int x, int y) {
}
}
-void SdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
+void SurfaceSdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
#ifdef USE_RGB_COLOR
if (!format)
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
@@ -1765,7 +1765,7 @@ void SdlGraphicsManager::setMouseCursor(const byte *buf, uint w, uint h, int hot
blitCursor();
}
-void SdlGraphicsManager::blitCursor() {
+void SurfaceSdlGraphicsManager::blitCursor() {
byte *dstPtr;
const byte *srcPtr = _mouseData;
#ifdef USE_RGB_COLOR
@@ -1956,7 +1956,7 @@ static int cursorStretch200To240(uint8 *buf, uint32 pitch, int width, int height
}
#endif
-void SdlGraphicsManager::undrawMouse() {
+void SurfaceSdlGraphicsManager::undrawMouse() {
const int x = _mouseBackup.x;
const int y = _mouseBackup.y;
@@ -1969,7 +1969,7 @@ void SdlGraphicsManager::undrawMouse() {
addDirtyRect(x, y - _currentShakePos, _mouseBackup.w, _mouseBackup.h);
}
-void SdlGraphicsManager::drawMouse() {
+void SurfaceSdlGraphicsManager::drawMouse() {
if (!_mouseVisible || !_mouseSurface) {
_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
return;
@@ -2036,8 +2036,8 @@ void SdlGraphicsManager::drawMouse() {
#pragma mark -
#ifdef USE_OSD
-void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
- assert (_transactionMode == kTransactionNone);
+void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) {
+ assert(_transactionMode == kTransactionNone);
assert(msg);
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
@@ -2123,7 +2123,7 @@ void SdlGraphicsManager::displayMessageOnOSD(const char *msg) {
}
#endif
-bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
+bool SurfaceSdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
// Ctrl-Alt-a toggles aspect ratio correction
if (key == 'a') {
@@ -2212,7 +2212,7 @@ bool SdlGraphicsManager::handleScalerHotkeys(Common::KeyCode key) {
}
}
-bool SdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
+bool SurfaceSdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
if ((event.kbd.flags & (Common::KBD_CTRL|Common::KBD_ALT)) == (Common::KBD_CTRL|Common::KBD_ALT)) {
const bool isNormalNumber = (Common::KEYCODE_1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_9);
const bool isKeypadNumber = (Common::KEYCODE_KP1 <= event.kbd.keycode && event.kbd.keycode <= Common::KEYCODE_KP9);
@@ -2229,7 +2229,7 @@ bool SdlGraphicsManager::isScalerHotkey(const Common::Event &event) {
return false;
}
-void SdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
+void SurfaceSdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
if (!event.synthetic) {
Common::Event newEvent(event);
newEvent.synthetic = true;
@@ -2243,7 +2243,7 @@ void SdlGraphicsManager::adjustMouseEvent(const Common::Event &event) {
}
}
-void SdlGraphicsManager::toggleFullScreen() {
+void SurfaceSdlGraphicsManager::toggleFullScreen() {
beginGFXTransaction();
setFullscreenMode(!_videoMode.fullscreen);
endGFXTransaction();
@@ -2255,7 +2255,7 @@ void SdlGraphicsManager::toggleFullScreen() {
#endif
}
-bool SdlGraphicsManager::notifyEvent(const Common::Event &event) {
+bool SurfaceSdlGraphicsManager::notifyEvent(const Common::Event &event) {
switch ((int)event.type) {
case Common::EVENT_KEYDOWN:
// Alt-Return and Alt-Enter toggle full screen mode
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/surfacesdl/surfacesdl-graphics.h
index 9627ab23a3..cd8710d443 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef BACKENDS_GRAPHICS_SDL_H
-#define BACKENDS_GRAPHICS_SDL_H
+#ifndef BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
+#define BACKENDS_GRAPHICS_SURFACESDL_GRAPHICS_H
#include "backends/graphics/graphics.h"
#include "graphics/pixelformat.h"
@@ -74,10 +74,10 @@ public:
/**
* SDL graphics manager
*/
-class SdlGraphicsManager : public GraphicsManager, public Common::EventObserver {
+class SurfaceSdlGraphicsManager : public GraphicsManager, public Common::EventObserver {
public:
- SdlGraphicsManager(SdlEventSource *sdlEventSource);
- virtual ~SdlGraphicsManager();
+ SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSource);
+ virtual ~SurfaceSdlGraphicsManager();
virtual void initEventObserver();
@@ -100,7 +100,7 @@ public:
virtual void beginGFXTransaction();
virtual OSystem::TransactionError endGFXTransaction();
-
+
virtual int16 getHeight();
virtual int16 getWidth();
@@ -132,7 +132,7 @@ public:
virtual void warpMouse(int x, int y);
virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL);
virtual void setCursorPalette(const byte *colors, uint start, uint num);
-
+
#ifdef USE_OSD
virtual void displayMessageOnOSD(const char *msg);
#endif
@@ -149,7 +149,7 @@ protected:
/** Transparency level of the OSD */
uint8 _osdAlpha;
/** When to start the fade out */
- uint32 _osdFadeStartTime;
+ uint32 _osdFadeStartTime;
/** Enum with OSD options */
enum {
kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
index a88c8a8ffe..4a9a219641 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
@@ -28,7 +28,7 @@
#include "backends/platform/symbian/src/SymbianActions.h"
SymbianSdlGraphicsManager::SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource) {
+ : SurfaceSdlGraphicsManager(sdlEventSource) {
}
int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const {
@@ -47,7 +47,7 @@ const OSystem::GraphicsMode *SymbianSdlGraphicsManager::getSupportedGraphicsMode
// make sure we always go to normal, even if the string might be set wrong!
bool SymbianSdlGraphicsManager::setGraphicsMode(int /*name*/) {
// let parent OSystem_SDL handle it
- return SdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode());
+ return SurfaceSdlGraphicsManager::setGraphicsMode(getDefaultGraphicsMode());
}
bool SymbianSdlGraphicsManager::hasFeature(OSystem::Feature f) {
@@ -72,7 +72,7 @@ void SymbianSdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable)
GUI::Actions::Instance()->beginMapping(enable);
break;
default:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
}
}
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h
index 1bad32a9b6..404ca87a0a 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.h
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h
@@ -23,9 +23,9 @@
#ifndef BACKENDS_GRAPHICS_SYMBIAN_SDL_H
#define BACKENDS_GRAPHICS_SYMBIAN_SDL_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
-class SymbianSdlGraphicsManager : public SdlGraphicsManager {
+class SymbianSdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
SymbianSdlGraphicsManager(SdlEventSource *sdlEventSource);
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.cpp b/backends/graphics/wincesdl/wincesdl-graphics.cpp
index 80b04ca56d..2ca78cedde 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.cpp
+++ b/backends/graphics/wincesdl/wincesdl-graphics.cpp
@@ -43,14 +43,14 @@
#include "backends/platform/wince/CEgui/ItemAction.h"
WINCESdlGraphicsManager::WINCESdlGraphicsManager(SdlEventSource *sdlEventSource)
- : SdlGraphicsManager(sdlEventSource),
- _panelInitialized(false), _noDoubleTapRMB(false),
+ : SurfaceSdlGraphicsManager(sdlEventSource),
+ _panelInitialized(false), _noDoubleTapRMB(false), _noDoubleTapPT(false),
_toolbarHighDrawn(false), _newOrientation(0), _orientationLandscape(0),
_panelVisible(true), _saveActiveToolbar(NAME_MAIN_PANEL), _panelStateForced(false),
_canBeAspectScaled(false), _scalersChanged(false), _saveToolbarState(false),
_mouseBackupOld(NULL), _mouseBackupDim(0), _mouseBackupToolbar(NULL),
- _usesEmulatedMouse(false), _forceHideMouse(false), _hasfocus(true),
- _zoomUp(false), _zoomDown(false) {
+ _usesEmulatedMouse(false), _forceHideMouse(false), _freeLook(false),
+ _hasfocus(true), _zoomUp(false), _zoomDown(false) {
memset(&_mouseCurState, 0, sizeof(_mouseCurState));
if (_isSmartphone) {
_mouseCurState.x = 20;
@@ -149,7 +149,7 @@ void WINCESdlGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
return;
default:
- SdlGraphicsManager::setFeatureState(f, enable);
+ SurfaceSdlGraphicsManager::setFeatureState(f, enable);
}
}
@@ -160,7 +160,7 @@ bool WINCESdlGraphicsManager::getFeatureState(OSystem::Feature f) {
case OSystem::kFeatureVirtualKeyboard:
return (_panelStateForced);
default:
- return SdlGraphicsManager::getFeatureState(f);
+ return SurfaceSdlGraphicsManager::getFeatureState(f);
}
}
@@ -204,7 +204,7 @@ void WINCESdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelForm
_videoMode.overlayWidth = w;
_videoMode.overlayHeight = h;
- SdlGraphicsManager::initSize(w, h, format);
+ SurfaceSdlGraphicsManager::initSize(w, h, format);
if (_scalersChanged) {
unloadGFXMode();
@@ -444,7 +444,6 @@ void WINCESdlGraphicsManager::update_game_settings() {
// Skip
panel->add(NAME_ITEM_SKIP, new CEGUI::ItemAction(ITEM_SKIP, POCKET_ACTION_SKIP));
// sound
-//__XXX__ panel->add(NAME_ITEM_SOUND, new CEGUI::ItemSwitch(ITEM_SOUND_OFF, ITEM_SOUND_ON, &_soundMaster));
panel->add(NAME_ITEM_SOUND, new CEGUI::ItemSwitch(ITEM_SOUND_OFF, ITEM_SOUND_ON, &OSystem_WINCE3::_soundMaster));
// bind keys
@@ -479,6 +478,9 @@ void WINCESdlGraphicsManager::update_game_settings() {
if (ConfMan.hasKey("no_doubletap_rightclick"))
_noDoubleTapRMB = ConfMan.getBool("no_doubletap_rightclick");
+
+ if (ConfMan.hasKey("no_doubletap_paneltoggle"))
+ _noDoubleTapPT = ConfMan.getBool("no_doubletap_paneltoggle");
}
void WINCESdlGraphicsManager::internUpdateScreen() {
@@ -1186,7 +1188,7 @@ void WINCESdlGraphicsManager::setMousePos(int x, int y) {
Graphics::Surface *WINCESdlGraphicsManager::lockScreen() {
// Make sure mouse pointer is not painted over the playfield at the time of locking
undrawMouse();
- return SdlGraphicsManager::lockScreen();
+ return SurfaceSdlGraphicsManager::lockScreen();
}
void WINCESdlGraphicsManager::showOverlay() {
@@ -1294,7 +1296,7 @@ void WINCESdlGraphicsManager::warpMouse(int x, int y) {
}
void WINCESdlGraphicsManager::unlockScreen() {
- SdlGraphicsManager::unlockScreen();
+ SurfaceSdlGraphicsManager::unlockScreen();
}
void WINCESdlGraphicsManager::internDrawMouse() {
@@ -1469,7 +1471,7 @@ void WINCESdlGraphicsManager::addDirtyRect(int x, int y, int w, int h, bool mous
if (_forceFull || _paletteDirtyEnd)
return;
- SdlGraphicsManager::addDirtyRect(x, y, w, h, false);
+ SurfaceSdlGraphicsManager::addDirtyRect(x, y, w, h, false);
}
void WINCESdlGraphicsManager::swap_panel_visibility() {
@@ -1600,6 +1602,19 @@ void WINCESdlGraphicsManager::swap_mouse_visibility() {
undrawMouse();
}
+void WINCESdlGraphicsManager::init_panel() {
+ _panelVisible = true;
+ if (_panelInitialized) {
+ _toolbarHandler.setVisible(true);
+ _toolbarHandler.setActive(NAME_MAIN_PANEL);
+ }
+}
+
+void WINCESdlGraphicsManager::reset_panel() {
+ _panelVisible = false;
+ _toolbarHandler.setVisible(false);
+}
+
// Smartphone actions
void WINCESdlGraphicsManager::initZones() {
int i;
@@ -1627,6 +1642,14 @@ void WINCESdlGraphicsManager::create_toolbar() {
_toolbarHandler.setVisible(false);
}
+void WINCESdlGraphicsManager::swap_freeLook() {
+ _freeLook = !_freeLook;
+}
+
+bool WINCESdlGraphicsManager::getFreeLookState() {
+ return _freeLook;
+}
+
WINCESdlGraphicsManager::zoneDesc WINCESdlGraphicsManager::_zones[TOTAL_ZONES] = {
{ 0, 0, 320, 145 },
{ 0, 145, 150, 55 },
diff --git a/backends/graphics/wincesdl/wincesdl-graphics.h b/backends/graphics/wincesdl/wincesdl-graphics.h
index b3a8d66f51..92894e0dcd 100644
--- a/backends/graphics/wincesdl/wincesdl-graphics.h
+++ b/backends/graphics/wincesdl/wincesdl-graphics.h
@@ -23,7 +23,7 @@
#ifndef BACKENDS_GRAPHICS_WINCE_SDL_H
#define BACKENDS_GRAPHICS_WINCE_SDL_H
-#include "backends/graphics/sdl/sdl-graphics.h"
+#include "backends/graphics/surfacesdl/surfacesdl-graphics.h"
#include "backends/platform/wince/CEgui/CEGUI.h"
// Internal GUI names
@@ -39,7 +39,7 @@
extern bool _hasSmartphoneResolution;
-class WINCESdlGraphicsManager : public SdlGraphicsManager {
+class WINCESdlGraphicsManager : public SurfaceSdlGraphicsManager {
public:
WINCESdlGraphicsManager(SdlEventSource *sdlEventSource);
@@ -56,6 +56,8 @@ public:
void unloadGFXMode();
bool hotswapGFXMode();
+ void update_game_settings();
+
// Overloaded from SDL backend (toolbar handling)
void drawMouse();
// Overloaded from SDL backend (new scaler handling)
@@ -88,7 +90,10 @@ public:
void swap_zoom_up();
void swap_zoom_down();
void swap_mouse_visibility();
-
+ void init_panel();
+ void reset_panel();
+ void swap_freeLook();
+ bool getFreeLookState();
//#ifdef WIN32_PLATFORM_WFSP
void move_cursor_up();
@@ -96,7 +101,6 @@ public:
void move_cursor_left();
void move_cursor_right();
- void retrieve_mouse_location(int &x, int &y);
void switch_zone();
void add_right_click(bool pushed);
@@ -106,8 +110,14 @@ public:
void smartphone_rotate_display();
//#endif
+ bool hasPocketPCResolution();
+ bool hasDesktopResolution();
+ bool hasSquareQVGAResolution();
+ bool hasWideResolution() const;
+
bool _panelInitialized; // only initialize the toolbar once
bool _noDoubleTapRMB; // disable double tap -> rmb click
+ bool _noDoubleTapPT; // disable double tap for toolbar toggling
CEGUI::ToolbarHandler _toolbarHandler;
@@ -122,11 +132,6 @@ public:
bool _hasfocus; // scummvm has the top window
- bool hasPocketPCResolution();
- bool hasDesktopResolution();
- bool hasSquareQVGAResolution();
- bool hasWideResolution() const;
-
MousePos _mouseCurState;
bool _zoomUp; // zooming up mode
@@ -158,8 +163,8 @@ protected:
private:
bool update_scalers();
- void update_game_settings();
void drawToolbarMouse(SDL_Surface *surf, bool draw);
+ void retrieve_mouse_location(int &x, int &y);
void create_toolbar();
bool _panelVisible; // panel visibility
@@ -186,6 +191,7 @@ private:
uint16 _mouseBackupDim;
bool _forceHideMouse; // force invisible mouse cursor
+ bool _freeLook; // freeLook mode (do not send mouse button events)
// Smartphone specific variables
void loadDeviceConfigurationElement(Common::String element, int &value, int defaultValue);