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 
25 namespace Sci {
26 
27 class GfxPorts;
28 class GfxScreen;
29 class GfxPalette;
30 class Font;
31 class GfxView;
32 
36 class GfxPaint16 {
37 public:
38  GfxPaint16(ResourceManager *resMan, SegManager *segMan, GfxCache *cache, GfxPorts *ports, GfxCoordAdjuster16 *coordAdjuster, GfxScreen *screen, GfxPalette *palette, GfxTransitions *transitions, AudioPlayer *audio);
39  ~GfxPaint16();
40 
41  void init(GfxAnimate *animate, GfxText16 *text16);
42 
43  void debugSetEGAdrawingVisualize(bool state);
44 
45  void drawPicture(GuiResourceId pictureId, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
46  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);
47  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);
48  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);
49  void drawHiresCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, reg_t upscaledHiresHandle, uint16 scaleX = 128, uint16 scaleY = 128);
50 
51  void clearScreen(byte color = 255);
52  void invertRect(const Common::Rect &rect);
53  void invertRectViaXOR(const Common::Rect &rect);
54  void eraseRect(const Common::Rect &rect);
55  void paintRect(const Common::Rect &rect);
56  void fillRect(const Common::Rect &rect, int16 drawFlags, byte color, byte priority = 0, byte control = 0);
57  void frameRect(const Common::Rect &rect);
58 
59  void bitsShow(const Common::Rect &r);
60  void bitsShowHires(const Common::Rect &rect);
61  reg_t bitsSave(const Common::Rect &rect, byte screenFlags);
62  void bitsGetRect(reg_t memoryHandle, Common::Rect *destRect);
63  void bitsRestore(reg_t memoryHandle);
64  void bitsFree(reg_t memoryHandle);
65 
66  void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
67  void kernelDrawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, uint16 scaleX, uint16 scaleY, bool hiresMode, reg_t upscaledHiresHandle);
68 
69  void kernelGraphFillBoxForeground(const Common::Rect &rect);
70  void kernelGraphFillBoxBackground(const Common::Rect &rect);
71  void kernelGraphFillBox(const Common::Rect &rect, uint16 colorMask, int16 color, int16 priority, int16 control);
72  void kernelGraphFrameBox(const Common::Rect &rect, int16 color);
73  void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
74  reg_t kernelGraphSaveBox(const Common::Rect &rect, uint16 flags);
75  reg_t kernelGraphSaveUpscaledHiresBox(const Common::Rect &rect);
76  void kernelGraphRestoreBox(reg_t handle);
77  void kernelGraphUpdateBox(const Common::Rect &rect, bool hiresMode);
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 
86 private:
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 
103 } // End of namespace Sci
104 
105 #endif // SCI_GRAPHICS_PAINT16_H
Definition: paint16.h:36
Definition: ports.h:52
Definition: str.h:59
Definition: rect.h:144
Definition: resource.h:327
Definition: animate.h:87
Definition: palette.h:41
Definition: coordadjuster.h:37
Definition: cache.h:38
Definition: audio.h:55
Definition: rect.h:45
Definition: console.h:28
Definition: seg_manager.h:48
Definition: text16.h:45
Definition: screen.h:68
Definition: transitions.h:62
Definition: vm_types.h:39
Definition: view.h:59