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
28public:
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, const Graphics::PixelFormat *format, const byte *mask, frac_t scaleX, frac_t scaleY) override {}
90 void setCursorPalette(const byte *colors, uint start, uint num) override {}
91
92private:
93 uint _width, _height;
95 bool _overlayVisible;
96};
97
98#endif
Definition: list.h:44
void push_back(const t_T &element)
Definition: list.h:174
Definition: graphics.h:38
Definition: null-graphics.h:27
void grabPalette(byte *colors, uint start, uint num) const override
Definition: null-graphics.h:66
void setPalette(const byte *colors, uint start, uint num) override
Definition: null-graphics.h:65
int32 frac_t
Definition: frac.h:52
Feature
Definition: system.h:415
TransactionError
Definition: system.h:1188
@ kTransactionSuccess
Definition: system.h:1189
Definition: rect.h:536
Definition: pixelformat.h:138
static constexpr PixelFormat createFormatCLUT8()
Definition: pixelformat.h:184
Definition: surface.h:67