ScummVM API documentation
palette.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 HODJNPODJ_GFX_PALETTE_H
23 #define HODJNPODJ_GFX_PALETTE_H
24 
25 #include "graphics/palette.h"
26 #include "bagel/boflib/palette.h"
27 
28 namespace Bagel {
29 namespace HodjNPodj {
30 
31 constexpr byte BLACK = 0;
32 constexpr byte WHITE = 255;
33 #define RED PALETTERGB(255, 0, 255)
34 #define BLUE PALETTERGB(0, 0, 255)
35 #define CYAN PALETTERGB(0, 255, 255)
36 #define PURPLE PALETTERGB(0x80, 0, 0x80)
37 
38 class Palette {
39 private:
40  Graphics::Palette _gamePalette;
41 
42 protected:
43  void loadInitialPalette();
44 
45 public:
46  Palette();
47  virtual ~Palette() {}
48 
52  virtual void setPalette(const byte *palette);
53  virtual void setPalette(const Graphics::Palette &palette);
54 
58  virtual Graphics::Palette getPalette() const;
59 
63  virtual void loadPalette(const byte *palette);
64  virtual void loadPalette(const Graphics::Palette &palette);
65 
69  virtual byte getPaletteIndex(uint32 color) const;
70 };
71 
72 } // namespace HodjNPodj
73 } // namespace Bagel
74 
75 #endif
virtual void setPalette(const byte *palette)
virtual byte getPaletteIndex(uint32 color) const
Definition: palette.h:38
Definition: afxwin.h:27
virtual Graphics::Palette getPalette() const
Simple class for handling a palette data.
Definition: palette.h:55
virtual void loadPalette(const byte *palette)