ScummVM API documentation
picture.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 SCI_GRAPHICS_PICTURE_H
23#define SCI_GRAPHICS_PICTURE_H
24
25#include "sci/util.h"
26
27namespace Sci {
28
29#define SCI_PATTERN_CODE_RECTANGLE 0x10
30#define SCI_PATTERN_CODE_USE_TEXTURE 0x20
31#define SCI_PATTERN_CODE_PENSIZE 0x07
32
33enum {
34 SCI_PICTURE_TYPE_REGULAR = 0,
35 SCI_PICTURE_TYPE_SCI11 = 1
36};
37
38class GfxPorts;
39class GfxScreen;
40class GfxPalette;
41class GfxCoordAdjuster16;
42class ResourceManager;
43class Resource;
44
50public:
51 GfxPicture(ResourceManager *resMan, GfxCoordAdjuster16 *coordAdjuster, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false);
53
54 GuiResourceId getResourceId();
55 void draw(bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
56
57private:
58 void initData(GuiResourceId resourceId);
59 void drawSci11Vga();
60 void drawCelData(const SciSpan<const byte> &inbuffer, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA);
61 void drawVectorData(const SciSpan<const byte> &data);
62 bool vectorIsNonOpcode(byte pixel);
63 void vectorGetAbsCoords(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
64 void vectorGetAbsCoordsNoMirror(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
65 void vectorGetRelCoords(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
66 void vectorGetRelCoordsMed(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
67 void vectorGetPatternTexture(const SciSpan<const byte> &data, uint &curPos, int16 pattern_Code, int16 &pattern_Texture);
68 void vectorFloodFill(int16 x, int16 y, byte color, byte prio, byte control, bool isEGA);
69 void vectorPattern(int16 x, int16 y, byte pic_color, byte pic_priority, byte pic_control, byte code, byte texture);
70 void vectorPatternBox(Common::Rect box, Common::Rect clipBox, byte color, byte prio, byte control);
71 void vectorPatternTexturedBox(Common::Rect box, Common::Rect clipBox, byte color, byte prio, byte control, byte texture);
72 void vectorPatternBoxPixel(int16 x, int16 y, Common::Rect clipBox, byte drawMask, byte color, byte prio, byte control);
73 void vectorPatternCircle(Common::Rect box, Common::Rect clipBox, byte size, byte color, byte prio, byte control);
74 void vectorPatternTexturedCircle(Common::Rect box, Common::Rect clipBox, byte size, byte color, byte prio, byte control, byte texture);
75
76 ResourceManager *_resMan;
77 GfxCoordAdjuster16 *_coordAdjuster;
78 GfxPorts *_ports;
79 GfxScreen *_screen;
80 GfxPalette *_palette;
81
82 int16 _resourceId;
83 Resource *_resource;
84 int _resourceType;
85
86 bool _mirroredFlag;
87 bool _addToFlag;
88 int16 _EGApaletteNo;
89 byte _priority;
90
91 // If true, we will show the whole EGA drawing process...
92 bool _EGAdrawingVisualize;
93};
94
95} // End of namespace Sci
96
97#endif // SCI_GRAPHICS_PICTURE_H
Definition: coordadjuster.h:37
Definition: palette16.h:41
Definition: picture.h:49
Definition: ports.h:52
Definition: screen.h:70
Definition: resource.h:256
Definition: resource.h:327
Definition: util.h:251
Definition: console.h:28
Definition: rect.h:536