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 PELROCK_UTIL_H
22#define PELROCK_UTIL_H
23
24#include "common/events.h"
25
26#include "graphics/font.h"
27
28namespace Pelrock {
29
30size_t rleDecompress(const byte *data, size_t data_size, uint32 offset, uint32 size, byte **out_data, bool untilBuda = true);
31void readUntilBuda(Common::SeekableReadStream *stream, uint32 startPos, byte *&buffer, size_t &outSize);
32void rleDecompressSingleBuda(Common::SeekableReadStream *stream, uint32 startPos, byte *&buffer, size_t &outSize);
33void drawSpriteToBuffer(Graphics::ManagedSurface &dest, byte *sprite, int x, int y, int width, int height, int transparentColor);
34void extractSingleFrame(byte *source, byte *dest, int frameIndex, int frameWidth, int frameHeight);
35
36void drawText(Graphics::ManagedSurface &dest, Graphics::Font *font, Common::String text, int x, int y, int w, byte color, Graphics::TextAlign align = Graphics::kTextAlignLeft);
37void drawText(Graphics::Font *font, Common::String text, int x, int y, int w, byte color);
38Common::String joinStrings(const Common::Array<Common::String> &strings, const Common::String &separator);
39byte decodeChar(byte b);
40void changeGameSpeed(Common::Event e);
41
42// debug functions
43void drawRect(Graphics::ManagedSurface *surface, int x, int y, int w, int h, byte color);
44void drawPos(Graphics::ManagedSurface *surface, int x, int y, byte color);
45void drawPaletteSquares(Graphics::ManagedSurface &dest, byte *palette);
46
47static const int specialChars[] = {
48 168, // inverted ?
49 173, // inverted !
50 165, // capital N tilde
51 164, // small n tilde
52 163, // small u tilde
53 162, // small o tilde
54 161, // small i tilde
55 130, // small e tilde
56 160, // small a tilde
57};
58
59} // End of namespace Pelrock
60#endif // PELROCK_UTIL_H
Definition: stream.h:745
Definition: str.h:59
Definition: font.h:83
Definition: managed_surface.h:51
TextAlign
Definition: font.h:48
@ kTextAlignLeft
Align the text to the left.
Definition: font.h:51
Definition: events.h:218