ScummVM API documentation
null-graphics.h
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 modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (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, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BACKENDS_GRAPHICS_NULL_H
23 #define BACKENDS_GRAPHICS_NULL_H
24 
25 #include "backends/graphics/graphics.h"
26 
28 public:
29  virtual ~NullGraphicsManager() {}
30 
31  bool hasFeature(OSystem::Feature f) const override { return false; }
32  void setFeatureState(OSystem::Feature f, bool enable) override {}
33  bool getFeatureState(OSystem::Feature f) const override { return false; }
34 
35 #ifdef USE_RGB_COLOR
36  Graphics::PixelFormat getScreenFormat() const override {
37  return _format;
38  }
39 
40  Common::List<Graphics::PixelFormat> getSupportedFormats() const override {
42  list.push_back(Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0)); // BBDoU, Frotz, HDB, Hopkins, Nuvie, Petka, Riven, Sherlock (3DO), Titanic, Tony, Ultima 4, Ultima 8, ZVision
43  list.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)); // Full Pipe, Gnap (little endian), Griffon, Groovie 2, SCI32 (HQ videos), Sludge, Sword25, Ultima 8, Wintermute
44  list.push_back(Graphics::PixelFormat(4, 8, 8, 8, 8, 0, 8, 16, 24)); // Gnap (big endian)
45  list.push_back(Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0)); // SCUMM HE99+, Last Express
46  list.push_back(Graphics::PixelFormat(2, 5, 5, 5, 1, 10, 5, 0, 15)); // Dragons
48  return list;
49  }
50 #endif
51 
52  void initSize(uint width, uint height, const Graphics::PixelFormat *format = NULL) override {
53  _width = width;
54  _height = height;
55  _format = format ? *format : Graphics::PixelFormat::createFormatCLUT8();
56  }
57 
58  int getScreenChangeID() const override { return 0; }
59 
60  void beginGFXTransaction() override {}
61  OSystem::TransactionError endGFXTransaction() override { return OSystem::kTransactionSuccess; }
62 
63  int16 getHeight() const override { return _height; }
64  int16 getWidth() const override { return _width; }
65  void setPalette(const byte *colors, uint start, uint num) override {}
66  void grabPalette(byte *colors, uint start, uint num) const override {}
67  void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) override {}
68  Graphics::Surface *lockScreen() override { return NULL; }
69  void unlockScreen() override {}
70  void fillScreen(uint32 col) override {}
71  void fillScreen(const Common::Rect &r, uint32 col) override {}
72  void updateScreen() override {}
73  void setShakePos(int shakeXOffset, int shakeYOffset) override {}
74  void setFocusRectangle(const Common::Rect& rect) override {}
75  void clearFocusRectangle() override {}
76 
77  void showOverlay(bool inGUI) override { _overlayVisible = true; }
78  void hideOverlay() override { _overlayVisible = false; }
79  bool isOverlayVisible() const override { return _overlayVisible; }
80  Graphics::PixelFormat getOverlayFormat() const override { return Graphics::PixelFormat(2, 5, 6, 5, 0, 11, 5, 0, 0); }
81  void clearOverlay() override {}
82  void grabOverlay(Graphics::Surface &surface) const override {}
83  void copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) override {}
84  int16 getOverlayHeight() const override { return _height; }
85  int16 getOverlayWidth() const override { return _width; }
86 
87  bool showMouse(bool visible) override { return !visible; }
88  void warpMouse(int x, int y) override {}
89  void setMouseCursor(const void *buf, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor, bool dontScale = false, const Graphics::PixelFormat *format = NULL, const byte *mask = NULL) override {}
90  void setCursorPalette(const byte *colors, uint start, uint num) override {}
91 
92 private:
93  uint _width, _height;
94  Graphics::PixelFormat _format;
95  bool _overlayVisible;
96 };
97 
98 #endif
Definition: surface.h:67
Definition: pixelformat.h:138
Feature
Definition: system.h:403
Definition: list.h:44
Definition: rect.h:144
void grabPalette(byte *colors, uint start, uint num) const override
Definition: null-graphics.h:66
Definition: null-graphics.h:27
void setPalette(const byte *colors, uint start, uint num) override
Definition: null-graphics.h:65
TransactionError
Definition: system.h:1155
Definition: graphics.h:37
Definition: system.h:1156
void push_back(const t_T &element)
Definition: list.h:140
static PixelFormat createFormatCLUT8()
Definition: pixelformat.h:184