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
28namespace Tot {
29
30const int kTextAreaSize = 320 * 70 + 4;
31
33public:
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 int euroTextWidth(const Common::String &str);
61 void biosText(const Common::String &str, int x, int y, uint32 color);
62
63 void clear();
64
65 void clearActionLine();
66 void writeActionLine(const Common::String &str);
67
68 void drawFullScreen(byte *screen);
69 void copyFromScreen(byte *&screen);
70 void drawScreen(byte *screen, bool offsetSize = true);
71 void restoreBackground();
72 void restoreBackgroundArea(uint x, uint y, uint x2, uint y2);
73
74 void sceneTransition(bool fadeToBlack, byte *screen, byte effectNumber);
75 void sceneTransition(bool fadeToBlack, byte *screen);
76
77 void advancePaletteAnim();
78 void printColor(int x, int y, int color);
79 void updateSceneArea(int speed = 1);
80
88 byte _palAnimStep = 0;
92 byte _palAnimSlice[768] = { 0 };
96 byte _pal[768] = { 0 };
97
101 byte *_textAreaBackground = (byte *)malloc(kTextAreaSize);
102private:
103 signed char fadeData[256][256];
104 Graphics::BgiFont *_litt;
105 Graphics::BgiFont *_euro;
106 Graphics::Font *_dosFont;
107};
108
109} // End of namespace Tot
110#endif
Definition: str.h:59
Definition: bgifont.h:36
Definition: font.h:83
Definition: graphics.h:32
byte _pal[768]
Definition: graphics.h:96
byte _palAnimStep
Definition: graphics.h:88
byte _paletteAnimFrame
Definition: graphics.h:84
byte _palAnimSlice[768]
Definition: graphics.h:92
byte * _textAreaBackground
Definition: graphics.h:101
TextAlign
Definition: font.h:48
@ kTextAlignLeft
Align the text to the left.
Definition: font.h:51