ScummVM API documentation
util.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_UTIL_H
22#define TOT_UTIL_H
23
24#include "tot/tot.h"
25
26namespace Tot {
27
28extern const int kEnforcedTextAnimDelay;
29
30void showError(int code);
31
32// Delays a specified number of milliseconds.
33void delay(uint16 ms);
34
35int engine_start();
36
37void setRGBPalette(int color, int r, int g, int b);
38
39void littText(int x, int y, const Common::String &text, byte color, Graphics::TextAlign align = Graphics::kTextAlignStart);
40void littText(int x, int y, const char *text, byte color, Graphics::TextAlign align = Graphics::kTextAlignStart);
41
42void euroText(int x, int y, const Common::String &text, byte color, Graphics::TextAlign align = Graphics::kTextAlignStart);
43void euroText(int x, int y, const char *text, byte color, Graphics::TextAlign align = Graphics::kTextAlignStart);
44
45void biosText(int x, int y, const Common::String &text, byte color);
46
47uint imagesize(int x, int y, int x2, int y2);
48
49void rectangle(int x1, int y1, int x2, int y2, byte color);
50
51void line(uint x1, uint y1, uint x2, uint y2, byte color);
52
53void bar(int x1, int y1, int x2, int y2, byte color);
54
55void putpixel(int x, int y, byte color);
56
57void emptyLoop();
58
59void emptyLoop2();
60
61void changeGameSpeed(Common::Event e);
62
63inline bool odd(int32 i) { return i % 2 != 0; }
64
65int getRandom(int range);
66
67Common::String getObjectName(int idx);
68
69Common::String getActionLineText(int idx);
70
71const char *const *getFullScreenMessagesByCurrentLanguage();
72
73const char *const *getAnimMessagesByCurrentLanguage();
74
75const char *const *getHardcodedTextsByCurrentLanguage();
76
77const int32 *getOffsetsByCurrentLanguage();
78
79void newSecondaryAnimationFrame();
80
81void clearScreenLayer(uint pos);
82
83inline bool isLanguageSpanish() {
84 return g_engine->_lang == Common::ES_ESP;
85}
86
87inline bool isDemo() {
88 return g_engine->_gameDescription->flags & ADGF_DEMO;
89}
90
91} // End of namespace Tot
92
93#endif
Definition: str.h:59
@ ADGF_DEMO
Add "-demo" to gameid.
Definition: advancedDetector.h:157
Engine * g_engine
TextAlign
Definition: font.h:48
@ kTextAlignStart
Align the text to start of line (virtual).
Definition: font.h:50
Definition: events.h:218