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 SHERLOCK_SCREEN_H
23#define SHERLOCK_SCREEN_H
24
25#include "common/list.h"
26#include "common/rect.h"
27#include "sherlock/image_file.h"
28#include "sherlock/surface.h"
29#include "sherlock/resources.h"
30#include "sherlock/saveload.h"
31
32namespace Sherlock {
33
34#define BG_GREYSCALE_RANGE_END 229
35#define BLACK 0
36
37class SherlockEngine;
38
39class Screen : public BaseSurface {
40private:
41 uint32 _transitionSeed;
42
43 // Rose Tattoo fields
44 int _fadeBytesRead, _fadeBytesToRead;
45 int _oldFadePercent;
46protected:
47 SherlockEngine *_vm;
48 Surface _backBuffer;
49
50public:
51 Surface _backBuffer1, _backBuffer2;
52 bool _fadeStyle;
53 byte _cMap[Graphics::PALETTE_SIZE];
54 byte _sMap[Graphics::PALETTE_SIZE];
55 byte _tMap[Graphics::PALETTE_SIZE];
56 bool _flushScreen;
57 Common::Point _currentScroll;
58public:
59 static Screen *init(SherlockEngine *vm);
61 ~Screen() override;
62
66 Surface *getBackBuffer() { return &_backBuffer; }
67
72
77
81 int equalizePalette(const byte palette[Graphics::PALETTE_SIZE]);
82
86 void fadeToBlack(int speed = 2);
87
91 void fadeIn(const byte palette[Graphics::PALETTE_SIZE], int speed = 2);
92
97
102
107 void print(const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr, ...) GCC_PRINTF(4, 5);
108
112 void gPrint(const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr, ...) GCC_PRINTF(4, 5);
113
117 void restoreBackground(const Common::Rect &r);
118
122 void slamArea(int16 xp, int16 yp, int16 width, int16 height);
123
127 void slamRect(const Common::Rect &r);
128
133 void flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp,
134 int16 *width, int16 *height);
135
140 void flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp,
141 int16 *width, int16 *height, int scaleVal);
142
146 void flushImage(ImageFrame *frame, const Common::Point &pt, Common::Rect &newBounds, int scaleVal);
147
151 void blockMove(const Common::Rect &r);
152
156 void blockMove();
157
161 void vgaBar(const Common::Rect &r, int color);
162
166 void setDisplayBounds(const Common::Rect &r);
167
172
177
182
186 void writeString(const Common::String &str, const Common::Point &pt, uint overrideColor);
187
188
189 // Rose Tattoo specific methods
190 void initPaletteFade(int bytesToRead);
191
192 int fadeRead(Common::SeekableReadStream &stream, byte *buf, int totalSize);
193
198 static void translatePalette(byte palette[Graphics::PALETTE_SIZE]);
199};
200
201} // End of namespace Sherlock
202
203#endif
Definition: serializer.h:80
Definition: surface.h:41
virtual uint16 height() const
Definition: surface.h:117
virtual uint16 width() const
Definition: surface.h:112
Definition: screen.h:39
void writeString(const Common::String &str, const Common::Point &pt, uint overrideColor)
Surface * getBackBuffer()
Definition: screen.h:66
void void gPrint(const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr,...) GCC_PRINTF(4
void setDisplayBounds(const Common::Rect &r)
void void void restoreBackground(const Common::Rect &r)
static void translatePalette(byte palette[Graphics::PALETTE_SIZE])
void resetDisplayBounds()
void synchronize(Serializer &s)
void verticalTransition()
void fadeIn(const byte palette[Graphics::PALETTE_SIZE], int speed=2)
void randomTransition()
void print(const Common::Point &pt, uint color, MSVC_PRINTF const char *formatStr,...) GCC_PRINTF(4
void slamArea(int16 xp, int16 yp, int16 width, int16 height)
void slamRect(const Common::Rect &r)
void activateBackBuffer2()
void flushImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, int16 *width, int16 *height)
void fadeToBlack(int speed=2)
void flushScaleImage(ImageFrame *frame, const Common::Point &pt, int16 *xp, int16 *yp, int16 *width, int16 *height, int scaleVal)
int equalizePalette(const byte palette[Graphics::PALETTE_SIZE])
void vgaBar(const Common::Rect &r, int color)
Common::Rect getDisplayBounds()
void activateBackBuffer1()
Definition: sherlock.h:206
Definition: surface.h:130
int FORCEINLINE GCC_PRINTF(2, 0) int vsprintf_s(T(&dst)[N]
Definition: algorithm.h:29
Definition: formatinfo.h:28
Definition: rect.h:144
Definition: display_client.h:58
Definition: image_file.h:36