ScummVM API documentation
screen.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 GRAPHICS_SCREEN_H
23#define GRAPHICS_SCREEN_H
24
25#include "graphics/managed_surface.h"
26#include "graphics/dirtyrects.h"
27#include "graphics/palette.h"
28#include "graphics/pixelformat.h"
29
30namespace Graphics {
31
47class Screen : public ManagedSurface {
48protected:
53
54public:
55 Screen();
56 Screen(int width, int height);
57 Screen(int width, int height, PixelFormat pixelFormat);
58
62 bool isDirty() const { return !_dirtyRects.empty(); }
63
69
73 void clearDirtyRects() override { _dirtyRects.clear(); }
74
79 void addDirtyRect(const Common::Rect &r) override;
80
84 virtual void update();
85
89 virtual void updateScreen();
90
94 void getPalette(byte palette[PALETTE_SIZE]);
95
99 void getPalette(byte *palette, uint start, uint num);
100
104 Graphics::Palette getPalette(uint start = 0, uint num = PALETTE_COUNT) {
105 byte tmp[PALETTE_SIZE];
106 getPalette(tmp, start, num);
107 return Graphics::Palette(tmp, num);
108 }
109
113 void setPalette(const byte palette[PALETTE_SIZE]);
114
118 void setPalette(const byte *palette, uint start, uint num);
119
123 void setPalette(const Graphics::Palette &pal, uint start = 0) {
124 setPalette(pal.data(), start, pal.size());
125 }
126
131};
133} // End of namespace Graphics
134
135#endif
Definition: dirtyrects.h:43
bool empty() const
Definition: dirtyrects.h:68
void clear()
Definition: dirtyrects.h:73
Definition: managed_surface.h:51
Simple class for handling a palette data.
Definition: palette.h:61
Definition: screen.h:47
void setPalette(const Graphics::Palette &pal, uint start=0)
Definition: screen.h:123
void getPalette(byte *palette, uint start, uint num)
Graphics::Palette getPalette(uint start=0, uint num=PALETTE_COUNT)
Definition: screen.h:104
void setPalette(const byte palette[PALETTE_SIZE])
virtual void updateScreen()
void clearDirtyRects() override
Definition: screen.h:73
void addDirtyRect(const Common::Rect &r) override
void setPalette(const byte *palette, uint start, uint num)
bool isDirty() const
Definition: screen.h:62
virtual void update()
DirtyRectList _dirtyRects
Definition: screen.h:52
void getPalette(byte palette[PALETTE_SIZE])
Definition: formatinfo.h:28
constexpr int PALETTE_COUNT
Definition: palette.h:42
Definition: rect.h:536
Definition: pixelformat.h:138