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 #ifndef TOT_GRAPHICS_H
22 #define TOT_GRAPHICS_H
23 
24 #include "common/system.h"
25 
26 #include "graphics/fonts/bgifont.h"
27 
28 namespace Tot {
29 
30 const int kTextAreaSize = 320 * 70 + 4;
31 
33 public:
35  ~GraphicsManager();
36 
37  void init();
38  void fixPalette(byte *palette, uint num = 768);
39  byte *getPalette();
40  void setPalette(byte palette[768], uint start = 0, uint num = 256);
41  void loadPaletteFromFile(Common::String image);
42  void turnLightOn();
43  void totalFadeOut(byte red);
44  void partialFadeOut(byte numCol);
45  void totalFadeIn(uint paletteNumber, Common::String paletteName);
46  void redFadeIn(byte *palette);
47  void partialFadeIn(byte numCol);
48  void updatePalette(byte paletteIndex);
49  void fadePalettes(byte *fromPalette, byte *toPalette);
50  void copyPalette(byte *from, byte *to);
51 
52  void putImg(uint coordx, uint coordy, byte *image, bool transparency = false);
53  void getImg(uint coordx1, uint coordy1, uint coordx2, uint coordy2, byte *image);
54  void putShape(uint coordx, uint coordy, byte *image);
55  void putImageArea(uint putcoordx, uint putcoordy, byte *backgroundScreen, byte *image);
56  void getImageArea(uint getcoordx1, uint getcoordy1, uint getcoordx2, uint getcoordy2, byte *backgroundScreen, byte *image);
57 
58  void littText(const Common::String &str, int x, int y, uint32 color, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool alignCenterY = false);
59  void euroText(const Common::String &str, int x, int y, uint32 color, Graphics::TextAlign align = Graphics::kTextAlignLeft, bool alignCenterY = false);
60  void biosText(const Common::String &str, int x, int y, uint32 color);
61 
62  void clear();
63 
64  void clearActionLine();
65  void writeActionLine(const Common::String &str);
66 
67  void drawFullScreen(byte *screen);
68  void copyFromScreen(byte *&screen);
69  void drawScreen(byte *screen, bool offsetSize = true);
70  void restoreBackground();
71  void restoreBackgroundArea(uint x, uint y, uint x2, uint y2);
72 
73  void sceneTransition(bool fadeToBlack, byte *screen, byte effectNumber);
74  void sceneTransition(bool fadeToBlack, byte *screen);
75 
76  void advancePaletteAnim();
77  void printColor(int x, int y, int color);
78  void updateSceneArea(int speed = 1);
79 
87  byte _palAnimStep = 0;
91  byte _palAnimSlice[768] = { 0 };
95  byte _pal[768] = { 0 };
96 
100  byte *_textAreaBackground = (byte *)malloc(kTextAreaSize);
101 private:
102  signed char fadeData[256][256];
103  Graphics::BgiFont *_litt;
104  Graphics::BgiFont *_euro;
105  Graphics::Font *_dosFont;
106 };
107 
108 } // End of namespace Tot
109 #endif
Definition: bgifont.h:36
Definition: str.h:59
Definition: font.h:83
Definition: graphics.h:32
TextAlign
Definition: font.h:48
byte _paletteAnimFrame
Definition: graphics.h:83
Align the text to the left.
Definition: font.h:51
byte _palAnimSlice[768]
Definition: graphics.h:91
Definition: anims.h:26
byte _palAnimStep
Definition: graphics.h:87
byte _pal[768]
Definition: graphics.h:95
byte * _textAreaBackground
Definition: graphics.h:100