[Scummvm-cvs-logs] SF.net SVN: scummvm:[50667] scummvm/branches/gsoc2010-opengl
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Mon Jul 5 03:10:29 CEST 2010
Revision: 50667
http://scummvm.svn.sourceforge.net/scummvm/?rev=50667&view=rev
Author: vgvgf
Date: 2010-07-05 01:10:29 +0000 (Mon, 05 Jul 2010)
Log Message:
-----------
Cleanup and documentation.
Modified Paths:
--------------
scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.h
scummvm/branches/gsoc2010-opengl/engines/groovie/script.h
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/gp2xsdl/gp2xsdl-graphics.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -30,8 +30,6 @@
class GP2XSdlGraphicsManager : public SdlGraphicsManager {
public:
- GP2XSdlGraphicsManager();
- virtual ~GP2XSdlGraphicsManager() {}
virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const;
virtual int getDefaultGraphicsMode() const;
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/graphics.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/graphics.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -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() {}
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp 2010-07-05 01:10:29 UTC (rev 50667)
@@ -45,14 +45,6 @@
{0, 0, 0}
};
-LinuxmotoSdlGraphicsManager::LinuxmotoSdlGraphicsManager() {
-
-}
-
-LinuxmotoSdlGraphicsManager::~LinuxmotoSdlGraphicsManager() {
-
-}
-
const OSystem::GraphicsMode *LinuxmotoSdlGraphicsManager::getSupportedGraphicsModes() const {
return s_supportedGraphicsModes;
}
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -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);
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp 2010-07-05 01:10:29 UTC (rev 50667)
@@ -1343,6 +1343,10 @@
blitCursor();
}
+void SdlGraphicsManager::disableCursorPalette(bool disable) {
+ _cursorPaletteDisabled = disable;
+ blitCursor();
+}
void SdlGraphicsManager::setShakePos(int shake_pos) {
assert (_transactionMode == kTransactionNone);
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -56,6 +56,7 @@
GFX_DOTMATRIX = 11
};
+
class AspectRatio {
int _kw, _kh;
public:
@@ -68,10 +69,13 @@
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 @@
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 @@
};
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 @@
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 @@
*/
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
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.cpp 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.cpp 2010-07-05 01:10:29 UTC (rev 50667)
@@ -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;
}
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/symbiansdl/symbiansdl-graphics.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -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
Modified: scummvm/branches/gsoc2010-opengl/engines/groovie/script.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/engines/groovie/script.h 2010-07-05 01:03:52 UTC (rev 50666)
+++ scummvm/branches/gsoc2010-opengl/engines/groovie/script.h 2010-07-05 01:10:29 UTC (rev 50667)
@@ -30,11 +30,11 @@
#include "common/rect.h"
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Graphics {
- struct Surface;
+struct Surface;
}
namespace Groovie {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list