[Scummvm-cvs-logs] SF.net SVN: scummvm:[49528] scummvm/branches/gsoc2010-opengl/backends
vgvgf at users.sourceforge.net
vgvgf at users.sourceforge.net
Wed Jun 9 01:44:05 CEST 2010
Revision: 49528
http://scummvm.svn.sourceforge.net/scummvm/?rev=49528&view=rev
Author: vgvgf
Date: 2010-06-08 23:44:05 +0000 (Tue, 08 Jun 2010)
Log Message:
-----------
Renamed and moved DefaultGraphicsManager to NullGraphicsManager. Added pure virtual class GraphicsManager.
Modified Paths:
--------------
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/module.mk
Added Paths:
-----------
scummvm/branches/gsoc2010-opengl/backends/graphics/abstract-graphics.h
scummvm/branches/gsoc2010-opengl/backends/graphics/null/
scummvm/branches/gsoc2010-opengl/backends/graphics/null/null-graphics.h
Removed Paths:
-------------
scummvm/branches/gsoc2010-opengl/backends/graphics/default/
Added: scummvm/branches/gsoc2010-opengl/backends/graphics/abstract-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/abstract-graphics.h (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/abstract-graphics.h 2010-06-08 23:44:05 UTC (rev 49528)
@@ -0,0 +1,70 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_ABSTRACT_H
+#define BACKENDS_GRAPHICS_ABSTRACT_H
+
+#include "common/system.h"
+#include "common/noncopyable.h"
+
+class GraphicsManager : Common::NonCopyable {
+public:
+ virtual ~GraphicsManager() {}
+
+ virtual bool hasFeature(OSystem::Feature f) = 0;
+ virtual void setFeatureState(OSystem::Feature f, bool enable) = 0;
+ virtual bool getFeatureState(OSystem::Feature f) = 0;
+
+ virtual const OSystem::GraphicsMode *getSupportedGraphicsModes() const = 0;
+ virtual int getDefaultGraphicsMode() const = 0;
+ virtual bool setGraphicsMode(int mode) = 0;
+ virtual int getGraphicsMode() const = 0;
+ virtual Graphics::PixelFormat getScreenFormat() const = 0;
+ virtual Common::List<Graphics::PixelFormat> getSupportedFormats() = 0;
+ virtual void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) = 0;
+ virtual int16 getHeight() = 0;
+ virtual int16 getWidth() = 0;
+ virtual void setPalette(const byte *colors, uint start, uint num) = 0;
+ virtual void grabPalette(byte *colors, uint start, uint num) = 0;
+ virtual void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) = 0;
+ virtual Graphics::Surface *lockScreen() = 0;
+ virtual void unlockScreen() = 0;
+ virtual void fillScreen(uint32 col) = 0;
+ virtual void updateScreen() = 0;
+ virtual void setShakePos(int shakeOffset) = 0;
+ virtual void showOverlay() = 0;
+ virtual void hideOverlay() = 0;
+ virtual Graphics::PixelFormat getOverlayFormat() const = 0;
+ virtual void clearOverlay() = 0;
+ virtual void grabOverlay(OverlayColor *buf, int pitch) = 0;
+ virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h)= 0;
+ virtual int16 getOverlayHeight() = 0;
+ virtual int16 getOverlayWidth() = 0;
+ virtual bool showMouse(bool visible) = 0;
+ virtual void warpMouse(int x, int y) = 0;
+ virtual void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) = 0;
+};
+
+#endif
Property changes on: scummvm/branches/gsoc2010-opengl/backends/graphics/abstract-graphics.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:eol-style
+ native
Added: scummvm/branches/gsoc2010-opengl/backends/graphics/null/null-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/null/null-graphics.h (rev 0)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/null/null-graphics.h 2010-06-08 23:44:05 UTC (rev 49528)
@@ -0,0 +1,77 @@
+/* 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.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef BACKENDS_GRAPHICS_NULL_H
+#define BACKENDS_GRAPHICS_NULL_H
+
+#include "backends/graphics/abstract-graphics.h"
+
+static const OSystem::GraphicsMode s_noGraphicsModes[] = { {0, 0, 0} };
+
+class NullGraphicsManager : GraphicsManager {
+public:
+ ~NullGraphicsManager() {}
+
+ bool hasFeature(OSystem::Feature f) { return false; }
+ void setFeatureState(OSystem::Feature f, bool enable) {}
+ bool getFeatureState(OSystem::Feature f) { return false; }
+
+ const OSystem::GraphicsMode *getSupportedGraphicsModes() { return s_noGraphicsModes; }
+ int getDefaultGraphicsMode() { return 0; }
+ bool setGraphicsMode(int mode) { return true; }
+ int getGraphicsMode() { return 0; }
+ inline Graphics::PixelFormat getScreenFormat() const {
+ return Graphics::PixelFormat::createFormatCLUT8();
+ };
+ inline Common::List<Graphics::PixelFormat> getSupportedFormats() const {
+ Common::List<Graphics::PixelFormat> list;
+ list.push_back(Graphics::PixelFormat::createFormatCLUT8());
+ return list;
+ };
+ void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) {}
+ int16 getHeight() { return 0; }
+ int16 getWidth() { return 0; }
+ void setPalette(const byte *colors, uint start, uint num) {}
+ void grabPalette(byte *colors, uint start, uint num) {}
+ void copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {}
+ Graphics::Surface *lockScreen() { return NULL; }
+ void unlockScreen() {}
+ void fillScreen(uint32 col) {}
+ void updateScreen() {}
+ void setShakePos(int shakeOffset) {}
+ void showOverlay() {}
+ void hideOverlay() {}
+ Graphics::PixelFormat getOverlayFormat() { return Graphics::PixelFormat(); }
+ void clearOverlay() {}
+ void grabOverlay(OverlayColor *buf, int pitch) {}
+ void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {}
+ int16 getOverlayHeight() { return 0; }
+ int16 getOverlayWidth() { return 0; }
+ bool showMouse(bool visible) { return !visible; }
+ void warpMouse(int x, int y) {}
+ void setMouseCursor(const byte *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, int cursorTargetScale = 1, const Graphics::PixelFormat *format = NULL) {}
+};
+
+#endif
Property changes on: scummvm/branches/gsoc2010-opengl/backends/graphics/null/null-graphics.h
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:keywords
+ Date Rev Author URL Id
Added: svn:eol-style
+ native
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp 2010-06-08 23:32:53 UTC (rev 49527)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.cpp 2010-06-08 23:44:05 UTC (rev 49528)
@@ -1193,6 +1193,13 @@
g_system->unlockMutex(_graphicsMutex);
}
+void SdlGraphicsManager::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) {
if (_forceFull)
return;
@@ -1966,7 +1973,7 @@
// Ctrl-Alt-a toggles aspect ratio correction
if (key.keysym.sym == 'a') {
beginGFXTransaction();
- setGraphicsFeatureState(OSystem::kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection);
+ setFeatureState(OSystem::kFeatureAspectRatioCorrection, !_videoMode.aspectRatioCorrection);
endGFXTransaction();
#ifdef USE_OSD
char buffer[128];
Modified: scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h 2010-06-08 23:32:53 UTC (rev 49527)
+++ scummvm/branches/gsoc2010-opengl/backends/graphics/sdl/sdl-graphics.h 2010-06-08 23:44:05 UTC (rev 49528)
@@ -26,7 +26,7 @@
#ifndef BACKENDS_GRAPHICS_SDL_H
#define BACKENDS_GRAPHICS_SDL_H
-#include "backends/graphics/default/default-graphics.h"
+#include "backends/graphics/abstract-graphics.h"
#include "common/system.h"
#include "graphics/scaler.h"
@@ -68,7 +68,7 @@
int kh() const { return _kh; }
};
-class SdlGraphicsManager : public DefaultGraphicsManager {
+class SdlGraphicsManager : public GraphicsManager {
public:
SdlGraphicsManager();
~SdlGraphicsManager();
@@ -306,5 +306,4 @@
int effectiveScreenHeight() const;
};
-
#endif
Modified: scummvm/branches/gsoc2010-opengl/backends/module.mk
===================================================================
--- scummvm/branches/gsoc2010-opengl/backends/module.mk 2010-06-08 23:32:53 UTC (rev 49527)
+++ scummvm/branches/gsoc2010-opengl/backends/module.mk 2010-06-08 23:44:05 UTC (rev 49528)
@@ -17,7 +17,6 @@
fs/wii/wii-fs-factory.o \
fs/n64/n64-fs-factory.o \
fs/n64/romfsstream.o \
- graphics/default/default-graphics.o \
graphics/sdl/sdl-graphics.o \
keymapper/action.o \
keymapper/keymap.o \
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