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  reg_t bitsSave(const Common::Rect &rect, byte screenFlags, bool hiresFlag = false);
61  void bitsGetRect(reg_t memoryHandle, Common::Rect *destRect);
62  void bitsRestore(reg_t memoryHandle);
63  void bitsFree(reg_t memoryHandle);
64 
65  void kernelDrawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
66  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);
67 
68  void kernelGraphFillBoxForeground(const Common::Rect &rect);
69  void kernelGraphFillBoxBackground(const Common::Rect &rect);
70  void kernelGraphFillBox(const Common::Rect &rect, uint16 colorMask, int16 color, int16 priority, int16 control);
71  void kernelGraphFrameBox(const Common::Rect &rect, int16 color);
72  void kernelGraphDrawLine(Common::Point startPoint, Common::Point endPoint, int16 color, int16 priority, int16 control);
73  reg_t kernelGraphSaveBox(const Common::Rect &rect, uint16 flags, bool hiresFlag);
74  void kernelGraphRestoreBox(reg_t handle);
75  void kernelGraphUpdateBox(const Common::Rect &rect);
76  void kernelGraphRedrawBox(Common::Rect rect);
77 
78  reg_t kernelDisplay(const char *text, uint16 languageSplitter, int argc, reg_t *argv);
79 
80  reg_t kernelPortraitLoad(const Common::String &resourceName);
81  void kernelPortraitShow(const Common::String &resourceName, Common::Point position, uint16 resourceNum, uint16 noun, uint16 verb, uint16 cond, uint16 seq);
82  void kernelPortraitUnload(uint16 portraitId);
83 
84 private:
85  ResourceManager *_resMan;
86  SegManager *_segMan;
87  AudioPlayer *_audio;
88  GfxAnimate *_animate;
89  GfxCache *_cache;
90  GfxPorts *_ports;
91  GfxCoordAdjuster16 *_coordAdjuster;
92  GfxScreen *_screen;
93  GfxPalette *_palette;
94  GfxText16 *_text16;
95  GfxTransitions *_transitions;
96 
97  // true means make EGA picture drawing visible
98  bool _EGAdrawingVisualize;
99 };
100 
101 } // End of namespace Sci
102 
103 #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:70
Definition: transitions.h:62
Definition: vm_types.h:39
Definition: view.h:59