ScummVM API documentation
game_palettes.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 DGDS_GAME_PALETTES_H
23#define DGDS_GAME_PALETTES_H
24
25#include "common/error.h"
26#include "common/str.h"
27#include "common/serializer.h"
28#include "graphics/palette.h"
29
30namespace Dgds {
31
32class Decompressor;
33class ResourceManager;
34
35class DgdsPal : public Graphics::Palette {
36public:
37 DgdsPal();
38 virtual ~DgdsPal() {}
39 const Common::String &getName() { return _name; }
40 void setName(const Common::String &name) { _name = name; }
41private:
42 Common::String _name;
43};
44
46public:
47 GamePalettes(ResourceManager *resourceMan, Decompressor *decompressor);
48 int loadPalette(const Common::String &filename);
49 void selectPalNum(int num);
50 void setPalette();
51 void clearPalette();
52
53 // Reset the list to the post-game-load state (1 palette loaded)
54 void reset();
55
56 // Fade the colors in the current palette toward black. Start at col, and fade ncols of the palette.
57 // Add coloff to the result to move toward white.
58 void setFade(int col, int ncols, int coloff, int fade);
59
61
62 uint getCurPalNum() const { return _curPalNum; }
63
64 const DgdsPal &getCurPal() const { return _curPal; }
65
66private:
67 ResourceManager *_resourceMan;
68 Decompressor *_decompressor;
69
70 DgdsPal _curPal;
71 uint _curPalNum;
72 Common::Array<DgdsPal> _palettes;
73};
74
75} // end namespace Dgds
76
77#endif // DGDS_GAME_PALETTES_H
Definition: array.h:52
Definition: error.h:81
Definition: serializer.h:80
Definition: str.h:59
Definition: decompress.h:67
Definition: game_palettes.h:35
Definition: game_palettes.h:45
Definition: resource.h:48
Simple class for handling a palette data.
Definition: palette.h:61