ScummVM API documentation
remap.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 SCI_GRAPHICS_REMAP_H
23 #define SCI_GRAPHICS_REMAP_H
24 
25 #include "common/array.h"
26 #include "common/serializer.h"
27 
28 namespace Sci {
29 
30 class GfxScreen;
31 
35 class GfxRemap {
36 private:
37  enum ColorRemappingType {
38  kRemapNone = 0,
39  kRemapByRange = 1,
40  kRemapByPercent = 2
41  };
42 
43 public:
44  GfxRemap(GfxPalette *_palette);
45 
46  void resetRemapping();
47  void setRemappingPercent(byte color, byte percent);
48  void setRemappingRange(byte color, byte from, byte to, byte base);
49  bool isRemapped(byte color) const {
50  return _remapOn && (_remappingType[color] != kRemapNone);
51  }
52  byte remapColor(byte remappedColor, byte screenColor);
53  void updateRemapping();
54 
55 private:
56  GfxPalette *_palette;
57 
58  bool _remapOn;
59  ColorRemappingType _remappingType[256];
60  byte _remappingByPercent[256];
61  byte _remappingByRange[256];
62  uint16 _remappingPercentToSet;
63 };
64 } // End of namespace Sci
65 
66 #endif // SCI_GRAPHICS_REMAP_H
Definition: remap.h:35
Definition: palette.h:41
Definition: console.h:28