ScummVM API documentation
mcga_graphics.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 CHEWY_MCGA_GRAPHICS_H
23 #define CHEWY_MCGA_GRAPHICS_H
24 
25 #include "graphics/screen.h"
26 
27 namespace Chewy {
28 
29 class McgaGraphics {
30 public:
31  McgaGraphics();
32  ~McgaGraphics();
33 
34  void init();
35 
36  void setPointer(byte *ptr);
37 
38  void setPalette(byte *palette);
39  void raster_col(int16 c, int16 r, int16 g, int16 b);
40  void fadeIn(byte *palette);
41  void fadeOut();
42  void set_partialpalette(const byte *palette, int16 startCol, int16 nr);
43 
44  void cls();
45  void drawLine(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
46  void box(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
47  void boxFill(int16 x1, int16 y1, int16 x2, int16 y2, int16 color);
48  void pop_box(int16 x, int16 y, int16 x1, int16 y1,
49  int16 col1, int16 col2, int16 back_col);
50 
51  void copyToScreen();
52 
53  void spriteSave(byte *spritePtr, int16 x, int16 y, int16 width,
54  int16 height);
55  void spriteSet(byte *sptr, int16 x, int16 y, int16 scrWidth, uint16 spriteWidth = 0, uint16 spriteHeight = 0);
56  void scale_set(byte *sptr, int16 x, int16 y, int16 xdiff,
57  int16 ydiff, int16 scrwidth);
58  void map_spr2screen(byte *sptr, int16 x, int16 y);
59 
60  void plot_scan_cur(int16 x, int16 y, int16 fcol, int16 bcol, int16 scrwidth,
61  char cursor);
62  int16 scanxy(int16 x, int16 y, int16 fcol, int16 bcol, int16 cur_col, int16 scrwidth, const char *string, ...);
63  void printxy(int16 x, int16 y, int16 fgCol, int16 bgCol, int16 scrwidth,
64  const char *format);
65  void move(int16 x, int16 y);
66  int16 findHotspot(const Common::Rect *hotspots);
67 
68 private:
69  int16 devices();
70  void putz(unsigned char c, int16 fgCol, int16 bgCol, int16 scrWidth);
71 
72  // Zoom related
73  void setXVals();
74  void setYVals(int spriteHeight);
75  void clip(byte *&source, byte *&dest, int16 &x, int16 &y);
76  void zoom_set(byte *source, int16 x, int16 y, int16 xDiff, int16 yDiff, int16 scrWidth);
77 
78  byte _palTable[PALETTE_SIZE];
79  uint8 _einfuegen = 0;
80 
81  int _zoomSpriteDeltaX2;
82  int _zoomSpriteDeltaY2;
83  int _zoomSpriteXVal1, _zoomSpriteXVal2;
84  int _zoomSpriteYVal1, _zoomSpriteYVal2;
85 };
86 
87 } // namespace Chewy
88 
89 #endif
Definition: rect.h:144
Definition: mcga_graphics.h:29
Definition: ani_dat.h:25