ScummVM API documentation
screens.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 TWINE_RENDERER_SCREENS_H
23 #define TWINE_RENDERER_SCREENS_H
24 
25 #include "common/scummsys.h"
26 #include "graphics/managed_surface.h"
27 #include "graphics/surface.h"
28 #include "twine/twine.h"
29 
30 namespace TwinE {
31 
32 class TwinEEngine;
33 class Screens {
34 private:
35  TwinEEngine *_engine;
36 
45  void adjustPalette(uint8 r, uint8 g, uint8 b, const uint32 *palette, int32 intensity);
46 
47 public:
48  Screens(TwinEEngine *engine) : _engine(engine) {}
49 
51  uint8 _palette[NUMOFCOLORS * 3]{0};
52 
53  int32 mapLba2Palette(int32 palIndex);
54 
56  uint32 _paletteRGBA[NUMOFCOLORS]{0};
57 
59  uint32 _paletteRGBACustom[NUMOFCOLORS]{0};
60 
62  bool _palResetted = false;
63 
65  bool _fadePalette = false;
66 
68  bool _useAlternatePalette = false;
69 
71  uint32 _mainPaletteRGBA[NUMOFCOLORS]{0};
72 
74  bool adelineLogo();
75 
76  void convertPalToRGBA(const uint8 *in, uint32 *out);
77 
81  void setDarkPal();
86  void setNormalPal();
87 
92  void loadCustomPalette(const TwineResource &resource);
93 
95  void loadMenuImage(bool fadeIn = true);
96 
103  void loadImage(TwineImage image, bool fadeIn = true);
104 
112  bool loadImageDelay(TwineImage image, int32 seconds);
113 
114  bool loadBitmapDelay(const char *image, int32 seconds);
115 
120  void fadeIn(const uint32 *palette);
121 
126  void fadeOut(const uint32 *palette);
127 
137  int32 lerp(int32 value, int32 start, int32 end, int32 t);
138 
144  void adjustCrossPalette(const uint32 *pal1, const uint32 *pal2);
145 
150  void fadeToBlack(const uint32 *palette);
151 
156  void fadeToPal(const uint32 *palette);
157 
159  void blackToWhite();
160 
162  void setBackPal();
163 
168  void fadePalRed(const uint32 *palette);
169 
174  void fadeRedPal(const uint32 *palette);
175 
181  void copyScreen(const Graphics::ManagedSurface &source, Graphics::ManagedSurface &destination);
182 
184  void clearScreen();
185 
187  void initPalettes();
188 };
189 
190 } // namespace TwinE
191 
192 #endif
Definition: managed_surface.h:51
Definition: screens.h:33
void blackToWhite()
void copyScreen(const Graphics::ManagedSurface &source, Graphics::ManagedSurface &destination)
void setNormalPal()
void fadeOut(const uint32 *palette)
bool _fadePalette
Definition: screens.h:65
Definition: shared.h:645
void fadeToPal(const uint32 *palette)
void fadeIn(const uint32 *palette)
void fadeToBlack(const uint32 *palette)
bool adelineLogo()
void adjustCrossPalette(const uint32 *pal1, const uint32 *pal2)
Definition: shared.h:637
uint32 _paletteRGBACustom[NUMOFCOLORS]
Definition: screens.h:59
void clearScreen()
bool _useAlternatePalette
Definition: screens.h:68
void loadMenuImage(bool fadeIn=true)
uint32 _paletteRGBA[NUMOFCOLORS]
Definition: screens.h:56
void initPalettes()
uint8 _palette[NUMOFCOLORS *3]
Definition: screens.h:51
uint32 _mainPaletteRGBA[NUMOFCOLORS]
Definition: screens.h:71
Definition: twine.h:200
Definition: achievements_tables.h:27
void loadCustomPalette(const TwineResource &resource)
int32 lerp(int32 value, int32 start, int32 end, int32 t)
void fadeRedPal(const uint32 *palette)
void fadePalRed(const uint32 *palette)
void loadImage(TwineImage image, bool fadeIn=true)
bool _palResetted
Definition: screens.h:62
bool loadImageDelay(TwineImage image, int32 seconds)