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;
72  int _screenYOff;
73  byte _manPal[0x60];
74  byte _scaleTable1[256];
75  byte _scaleTable2[256];
76  int _vWindowWidth;
77  int _vWindowHeight;
78  int _vWindowBytesWide;
79  int _bufferBytesWide;
80  int _vWindowLinesTall;
81  bool _screenChangeFlag;
82  bool _fadeIn;
83 public:
87  void update() override;
88 
89  void copyBlock(const BaseSurface *src, const Common::Rect &bounds) override;
90 
91  void restoreBlock() override;
92 
93  void drawRect() override;
94 
95  void drawBox() override;
96 
97  void copyBuffer(Graphics::ManagedSurface *src) override;
98 public:
99  Screen(AccessEngine *vm);
100 
101  ~Screen() override {}
102 
103  void setDisplayScan();
104 
105  void setPanel(int num);
106 
110  void forceFadeOut();
111 
115  void forceFadeIn();
116 
117  void fadeOut() { forceFadeOut(); }
118  void fadeIn() { forceFadeIn(); }
119  void clearScreen();
120 
124  void setInitialPalettte();
125 
129  void setIconPalette();
130 
134  void setManPalette();
135 
136  void loadPalette(int fileNum, int subfile, int srcOffset = 0);
137 
138  void setPalette();
139 
140  void loadRawPalette(Common::SeekableReadStream *stream);
141 
142  void savePalette();
143 
144  void restorePalette();
145 
146  void getPalette(byte *pal);
147 
148  void flashPalette(int step);
149 
153  void copyBuffer(const byte *data);
154 
155  void setBufferScan();
156 
157  void setScaleTable(int scale);
158 
162  void saveScreen();
163 
167  void restoreScreen();
168 
169  void setPaletteCycle(int startCycle, int endCycle, int timer);
170 
171  void cyclePaletteForward();
172 
173  void cyclePaletteBackwards();
174 
175  void dump(const char *fname) const;
176 };
177 
178 } // End of namespace Access
179 
180 #endif /* ACCESS_SCREEN_H */
Definition: managed_surface.h:51
Definition: screen.h:35
Definition: access.h:139
Definition: rect.h:524
Definition: stream.h:745
Definition: asurface.h:42
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: rect.h:144
Definition: access.h:62
Definition: screen.h:49