22 #ifndef MEDIASTATION_GRAPHICS_H 23 #define MEDIASTATION_GRAPHICS_H 25 #include "common/rect.h" 26 #include "common/array.h" 27 #include "common/stack.h" 28 #include "graphics/managed_surface.h" 29 #include "graphics/screen.h" 31 #include "mediastation/clients.h" 32 #include "mediastation/mediascript/scriptvalue.h" 36 class MediaStationEngine;
37 struct DissolvePattern;
41 kUncompressedBlit = 0x00,
44 kUncompressedTransparentBlit = 0x08,
45 kPartialDissolve = 0x10,
48 kCccTransparentBlit = 0x80
52 kTransitionFadeToBlack = 300,
53 kTransitionFadeToPalette = 301,
54 kTransitionSetToPalette = 302,
55 kTransitionSetToBlack = 303,
56 kTransitionFadeToColor = 304,
57 kTransitionSetToColor = 305,
58 kTransitionSetToPercentOfPalette = 306,
59 kTransitionFadeToPaletteObject = 307,
60 kTransitionSetToPaletteObject = 308,
61 kTransitionSetToPercentOfPaletteObject = 309,
62 kTransitionColorShiftCurrentPalette = 310,
63 kTransitionCircleOut = 328
66 enum VideoDisplayManagerSectionType {
67 kVideoDisplayManagerUpdateDirty = 0x578,
68 kVideoDisplayManagerUpdateAll = 0x579,
69 kVideoDisplayManagerEffectTransition = 0x57a,
70 kVideoDisplayManagerSetTime = 0x57b,
71 kVideoDisplayManagerLoadPalette = 0x5aa,
90 void addToRegion(
const Region ®ion);
105 void setClipTo(
Region region);
106 void emptyCurrentClip();
111 Clip *previousClip();
112 void verifyClipSize();
132 virtual bool attemptToReadFromStream(
Chunk &chunk, uint sectionType)
override;
134 void updateScreen() { _screen->update(); }
136 void setRegisteredPalette(
Graphics::Palette *palette) { _registeredPalette = palette; }
141 double dissolveFactor,
144 bool useTransBlit =
false);
151 const double dissolveFactor,
156 void doTransitionOnSync();
158 void performUpdateDirty();
159 void performUpdateAll();
161 void setGammaValues(
double red,
double green,
double blue);
162 void getDefaultGammaValues(
double &red,
double &green,
double &blue);
163 void getGammaValues(
double &red,
double &green,
double &blue);
172 double _defaultTransitionTime = 0.0;
174 const double DEFAULT_GAMMA_VALUE = 1.0;
175 double _redGamma = 1.0;
176 double _greenGamma = 1.0;
177 double _blueGamma = 1.0;
179 void readAndEffectTransition(
Chunk &chunk);
180 void readAndRegisterPalette(
Chunk &chunk);
190 bool useTransBlit =
false);
191 void rleBlitRectsClip(
200 void dissolveBlitRectsClip(
205 const uint dissolveFactor);
206 void dissolveBlit1Rect(
213 void fullDeltaRleBlitRectsClip(
220 void deltaRleBlitRectsClip(
226 void deltaRleBlit1Rect(
234 const double DEFAULT_FADE_TRANSITION_TIME_IN_SECONDS = 0.5;
235 const byte DEFAULT_PALETTE_TRANSITION_START_INDEX = 0x01;
236 const byte DEFAULT_PALETTE_TRANSITION_COLOR_COUNT = 0xFE;
251 void _setPaletteToColor(
Graphics::Palette &targetPalette, byte r, byte g, byte b);
252 uint _limitColorRange(uint &startIndex, uint &colorCount);
253 byte _interpolateColorComponent(byte source, byte target,
double progress);
255 void _fadeToColor(byte r, byte g, byte b,
double fadeTime, uint startIndex, uint colorCount);
256 void _setToColor(byte r, byte g, byte b, uint startIndex, uint colorCount);
257 void _setPercentToColor(
double percent, byte r, byte g, byte b, uint startIndex, uint colorCount);
259 void _fadeToPalette(
double fadeTime,
Graphics::Palette &targetPalette, uint startIndex, uint colorCount);
261 uint startIndex, uint colorCount);
262 void _fadeToRegisteredPalette(
double fadeTime, uint startIndex, uint colorCount);
263 void _setToRegisteredPalette(uint startIndex, uint colorCount);
264 void _colorShiftCurrentPalette(uint startIndex, uint shiftAmount, uint colorCount);
265 void _fadeToPaletteObject(uint paletteId,
double fadeTime, uint startIndex, uint colorCount);
266 void _setToPaletteObject(uint paletteId, uint startIndex, uint colorCount);
267 void _setPercentToPaletteObject(
double percent, uint paletteId, uint startIndex, uint colorCount);
Definition: managed_surface.h:51
Definition: graphics.h:100
Simple class for handling a palette data.
Definition: palette.h:61