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  SCI_PICTURE_TYPE_SCI32 = 2
37 };
38 
39 class GfxPorts;
40 class GfxScreen;
41 class GfxPalette;
42 class GfxCoordAdjuster16;
43 class ResourceManager;
44 class Resource;
45 
50 class GfxPicture {
51 public:
52  GfxPicture(ResourceManager *resMan, GfxCoordAdjuster16 *coordAdjuster, GfxPorts *ports, GfxScreen *screen, GfxPalette *palette, GuiResourceId resourceId, bool EGAdrawingVisualize = false);
53  ~GfxPicture();
54 
55  GuiResourceId getResourceId();
56  void draw(bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
57 
58 private:
59  void initData(GuiResourceId resourceId);
60 #if 0
61  void reset();
62 #endif
63  void drawSci11Vga();
64  void drawCelData(const SciSpan<const byte> &inbuffer, int headerPos, int rlePos, int literalPos, int16 drawX, int16 drawY, int16 pictureX, int16 pictureY, bool isEGA);
65  void drawVectorData(const SciSpan<const byte> &data);
66  bool vectorIsNonOpcode(byte pixel);
67  void vectorGetAbsCoords(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
68  void vectorGetAbsCoordsNoMirror(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
69  void vectorGetRelCoords(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
70  void vectorGetRelCoordsMed(const SciSpan<const byte> &data, uint &curPos, int16 &x, int16 &y);
71  void vectorGetPatternTexture(const SciSpan<const byte> &data, uint &curPos, int16 pattern_Code, int16 &pattern_Texture);
72  void vectorFloodFill(int16 x, int16 y, byte color, byte prio, byte control);
73  void vectorPattern(int16 x, int16 y, byte pic_color, byte pic_priority, byte pic_control, byte code, byte texture);
74  void vectorPatternBox(Common::Rect box, Common::Rect clipBox, byte color, byte prio, byte control);
75  void vectorPatternTexturedBox(Common::Rect box, Common::Rect clipBox, byte color, byte prio, byte control, byte texture);
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:144
Definition: resource.h:327
Definition: palette.h:41
Definition: coordadjuster.h:37
Definition: resource.h:256
Definition: console.h:28
Definition: picture.h:50
Definition: screen.h:70