22 #ifndef SCI_GRAPHICS_GFXDRIVERS_H 23 #define SCI_GRAPHICS_GFXDRIVERS_H 25 #include "common/platform.h" 26 #include "common/rect.h" 27 #include "graphics/pixelformat.h" 39 enum DrawFlags : uint32 {
44 GfxDriver(uint16 screenWidth, uint16 screenHeight,
int numColors) : _screenW(screenWidth), _screenH(screenHeight), _numColors(numColors), _ready(
false), _pixelSize(1) {}
47 virtual void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping) = 0;
48 virtual void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping) = 0;
49 virtual void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor) = 0;
53 virtual void setShakePos(
int shakeXOffset,
int shakeYOffset)
const;
55 virtual void copyCurrentBitmap(byte *dest, uint32 size)
const = 0;
56 virtual void copyCurrentPalette(byte *dest,
int start,
int num)
const;
57 virtual void drawTextFontGlyph(
const byte *src,
int pitch,
int hiresDestX,
int hiresDestY,
int hiresW,
int hiresH,
int transpColor,
const PaletteMod *palMods,
const byte *palModMapping) = 0;
58 virtual byte remapTextColor(byte color)
const {
return color; }
59 virtual void setColorMap(
const byte *colorMap) {}
61 virtual void setFlags(uint32 flags) {}
62 virtual void clearFlags(uint32 flags) {}
63 virtual bool supportsPalIntensity()
const = 0;
64 virtual bool supportsHiResGraphics()
const = 0;
65 virtual bool driverBasedTextRendering()
const = 0;
66 uint16 numColors()
const {
return _numColors; }
67 byte pixelSize()
const {
return _pixelSize; }
71 static bool checkDriver(
const char *
const *driverNames,
int listSize);
72 const uint16 _screenW;
73 const uint16 _screenH;
80 GfxDefaultDriver(uint16 screenWidth, uint16 screenHeight,
bool isSCI0,
bool rgbRendering);
83 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
84 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping)
override;
85 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
87 void copyCurrentBitmap(byte *dest, uint32 size)
const override;
88 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
89 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
90 bool supportsPalIntensity()
const override {
return true; }
91 bool supportsHiResGraphics()
const override {
return false; }
92 bool driverBasedTextRendering()
const override {
return false; }
94 void updatePalette(
const byte *colors, uint start, uint num);
95 byte *_compositeBuffer;
97 byte *_currentPalette;
98 byte *_internalPalette;
103 bool _cursorUsesScreenPalette;
104 const bool _alwaysCreateBmpBuffer;
105 const bool _requestRGBMode;
106 typedef void (*ColorConvProc)(byte*,
const byte*, int, int, int,
const byte*);
107 ColorConvProc _colorConv;
109 ColorConvModProc _colorConvMod;
111 void generateOutput(byte *dst,
const byte *src,
int pitch,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping);
119 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
121 void copyCurrentBitmap(byte*, uint32)
const override;
122 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
123 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
124 bool supportsPalIntensity()
const override {
return false; }
125 bool supportsHiResGraphics()
const override {
return false; }
126 bool driverBasedTextRendering()
const override {
return false; }
128 void assignPalette(
const byte *colors);
129 byte *_compositeBuffer;
130 const byte *_internalPalette;
132 virtual void setupRenderProc() = 0;
133 const bool _requestRGBMode;
141 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
142 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
143 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(&_driverFile, 1); }
145 void setupRenderProc()
override;
146 uint16 *_cgaPatterns;
148 const bool _disableMode5;
149 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const uint16*,
const byte*);
150 LineProc _renderLine;
151 static const char *_driverFile;
158 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
159 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
162 void setShakePos(
int shakeXOffset,
int shakeYOffset)
const override;
165 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(_driverFiles, 2); }
167 void setupRenderProc()
override;
168 byte _monochromePalette[6];
169 const byte *_monochromePatterns;
171 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const byte*,
const byte*);
172 LineProc _renderLine;
173 static const char *_driverFiles[2];
180 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
181 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
184 void setShakePos(
int shakeXOffset,
int shakeYOffset)
const override;
187 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(&_driverFile, 1); }
189 void setupRenderProc()
override;
190 const uint16 _centerX;
191 const uint16 _centerY;
192 byte _monochromePalette[6];
193 const byte *_monochromePatterns;
194 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const byte*,
const byte*);
195 LineProc _renderLine;
196 static const char *_driverFile;
203 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
204 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS || p == Common::kPlatformWindows) && checkDriver(&_driverFile, 1); }
206 byte *_greyScalePalette;
207 static const char *_driverFile;
215 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod*,
const byte*)
override;
216 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
217 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
219 void copyCurrentBitmap(byte *dest, uint32 size)
const override;
220 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
221 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
224 void setShakePos(
int shakeXOffset,
int shakeYOffset)
const override;
227 bool supportsPalIntensity()
const override {
return false; }
228 bool supportsHiResGraphics()
const override {
return false; }
229 bool driverBasedTextRendering()
const override {
return false; }
230 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS || p == Common::kPlatformWindows) && checkDriver(&_driverFile, 1); }
232 typedef void (*LineProc)(byte*&,
const byte*, int,
const byte*,
const byte*, bool);
233 LineProc _renderLine;
234 const byte *_convPalette;
235 uint16 _vScaleMult, _vScaleDiv;
236 const byte *_egaMatchTable;
237 byte *_egaColorPatterns;
238 byte *_compositeBuffer;
239 byte *_currentPalette;
241 virtual void loadData();
242 virtual void renderBitmap(byte *dst,
const byte *src,
int pitch,
int y,
int w,
int h,
const byte *patterns,
const byte *palette, uint16 &realWidth, uint16 &realHeight);
243 byte *_currentBitmap;
245 const byte *_internalPalette;
246 const bool _requestRGBMode;
247 static const char *_driverFile;
255 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
256 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping)
override;
257 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
260 void setShakePos(
int shakeXOffset,
int shakeYOffset)
const override;
263 void drawTextFontGlyph(
const byte *src,
int pitch,
int hiresDestX,
int hiresDestY,
int hiresW,
int hiresH,
int transpColor,
const PaletteMod *palMods,
const byte *palModMapping)
override;
264 bool driverBasedTextRendering()
const override {
return true; }
266 UpscaledGfxDriver(uint16 scaledW, uint16 scaledH, int16 textAlignX,
bool scaleCursor,
bool rgbRendering);
267 void updateScreen(
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping);
268 void adjustCursorBuffer(uint16 newWidth, uint16 newHeight);
269 typedef void (*GlyphRenderProc)(byte*, int,
const byte*, int, int, int, int);
270 GlyphRenderProc _renderGlyph;
271 typedef void (*ScaledRenderProc)(byte*,
const byte*, int, int, int);
272 ScaledRenderProc _renderScaled;
279 virtual void renderBitmap(
const byte *src,
int pitch,
int dx,
int dy,
int w,
int h,
int &realWidth,
int &realHeight);
280 const bool _scaleCursor;
282 uint16 _cursorHeight;
283 bool _needCursorBuffer;
288 KQ6WinGfxDriver(
bool dosStyleCursors,
bool smallWindow,
bool rgbRendering);
291 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping)
override;
292 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
294 void setColorMap(
const byte *colorMap)
override { _colorMap = colorMap; }
295 void setFlags(uint32 flags)
override;
296 void clearFlags(uint32 flags)
override;
297 bool supportsHiResGraphics()
const override {
return !_smallWindow; }
299 typedef void (*LineProc)(byte*&,
const byte*, int, int, int);
300 LineProc _renderLine;
302 typedef void (*LineProcSpec)(byte*&,
const byte*, int, int,
const byte*);
303 LineProcSpec _renderLine2;
304 void renderBitmap(
const byte *src,
int pitch,
int dx,
int dy,
int w,
int h,
int &realWidth,
int &realHeight)
override;
306 const byte *_colorMap;
307 const bool _smallWindow;
308 const bool _dosStyleCursors;
319 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
321 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS || p == Common::kPlatformWindows); }
323 void loadData()
override;
324 void renderBitmap(byte *dst,
const byte *src,
int pitch,
int y,
int w,
int h,
const byte *patterns,
const byte *palette, uint16 &realWidth, uint16 &realHeight)
override;
325 LineProc _renderLine2;
326 const bool _enhancedDithering;
327 static const byte _win16ColorsDitherPatterns[512];
335 kFontStyleSpecialSCI1
338 PC98Gfx16ColorsDriver(
int textAlignX,
bool cursorScaleWidth,
bool cursorScaleHeight, SjisFontStyle sjisFontStyle,
bool rgbRendering,
bool needsUnditheringPalette);
341 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
342 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
343 byte remapTextColor(byte color)
const override;
345 const byte *_convPalette;
346 const byte *_textModePalette;
347 const bool _cursorScaleHeightOnly;
348 SjisFontStyle _fontStyle;
356 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
357 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
358 byte remapTextColor(byte color)
const override;
359 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformPC98) && checkDriver(_driverFiles, 2); }
361 const byte *_convPalette;
362 const bool _cursorScaleHeightOnly;
363 const bool _useTextMode;
364 static const char *_driverFiles[2];
372 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
373 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping)
override;
374 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
375 byte remapTextColor(byte)
const override;
376 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformPC98) && checkDriver(&_driverFile, 1); }
378 const byte *_ditheringTable;
379 const byte *_convPalette;
380 static const char *_driverFile;
385 #endif // SCI_GRAPHICS_GFXDRIVERS_H Definition: gfxdrivers.h:137
Definition: gfxdrivers.h:176
Definition: gfxdrivers.h:199
Definition: gfxdrivers.h:114
Definition: gfxdrivers.h:330
Definition: gfxdrivers.h:286
Definition: gfxdrivers.h:250
Definition: gfxdrivers.h:312
Definition: atari-cursor.h:38
Definition: gfxdrivers.h:210
Definition: gfxdrivers.h:78
Definition: gfxdrivers.h:37
Definition: formatinfo.h:28
Definition: gfxdrivers.h:367
Definition: helpers.h:269
Definition: gfxdrivers.h:154
Definition: gfxdrivers.h:351