aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Marzini2010-07-05 01:10:29 +0000
committerAlejandro Marzini2010-07-05 01:10:29 +0000
commit3c607ef28958a155802ac77af5fa87e04fbe170e (patch)
tree7b1a8ca29db499ea87e975c6817662d48c97ef18
parent86fbe02933a7007bf6cc24bb63eb2b0c705a22ab (diff)
downloadscummvm-rg350-3c607ef28958a155802ac77af5fa87e04fbe170e.tar.gz
scummvm-rg350-3c607ef28958a155802ac77af5fa87e04fbe170e.tar.bz2
scummvm-rg350-3c607ef28958a155802ac77af5fa87e04fbe170e.zip
Cleanup and documentation.
svn-id: r50667
-rw-r--r--backends/graphics/gp2xsdl/gp2xsdl-graphics.h2
-rw-r--r--backends/graphics/graphics.h4
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp8
-rw-r--r--backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h3
-rw-r--r--backends/graphics/sdl/sdl-graphics.cpp4
-rw-r--r--backends/graphics/sdl/sdl-graphics.h86
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.cpp6
-rw-r--r--backends/graphics/symbiansdl/symbiansdl-graphics.h13
-rw-r--r--engines/groovie/script.h4
9 files changed, 73 insertions, 57 deletions
diff --git a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
index fd411dc9e3..776a9b1a0f 100644
--- a/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
+++ b/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
@@ -30,8 +30,6 @@
class GP2XSdlGraphicsManager : public SdlGraphicsManager {
public:
- GP2XSdlGraphicsManager();
- virtual ~GP2XSdlGraphicsManager() {}
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
diff --git a/backends/graphics/graphics.h b/backends/graphics/graphics.h
index 6037bb10e3..fd50631054 100644
--- a/backends/graphics/graphics.h
+++ b/backends/graphics/graphics.h
@@ -29,6 +29,10 @@
#include "common/system.h"
#include "common/noncopyable.h"
+/**
+ * Abstract class for graphics manager. Subclasses
+ * implement the real functionality.
+ */
class GraphicsManager : Common::NonCopyable {
public:
virtual ~GraphicsManager() {}
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
index 373bdc2346..390b27e5a5 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
@@ -45,14 +45,6 @@ static const OSystem::GraphicsMode s_supportedGraphicsModes[] = {
{0, 0, 0}
};
-LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager() {
-
-}
-
-LinuxmotoSdlGraphicsManager::~LinuxmotoSdlGraphicsManager() {
-
-}
-
const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
return s_supportedGraphicsModes;
}
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
index 186e2a083b..ce24e23992 100644
--- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
+++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
@@ -30,9 +30,6 @@
class LinuxmotoSdlGraphicsManager : public SdlGraphicsManager {
public:
- LinuxmotoSdlGraphicsManager();
- virtual ~LinuxmotoSdlGraphicsManager();
-
virtual void initSize(uint w, uint h);
virtual void setGraphicsModeIntern();
virtual bool setGraphicsMode(int mode);
diff --git a/backends/graphics/sdl/sdl-graphics.cpp b/backends/graphics/sdl/sdl-graphics.cpp
index e5d4c7521b..51283f4494 100644
--- a/backends/graphics/sdl/sdl-graphics.cpp
+++ b/backends/graphics/sdl/sdl-graphics.cpp
@@ -1343,6 +1343,10 @@ void SdlGraphicsManager::setCursorPalette(const byte *colors, uint start, uint n
blitCursor();
}
+void SdlGraphicsManager::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+ blitCursor();
+}
void SdlGraphicsManager::setShakePos(int shake_pos) {
assert (_transactionMode == kTransactionNone);
diff --git a/backends/graphics/sdl/sdl-graphics.h b/backends/graphics/sdl/sdl-graphics.h
index 4db8c338df..10ed9a7c46 100644
--- a/backends/graphics/sdl/sdl-graphics.h
+++ b/backends/graphics/sdl/sdl-graphics.h
@@ -56,6 +56,7 @@ enum {
GFX_DOTMATRIX = 11
};
+
class AspectRatio {
int _kw, _kh;
public:
@@ -68,10 +69,13 @@ public:
int kh() const { return _kh; }
};
+/**
+ * SDL graphics manager
+ */
class SdlGraphicsManager : public GraphicsManager {
public:
SdlGraphicsManager();
- ~SdlGraphicsManager();
+ virtual ~SdlGraphicsManager();
virtual bool hasFeature(OSystem::Feature f);
virtual void setFeatureState(OSystem::Feature f, bool enable);
@@ -117,53 +121,79 @@ 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);
- virtual void disableCursorPalette(bool disable) {
- _cursorPaletteDisabled = disable;
- blitCursor();
- }
+ virtual void disableCursorPalette(bool disable);
#ifdef USE_OSD
virtual void displayMessageOnOSD(const char *msg);
#endif
+ /**
+ * Marks the screen for a full redraw
+ */
virtual void forceFullRedraw();
+ /**
+ * Handles the scalar hotkeys
+ */
virtual bool handleScalerHotkeys(const SDL_KeyboardEvent &key);
+
+ /**
+ * Returns if the event passed is a hotkey for the graphics scalers
+ */
virtual bool isScalerHotkey(const Common::Event &event);
+ /**
+ * Adjusts mouse event coords for the current scaler
+ */
virtual void adjustMouseEvent(Common::Event &event);
+
+ /**
+ * Updates the mouse cursor position
+ */
virtual void setMousePos(int x, int y);
+
+ /**
+ * Toggles fullscreen
+ */
virtual void toggleFullScreen();
- virtual bool saveScreenshot(const char *filename); // overloaded by CE backend
+
+ /**
+ * Saves a screenshot to a file
+ */
+ virtual bool saveScreenshot(const char *filename);
protected:
#ifdef USE_OSD
+ /** Surface containing the OSD message */
SDL_Surface *_osdSurface;
- Uint8 _osdAlpha; // Transparency level of the OSD
- uint32 _osdFadeStartTime; // When to start the fade out
+ /** Transparency level of the OSD */
+ Uint8 _osdAlpha;
+ /** When to start the fade out */
+ uint32 _osdFadeStartTime;
+ /** Enum with OSD options */
enum {
- kOSDFadeOutDelay = 2 * 1000, // Delay before the OSD is faded out (in milliseconds)
- kOSDFadeOutDuration = 500, // Duration of the OSD fade out (in milliseconds)
- kOSDColorKey = 1,
- kOSDInitialAlpha = 80 // Initial alpha level, in percent
+ kOSDFadeOutDelay = 2 * 1000, /** < Delay before the OSD is faded out (in milliseconds) */
+ kOSDFadeOutDuration = 500, /** < Duration of the OSD fade out (in milliseconds) */
+ kOSDColorKey = 1, /** < Transparent color key */
+ kOSDInitialAlpha = 80 /** < Initial alpha level, in percent */
};
#endif
- // hardware screen
+ /** Hardware screen */
SDL_Surface *_hwscreen;
- // unseen game screen
+ /** Unseen game screen */
SDL_Surface *_screen;
#ifdef USE_RGB_COLOR
Graphics::PixelFormat _screenFormat;
Graphics::PixelFormat _cursorFormat;
#endif
- // temporary screen (for scalers)
+ /** Temporary screen (for scalers) */
SDL_Surface *_tmpscreen;
+ /** Temporary screen (for scalers) */
SDL_Surface *_tmpscreen2;
- // overlay
SDL_Surface *_overlayscreen;
bool _overlayVisible;
Graphics::PixelFormat _overlayFormat;
@@ -204,9 +234,7 @@ protected:
};
VideoState _videoMode, _oldVideoMode;
- virtual void setGraphicsModeIntern(); // overloaded by CE backend
-
- // Force full redraw on next updateScreen
+ /** Force full redraw on next updateScreen */
bool _forceFull;
ScalerProc *_scalerProc;
@@ -256,7 +284,7 @@ protected:
bool _mouseNeedsRedraw;
byte *_mouseData;
SDL_Rect _mouseBackup;
- MousePos _mouseCurState; // Move to events?
+ MousePos _mouseCurState;
#ifdef USE_RGB_COLOR
uint32 _mouseKeyColor;
#else
@@ -287,22 +315,24 @@ protected:
*/
OSystem::MutexRef _graphicsMutex;
- virtual void addDirtyRect(int x, int y, int w, int h, bool realCoordinates = false); // overloaded by CE backend
+ virtual void addDirtyRect(int x, int y, int w, int h, bool realCoordinates = false);
- virtual void drawMouse(); // overloaded by CE backend
- virtual void undrawMouse(); // overloaded by CE backend (FIXME)
- virtual void blitCursor(); // overloaded by CE backend (FIXME)
+ virtual void drawMouse();
+ virtual void undrawMouse();
+ virtual void blitCursor();
- virtual void internUpdateScreen(); // overloaded by CE backend
+ virtual void internUpdateScreen();
- virtual bool loadGFXMode(); // overloaded by CE backend
- virtual void unloadGFXMode(); // overloaded by CE backend
- virtual bool hotswapGFXMode(); // overloaded by CE backend
+ virtual bool loadGFXMode();
+ virtual void unloadGFXMode();
+ virtual bool hotswapGFXMode();
virtual void setFullscreenMode(bool enable);
virtual void setAspectRatioCorrection(bool enable);
virtual int effectiveScreenHeight() const;
+
+ virtual void setGraphicsModeIntern();
};
#endif
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
index 9dc691f38b..c89c46ddd8 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
@@ -28,12 +28,6 @@
#include "backends/graphics/symbiansdl/symbiansdl-graphics.h"
#include "backends/platform/symbian/src/SymbianActions.h"
-SdlGraphicsManager::SdlGraphicsManager() {
-}
-
-SdlGraphicsManager::~SdlGraphicsManager() {
-}
-
int SymbianSdlGraphicsManager::getDefaultGraphicsMode() const {
return GFX_NORMAL;
}
diff --git a/backends/graphics/symbiansdl/symbiansdl-graphics.h b/backends/graphics/symbiansdl/symbiansdl-graphics.h
index 563f7f1a1c..b0e87c8025 100644
--- a/backends/graphics/symbiansdl/symbiansdl-graphics.h
+++ b/backends/graphics/symbiansdl/symbiansdl-graphics.h
@@ -30,15 +30,12 @@
class SymbianSdlGraphicsManager : public SdlGraphicsManager {
public:
- SymbianSdlGraphicsManager ();
- ~SymbianSdlGraphicsManager ();
+ virtual bool hasFeature(OSystem::Feature f);
+ virtual void setFeatureState(OSystem::Feature f, bool enable);
- bool hasFeature(OSystem::Feature f);
- void setFeatureState(OSystem::Feature f, bool enable);
-
- const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
- int getDefaultGraphicsMode() const;
- bool setGraphicsMode(int mode);
+ virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
+ virtual int getDefaultGraphicsMode() const;
+ virtual bool setGraphicsMode(int mode);
};
#endif
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index df6c8dfe67..cda87a8917 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -30,11 +30,11 @@
#include "common/rect.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Graphics {
- struct Surface;
+struct Surface;
}
namespace Groovie {