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/events.h" 33 #include "mediastation/mediascript/scriptvalue.h" 37 class MediaStationEngine;
38 struct DissolvePattern;
42 kUncompressedBlit = 0x00,
45 kUncompressedTransparentBlit = 0x08,
46 kPartialDissolve = 0x10,
49 kCccTransparentBlit = 0x80
53 kTransitionFadeToBlack = 300,
54 kTransitionFadeToPalette = 301,
55 kTransitionSetToPalette = 302,
56 kTransitionSetToBlack = 303,
57 kTransitionFadeToColor = 304,
58 kTransitionSetToColor = 305,
59 kTransitionSetToPercentOfPalette = 306,
60 kTransitionFadeToPaletteObject = 307,
61 kTransitionSetToPaletteObject = 308,
62 kTransitionSetToPercentOfPaletteObject = 309,
63 kTransitionColorShiftCurrentPalette = 310,
64 kTransitionCircleOut = 328
67 enum VideoDisplayManagerSectionType {
68 kVideoDisplayManagerUpdateDirty = 0x578,
69 kVideoDisplayManagerUpdateAll = 0x579,
70 kVideoDisplayManagerEffectTransition = 0x57a,
71 kVideoDisplayManagerSetTime = 0x57b,
72 kVideoDisplayManagerLoadPalette = 0x5aa,
91 void addToRegion(
const Region ®ion);
106 void setClipTo(
Region region);
107 void emptyCurrentClip();
112 Clip *previousClip();
113 void verifyClipSize();
133 void performAutoUpdateAndFlush();
134 void performUpdateAll();
135 void performUpdateDirty();
137 void enableAutoUpdate(uint disabledUpdateDepthCounter);
138 uint disableAutoUpdate();
139 bool needToDisplay();
142 bool _autoUpdateEnabled =
true;
143 bool _forceFlush =
false;
144 uint _disabledScreenAutoUpdateToken = 0;
152 virtual bool attemptToReadFromStream(
Chunk &chunk, uint sectionType)
override;
154 void flushToDisplay();
155 void updateScreen() { _screen->update(); }
157 void setRegisteredPalette(
Graphics::Palette *palette) { _registeredPalette = palette; }
162 double dissolveFactor,
165 bool useTransBlit =
false);
172 const double dissolveFactor,
182 void doTransitionOnSync();
184 void setGammaValues(
double red,
double green,
double blue);
185 void getDefaultGammaValues(
double &red,
double &green,
double &blue);
186 void getGammaValues(
double &red,
double &green,
double &blue);
195 double _defaultTransitionTime = 0.0;
197 const double DEFAULT_GAMMA_VALUE = 1.0;
198 double _redGamma = 1.0;
199 double _greenGamma = 1.0;
200 double _blueGamma = 1.0;
202 void readAndEffectTransition(
Chunk &chunk);
203 void readAndRegisterPalette(
Chunk &chunk);
213 bool useTransBlit =
false);
214 void rleBlitRectsClip(
219 void dissolveBlitRectsClip(
224 const uint dissolveFactor);
225 void dissolveBlit1Rect(
232 void fullDeltaRleBlitRectsClip(
239 void deltaRleBlitRectsClip(
245 void deltaRleBlit1Rect(
253 const double DEFAULT_FADE_TRANSITION_TIME_IN_SECONDS = 0.5;
254 const byte DEFAULT_PALETTE_TRANSITION_START_INDEX = 0x01;
255 const byte DEFAULT_PALETTE_TRANSITION_COLOR_COUNT = 0xFE;
270 void _setPaletteToColor(
Graphics::Palette &targetPalette, byte r, byte g, byte b);
271 uint _limitColorRange(uint &startIndex, uint &colorCount);
272 byte _interpolateColorComponent(byte source, byte target,
double progress);
274 void _fadeToColor(byte r, byte g, byte b,
double fadeTime, uint startIndex, uint colorCount);
275 void _setToColor(byte r, byte g, byte b, uint startIndex, uint colorCount);
276 void _setPercentToColor(
double percent, byte r, byte g, byte b, uint startIndex, uint colorCount);
278 void _fadeToPalette(
double fadeTime,
Graphics::Palette &targetPalette, uint startIndex, uint colorCount);
280 uint startIndex, uint colorCount);
281 void _fadeToRegisteredPalette(
double fadeTime, uint startIndex, uint colorCount);
282 void _setToRegisteredPalette(uint startIndex, uint colorCount);
283 void _colorShiftCurrentPalette(uint startIndex, uint shiftAmount, uint colorCount);
284 void _fadeToPaletteObject(uint paletteId,
double fadeTime, uint startIndex, uint colorCount);
285 void _setToPaletteObject(uint paletteId, uint startIndex, uint colorCount);
286 void _setPercentToPaletteObject(
double percent, uint paletteId, uint startIndex, uint colorCount);
Definition: managed_surface.h:51
Definition: graphics.h:101
Simple class for handling a palette data.
Definition: palette.h:61