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[Graphics::PALETTE_SIZE];
53  byte _rawPalette[Graphics::PALETTE_SIZE];
54  byte _savedPalettes[2][Graphics::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 
66  void updatePalette();
67 public:
68  int _vesaMode;
69  int _startColor, _numColors;
70  Common::Point _bufferStart;
71  int _windowXAdd, _windowYAdd; // the offset between the screen and the 2 buffers
72  int _screenYOff;
73  byte _manPal[0x84];
74  byte _stilPal[99]; // only used in Noctropolis
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(const 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 
121  void forceFadeWhite();
122 
123  void fadeOut() { forceFadeOut(); }
124  void fadeIn() { forceFadeIn(); }
125  void clearScreen();
126 
130  void fadeOutThenClearAndSetPal();
131 
135  void copyRawPalToTempPal();
136 
140  void setInitialPalettte();
141 
145  void setIconPalette();
146 
150  void setManPalette();
151 
155  void setStilPalette();
156 
160  void setDarkPalette(int16 mulValue, uint firstIndex, uint count);
161 
162  void loadPalette(int fileNum, int subfile, int srcOffset = 0);
163 
164  void setPalette();
165 
166  void setRawPalette(const Graphics::Palette &p);
167 
168  void loadRawPalette(Common::SeekableReadStream *stream);
169 
170  void savePalette();
171 
172  void restorePalette();
173 
174  void getPalette(byte *pal);
175 
176  void flashPalette(int step);
177 
181  void copyBuffer(const byte *data);
182 
183  void setBufferScan();
184 
185  void setScaleTable(int scale);
186 
190  void saveScreen();
191 
195  void restoreScreen();
196 
197  void setPaletteCycle(int startCycle, int endCycle, int timer);
198 
199  void cyclePaletteForward();
200 
201  void cyclePaletteBackwards();
202 
207  void clearColor0();
208 };
209 
210 } // End of namespace Access
211 
212 #endif /* ACCESS_SCREEN_H */
Definition: managed_surface.h:51
Definition: screen.h:35
Definition: access.h:141
Definition: rect.h:524
Definition: stream.h:745
Definition: asurface.h:42
Definition: rect.h:144
Simple class for handling a palette data.
Definition: palette.h:61
Definition: access.h:62
Definition: screen.h:49