ScummVM API documentation
gfx_pics.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 GOT_GFX_GFX_PICS_H
23#define GOT_GFX_GFX_PICS_H
24
25#include "graphics/managed_surface.h"
26
27namespace Got {
28namespace Gfx {
29
37extern void convertPaneDataToSurface(const byte *src, Graphics::ManagedSurface &surf);
38
39class GfxPics {
40private:
41 Graphics::ManagedSurface *_array = nullptr;
42 size_t _size = 0;
43
44protected:
45public:
46 ~GfxPics() {
47 clear();
48 }
49
50 void clear();
51 void resize(uint newSize);
52 void load(const Common::String &name, int blockSize);
53
54 Graphics::ManagedSurface &operator[](uint idx) {
55 return _array[idx];
56 }
57 size_t size() const {
58 return _size;
59 }
60
61 GfxPics &operator=(const GfxPics &src);
62};
63
64class BgPics : public GfxPics {
65private:
66 int _area = 1;
67
68public:
69 void load();
70
71 bool getArea() const {
72 return _area;
73 }
74 void setArea(int area);
75};
76
77class Pics : public GfxPics {
78private:
79 Common::String _resName;
80 int _blockSize = -1;
81
82public:
83 Pics(const Common::String &resName, int blockSize = -1,
84 bool immediateLoad = true) : _resName(resName), _blockSize(blockSize) {
85 if (immediateLoad)
86 load();
87 }
88 Pics() {}
89
90 void load() {
91 GfxPics::load(_resName, _blockSize);
92 }
93};
94
95} // namespace Gfx
96} // namespace Got
97
98#endif
Definition: str.h:59
Definition: gfx_pics.h:64
Definition: gfx_pics.h:39
Definition: gfx_pics.h:77
Definition: managed_surface.h:51