ScummVM API documentation
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 TOUCHE_GRAPHICS_H
23 #define TOUCHE_GRAPHICS_H
24 
25 #include "common/language.h"
26 
27 namespace Touche {
28 
29 class Graphics {
30 public:
31 
32  enum {
33  kTransparent = 1 << 0
34  };
35 
36  static void setupFont(Common::Language language);
37  static int getStringWidth16(const char *str);
38  static int getCharWidth16(uint8 chr);
39  static void drawString16(uint8 *dst, int dstPitch, uint16 color, int x, int y, const char *str, int xmax = 0);
40  static int drawChar16(uint8 *dst, int dstPitch, uint8 chr, int x, int y, uint16 color);
41  static void fillRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color);
42  static void drawRect(uint8 *dst, int dstPitch, int x, int y, int w, int h, uint8 color1, uint8 color2);
43  static void drawLine(uint8 *dst, int dstPitch, int x1, int y1, int x2, int y2, uint8 color);
44  static void copyRect(uint8 *dst, int dstPitch, int dstX, int dstY, const uint8 *src, int srcPitch, int srcX, int srcY, int w, int h, int flags = 0);
45  static void copyMask(uint8 *dst, int dstPitch, int dstX, int dstY, const uint8 *src, int srcPitch, int srcX, int srcY, int w, int h, uint8 fillColor);
46 
47 private:
48 
49  /* font data for english version */
50  static const uint16 _engFontOffs[];
51  static const int _engFontSize;
52  static const uint8 _engFontData[];
53 
54  /* font data for french and german versions */
55  static const uint16 _freGerFontOffs[];
56  static const int _freGerFontSize;
57  static const uint8 _freGerFontData[];
58 
59  /* font data for spanish version */
60  static const uint16 _spaFontOffs[];
61  static const int _spaFontSize;
62  static const uint8 _spaFontData[];
63 
64  /* font data for polish version */
65  static const uint16 _polFontOffs[];
66  static const int _polFontSize;
67  static const uint8 _polFontData[];
68 
69  /* font data for russian version */
70  static const uint16 _rusFontOffs[];
71  static const int _rusFontSize;
72  static const uint8 _rusFontData[];
73 
74  static const uint16 *_fontOffs;
75  static int _fontSize;
76  static const uint8 *_fontData;
77 };
78 
79 } // namespace Touche
80 
81 #endif
Definition: console.h:27
Definition: formatinfo.h:28
Language
Definition: language.h:45