ScummVM API documentation
sprites.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 SLUDGE_SPRITES_H
22#define SLUDGE_SPRITES_H
23
24#include "graphics/managed_surface.h"
25
26namespace Sludge {
27
28struct Sprite {
29 int xhot, yhot;
31 Graphics::ManagedSurface burnSurface;
32};
33
35public:
36 uint16 *pal;
37 byte *r;
38 byte *g;
39 byte *b;
40 byte originalRed, originalGreen, originalBlue, total;
41
42 SpritePalette() { init(); }
43 ~SpritePalette() { kill(); }
44
45 void init() {
46 pal = nullptr;
47 r = g = b = nullptr;
48 total = 0;
49 originalRed = originalGreen = originalBlue = 255;
50 }
51
52 void kill() {
53 if (pal) {
54 delete[] pal;
55 pal = nullptr;
56 }
57 if (r) {
58 delete[] r;
59 r = nullptr;
60 }
61 if (g) {
62 delete[] g;
63 g = nullptr;
64 }
65 if (b) {
66 delete[] b;
67 b = nullptr;
68 }
69 }
70
71 void setColor(byte red, byte green, byte blue) {
72 originalRed = red;
73 originalGreen = green;
74 originalBlue = blue;
75 }
76};
77
78struct SpriteBank {
79 int total;
80 int type;
81 Sprite *sprites;
82 SpritePalette myPalette;
83 bool isFont;
84};
85
86} // End of namespace Sludge
87
88#endif
Definition: managed_surface.h:51
Definition: sprites.h:34
Definition: sprites.h:78
Definition: sprites.h:28