1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #ifndef BACKENDS_GRAPHICS_NULL_H
24 #define BACKENDS_GRAPHICS_NULL_H
25 
26 #include "backends/graphics/graphics.h"
27 
28 static const OSystem::GraphicsMode s_noGraphicsModes[] = { {0, 0, 0} };
29 
30 class NullGraphicsManager : public GraphicsManager {
31 public:
~NullGraphicsManager()32 	virtual ~NullGraphicsManager() {}
33 
hasFeature(OSystem::Feature f)34 	bool hasFeature(OSystem::Feature f) const override { return false; }
setFeatureState(OSystem::Feature f,bool enable)35 	void setFeatureState(OSystem::Feature f, bool enable) override {}
getFeatureState(OSystem::Feature f)36 	bool getFeatureState(OSystem::Feature f) const override { return false; }
37 
getSupportedGraphicsModes()38 	const OSystem::GraphicsMode *getSupportedGraphicsModes() const override { return s_noGraphicsModes; }
getDefaultGraphicsMode()39 	int getDefaultGraphicsMode() const override { return 0; }
setGraphicsMode(int mode)40 	bool setGraphicsMode(int mode) override { return true; }
resetGraphicsScale()41 	void resetGraphicsScale() override {}
getGraphicsMode()42 	int getGraphicsMode() const override { return 0; }
getScreenFormat()43 	inline Graphics::PixelFormat getScreenFormat() const override {
44 		return Graphics::PixelFormat::createFormatCLUT8();
45 	}
getSupportedFormats()46 	inline Common::List<Graphics::PixelFormat> getSupportedFormats() const override {
47 		Common::List<Graphics::PixelFormat> list;
48 		list.push_back(Graphics::PixelFormat::createFormatCLUT8());
49 		return list;
50 	}
51 	void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) override {}
getScreenChangeID()52 	virtual int getScreenChangeID() const override { return 0; }
53 
beginGFXTransaction()54 	void beginGFXTransaction() override {}
endGFXTransaction()55 	OSystem::TransactionError endGFXTransaction() override { return OSystem::kTransactionSuccess; }
56 
getHeight()57 	int16 getHeight() const override { return 0; }
getWidth()58 	int16 getWidth() const override { return 0; }
setPalette(const byte * colors,uint start,uint num)59 	void setPalette(const byte *colors, uint start, uint num) override {}
grabPalette(byte * colors,uint start,uint num)60 	void grabPalette(byte *colors, uint start, uint num) const override {}
copyRectToScreen(const void * buf,int pitch,int x,int y,int w,int h)61 	void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override {}
lockScreen()62 	Graphics::Surface *lockScreen() override { return NULL; }
unlockScreen()63 	void unlockScreen() override {}
fillScreen(uint32 col)64 	void fillScreen(uint32 col) override {}
updateScreen()65 	void updateScreen() override {}
setShakePos(int shakeXOffset,int shakeYOffset)66 	void setShakePos(int shakeXOffset, int shakeYOffset) override {}
setFocusRectangle(const Common::Rect & rect)67 	void setFocusRectangle(const Common::Rect& rect) override {}
clearFocusRectangle()68 	void clearFocusRectangle() override {}
69 
showOverlay()70 	void showOverlay() override {}
hideOverlay()71 	void hideOverlay() override {}
getOverlayFormat()72 	Graphics::PixelFormat getOverlayFormat() const override { return Graphics::PixelFormat(); }
clearOverlay()73 	void clearOverlay() override {}
grabOverlay(void * buf,int pitch)74 	void grabOverlay(void *buf, int pitch) const override {}
copyRectToOverlay(const void * buf,int pitch,int x,int y,int w,int h)75 	void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override {}
getOverlayHeight()76 	int16 getOverlayHeight() const override { return 0; }
getOverlayWidth()77 	int16 getOverlayWidth() const override { return 0; }
78 
showMouse(bool visible)79 	bool showMouse(bool visible) override { return !visible; }
warpMouse(int x,int y)80 	void warpMouse(int x, int y) override {}
81 	void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL) override {}
setCursorPalette(const byte * colors,uint start,uint num)82 	void setCursorPalette(const byte *colors, uint start, uint num) override {}
83 };
84 
85 #endif
86