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 ACCESS_SCREEN_H
23 #define ACCESS_SCREEN_H
24 
25 #include "common/scummsys.h"
26 #include "common/rect.h"
27 #include "common/stream.h"
28 #include "graphics/screen.h"
29 #include "access/asurface.h"
30 
31 namespace Access {
32 
33 class AccessEngine;
34 
35 struct ScreenSave {
36  int _clipWidth;
37  int _clipHeight;
38  int _windowXAdd;
39  int _windowYAdd;
40  Common::Point _scroll;
41  int _scrollCol;
42  int _scrollRow;
43  Common::Point _bufferStart;
44  int _screenYOff;
45 
46  ScreenSave();
47 };
48 
49 class Screen : public BaseSurface {
50 private:
51  AccessEngine *_vm;
52  byte _tempPalette[PALETTE_SIZE];
53  byte _rawPalette[PALETTE_SIZE];
54  byte _savedPalettes[2][PALETTE_SIZE];
55  int _savedPaletteCount;
56  int _vesaCurrentWin;
57  int _currentPanel;
58  Common::Point _msVirtualOffset;
59  Common::Point _virtualOffsetsTable[4];
60  bool _hideFlag;
61  ScreenSave _screenSave;
62  int _startCycle;
63  int _cycleStart;
64  int _endCycle;
65  Common::List<Common::Rect> _dirtyRects;
66 
67  void updatePalette();
68 public:
69  int _vesaMode;
70  int _startColor, _numColors;
71  Common::Point _bufferStart;
72  int _windowXAdd, _windowYAdd;
73  int _screenYOff;
74  byte _manPal[0x60];
75  byte _scaleTable1[256];
76  byte _scaleTable2[256];
77  int _vWindowWidth;
78  int _vWindowHeight;
79  int _vWindowBytesWide;
80  int _bufferBytesWide;
81  int _vWindowLinesTall;
82  bool _screenChangeFlag;
83  bool _fadeIn;
84 public:
88  void update() override;
89 
90  void copyBlock(BaseSurface *src, const Common::Rect &bounds) override;
91 
92  void restoreBlock() override;
93 
94  void drawRect() override;
95 
96  void drawBox() override;
97 
98  void copyBuffer(Graphics::ManagedSurface *src) override;
99 public:
100  Screen(AccessEngine *vm);
101 
102  ~Screen() override {}
103 
104  void setDisplayScan();
105 
106  void setPanel(int num);
107 
111  void forceFadeOut();
112 
116  void forceFadeIn();
117 
118  void fadeOut() { forceFadeOut(); }
119  void fadeIn() { forceFadeIn(); }
120  void clearScreen();
121 
125  void setInitialPalettte();
126 
130  void setIconPalette();
131 
135  void setManPalette();
136 
137  void loadPalette(int fileNum, int subfile);
138 
139  void setPalette();
140 
141  void loadRawPalette(Common::SeekableReadStream *stream);
142 
143  void savePalette();
144 
145  void restorePalette();
146 
147  void getPalette(byte *pal);
148 
149  void flashPalette(int count);
150 
154  void copyBuffer(const byte *data);
155 
156  void setBufferScan();
157 
158  void setScaleTable(int scale);
159 
163  void saveScreen();
164 
168  void restoreScreen();
169 
170  void setPaletteCycle(int startCycle, int endCycle, int timer);
171 
172  void cyclePaletteForward();
173 
174  void cyclePaletteBackwards();
175 };
176 
177 } // End of namespace Access
178 
179 #endif /* ACCESS_SCREEN_H */
Definition: managed_surface.h:51
Definition: screen.h:35
Definition: access.h:84
Definition: rect.h:144
Definition: stream.h:745
Definition: asurface.h:42
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: rect.h:45
Definition: access.h:62
Definition: screen.h:49