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