ScummVM API documentation
shapes.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
22#ifndef ULTIMA3_GFX_SHAPES_H
23#define ULTIMA3_GFX_SHAPES_H
24
25#include "graphics/managed_surface.h"
26
27namespace Ultima {
28namespace Ultima3 {
29namespace Gfx {
30
31constexpr int SHAPE_COUNT = 80;
32constexpr int SHAPE_SIZE = 16;
33constexpr int SHAPE_PIXELS = SHAPE_SIZE * SHAPE_SIZE;
34
42class Shapes {
43private:
44 byte _pixels[SHAPE_COUNT * SHAPE_PIXELS] = {};
45
46 // Ticks left before each animation step is next applied
47 byte _scrollCounters[4] = {};
48 byte _flickerCounters[3] = {};
49 byte _swapCounter = 0;
50
51 byte *tile(int index) {
52 return &_pixels[index * SHAPE_PIXELS];
53 }
54
58 void scrollTile(int index);
59
63 void cycleRings(int index);
64
68 void swapLines(int index, int line1, int line2);
69
73 void swapTiles(int index1, int index2, int count);
74
75public:
79 void load();
80
84 void animate();
85
90 void drawTile(Graphics::ManagedSurface &dest, int x, int y, int index) const;
91};
92
93} // namespace Gfx
94} // namespace Ultima3
95} // namespace Ultima
96
97#endif
Definition: managed_surface.h:51
Definition: shapes.h:42
void drawTile(Graphics::ManagedSurface &dest, int x, int y, int index) const