ScummVM API documentation
paint16.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_PAINT16_H
23#define SCI_GRAPHICS_PAINT16_H
24
25namespace Sci {
26
27class GfxPorts;
28class GfxScreen;
29class GfxPalette;
30class Font;
31class GfxView;
32struct HiresDrawData;
33
38public:
39 GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster16 *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio);
41
42 void init(GfxAnimate *animate, GfxText16 *text16);
43
44 void debugSetEGAdrawingVisualize(bool state);
45
46 void drawPicture(GuiResourceId pictureId, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
47 void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
48 void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
49 void drawCel(GfxView *view, int16 loopNo, int16 celNo, const Common::Rect &celRect, byte priority, uint16 paletteNo, uint16 scaleX = 128, uint16 scaleY = 128, uint16 scaleSignal = 0);
50 void drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t hiresHandle, bool storeDrawingInfo);
51 void redrawHiresCels();
52
53 void clearScreen(byte color = 255);
54 void invertRect(const Common::Rect &rect);
55 void invertRectViaXOR(const Common::Rect &rect);
56 void eraseRect(const Common::Rect &rect);
57 void paintRect(const Common::Rect &rect);
58 void fillRect(const Common::Rect &rect, int16 drawFlags, byte color, byte priority = 0, byte control = 0);
59 void frameRect(const Common::Rect &rect);
60
61 void bitsShow(const Common::Rect &r);
62 reg_t bitsSave(const Common::Rect &rect, byte screenFlags, bool hiresFlag = false);
63 void bitsGetRect(reg_t memoryHandle, Common::Rect *destRect);
64 void bitsRestore(reg_t memoryHandle);
65 void bitsFree(reg_t memoryHandle);
66
67 void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
68 void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, bool hiresMode, reg_t hiresHandle);
69
70 void kernelGraphFillBoxForeground(const Common::Rect &rect);
71 void kernelGraphFillBoxBackground(const Common::Rect &rect);
72 void kernelGraphFillBox(const Common::Rect &rect, uint16 colorMask, int16 color, int16 priority, int16 control);
73 void kernelGraphFrameBox(const Common::Rect &rect, int16 color);
74 void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
75 reg_t kernelGraphSaveBox(const Common::Rect &rect, uint16 flags, bool hiresFlag);
76 void kernelGraphRestoreBox(reg_t handle);
77 void kernelGraphUpdateBox(const Common::Rect &rect);
78 void kernelGraphRedrawBox(Common::Rect rect);
79
80 reg_t kernelDisplay(const char *text, uint16 languageSplitter, int argc, reg_t *argv);
81
82 reg_t kernelPortraitLoad(const Common::String &resourceName);
83 void kernelPortraitShow(const Common::String &resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
84 void kernelPortraitUnload(uint16 portraitId);
85
86private:
87 ResourceManager *_resMan;
88 SegManager *_segMan;
89 AudioPlayer *_audio;
90 GfxAnimate *_animate;
91 GfxCache *_cache;
92 GfxPorts *_ports;
93 GfxCoordAdjuster16 *_coordAdjuster;
94 GfxScreen *_screen;
95 GfxPalette *_palette;
96 GfxText16 *_text16;
97 GfxTransitions *_transitions;
98
99 // true means make EGA picture drawing visible
100 bool _EGAdrawingVisualize;
101
102 // The original KQ6WinCD interpreter saves the hires drawing information in a linked list. There are two use cases: one is redrawing the
103 // window background when receiving WM_PAINT messages (which is irrelevant for us, since that happens in the backend) and the other is
104 // redrawing the inventory after displaying a text window over it. This only happens in mixed speech+text mode, which does not even exist
105 // in the original. We do have that mode as a ScummVM feature, though. That's why we have that code, to be able to refresh the inventory.
106 void removeHiresDrawObject(reg_t handle);
107 bool hasHiresDrawObjectAt(uint16 x, uint16 y) const;
108 Common::Rect makeHiresRect(Common::Rect &rect) const;
109
110 HiresDrawData *_hiresDrawObjs;
111 bool _hiresPortraitWorkaroundFlag;
112};
113
114} // End of namespace Sci
115
116#endif // SCI_GRAPHICS_PAINT16_H
Definition: str.h:59
Definition: audio.h:55
Definition: animate.h:87
Definition: cache.h:38
Definition: coordadjuster.h:37
Definition: paint16.h:37
Definition: palette16.h:41
Definition: ports.h:52
Definition: screen.h:70
Definition: text16.h:45
Definition: transitions.h:62
Definition: view.h:59
Definition: resource.h:327
Definition: seg_manager.h:48
Definition: console.h:28
Definition: rect.h:144
Definition: rect.h:536
Definition: vm_types.h:39