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/pixelformat.h"
27 #include "common/list.h"
28 #include "common/rect.h"
29 
30 namespace Graphics {
31 
41 #define PALETTE_COUNT 256
42 #define PALETTE_SIZE (256 * 3)
43 
50 class Screen : public ManagedSurface {
51 protected:
56 protected:
60  void mergeDirtyRects();
61 
65  bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2);
66 public:
67  Screen();
68  Screen(int width, int height);
69  Screen(int width, int height, PixelFormat pixelFormat);
70 
74  bool isDirty() const { return !_dirtyRects.empty(); }
75 
80  void makeAllDirty();
81 
85  virtual void clearDirtyRects() { _dirtyRects.clear(); }
86 
91  virtual void addDirtyRect(const Common::Rect &r);
92 
96  virtual void update();
97 
101  virtual void updateScreen();
102 
106  void getPalette(byte palette[PALETTE_SIZE]);
107 
111  void getPalette(byte *palette, uint start, uint num);
112 
116  void setPalette(const byte palette[PALETTE_SIZE]);
117 
121  void setPalette(const byte *palette, uint start, uint num);
122 
126  void clearPalette();
127 };
129 } // End of namespace Graphics
130 
131 #endif
Definition: managed_surface.h:51
bool isDirty() const
Definition: screen.h:74
void mergeDirtyRects()
Definition: pixelformat.h:138
void setPalette(const byte palette[(256 *3)])
virtual void clearDirtyRects()
Definition: screen.h:85
Definition: rect.h:144
Definition: screen.h:50
virtual void addDirtyRect(const Common::Rect &r)
Common::List< Common::Rect > _dirtyRects
Definition: screen.h:55
bool unionRectangle(Common::Rect &destRect, const Common::Rect &src1, const Common::Rect &src2)
Definition: formatinfo.h:28
virtual void update()
void clear()
Definition: list.h:205
virtual void updateScreen()
bool empty() const
Definition: list.h:218
void getPalette(byte palette[(256 *3)])