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 GfxDriver(uint16 screenWidth, uint16 screenHeight,
int numColors) : _screenW(screenWidth), _screenH(screenHeight), _numColors(numColors), _ready(
false), _pixelSize(1) {}
42 virtual void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping) = 0;
43 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;
44 virtual void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor) = 0;
49 virtual void copyCurrentBitmap(byte *dest, uint32 size)
const = 0;
50 virtual void copyCurrentPalette(byte *dest,
int start,
int num)
const;
51 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;
52 virtual byte remapTextColor(byte color)
const {
return color; }
53 virtual bool supportsPalIntensity()
const = 0;
54 virtual bool driverBasedTextRendering()
const = 0;
55 uint16 numColors()
const {
return _numColors; }
56 byte pixelSize()
const {
return _pixelSize; }
59 static bool checkDriver(
const char *
const *driverNames,
int listSize);
60 const uint16 _screenW;
61 const uint16 _screenH;
68 GfxDefaultDriver(uint16 screenWidth, uint16 screenHeight,
bool isSCI0,
bool rgbRendering);
71 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
72 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;
73 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
75 void copyCurrentBitmap(byte *dest, uint32 size)
const override;
76 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
77 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
78 bool supportsPalIntensity()
const override {
return true; }
79 bool driverBasedTextRendering()
const override {
return false; }
81 void updatePalette(
const byte *colors, uint start, uint num);
82 byte *_compositeBuffer;
84 byte *_currentPalette;
85 byte *_internalPalette;
90 bool _cursorUsesScreenPalette;
91 const bool _alwaysCreateBmpBuffer;
92 const bool _requestRGBMode;
93 typedef void (*ColorConvProc)(byte*,
const byte*, int, int, int,
const byte*);
94 ColorConvProc _colorConv;
96 ColorConvModProc _colorConvMod;
98 void generateOutput(byte *dst,
const byte *src,
int pitch,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping);
106 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
108 void copyCurrentBitmap(byte*, uint32)
const override;
109 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
110 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
111 bool supportsPalIntensity()
const override {
return false; }
112 bool driverBasedTextRendering()
const override {
return false; }
114 void assignPalette(
const byte *colors);
115 byte *_compositeBuffer;
116 const byte *_internalPalette;
118 virtual void setupRenderProc() = 0;
119 const bool _requestRGBMode;
127 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
128 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
129 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(&_driverFile, 1); }
131 void setupRenderProc()
override;
132 uint16 *_cgaPatterns;
134 const bool _disableMode5;
135 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const uint16*,
const byte*);
136 LineProc _renderLine;
137 static const char *_driverFile;
144 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
145 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
149 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(_driverFiles, 2); }
151 void setupRenderProc()
override;
152 byte _monochromePalette[6];
153 const byte *_monochromePatterns;
155 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const byte*,
const byte*);
156 LineProc _renderLine;
157 static const char *_driverFiles[2];
164 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
165 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
169 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS) && checkDriver(&_driverFile, 1); }
171 void setupRenderProc()
override;
172 const uint16 _centerX;
173 const uint16 _centerY;
174 byte _monochromePalette[6];
175 const byte *_monochromePatterns;
176 typedef void (*LineProc)(byte*&,
const byte*, int, int, int,
const byte*,
const byte*);
177 LineProc _renderLine;
178 static const char *_driverFile;
185 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
186 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS || p == Common::kPlatformWindows) && checkDriver(&_driverFile, 1); }
188 byte *_greyScalePalette;
189 static const char *_driverFile;
197 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod*,
const byte*)
override;
198 void copyRectToScreen(
const byte *src,
int srcX,
int srcY,
int pitch,
int destX,
int destY,
int w,
int h,
const PaletteMod*,
const byte*)
override;
199 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
201 void copyCurrentBitmap(byte *dest, uint32 size)
const override;
202 void copyCurrentPalette(byte *dest,
int start,
int num)
const override;
203 void drawTextFontGlyph(
const byte*,
int,
int,
int,
int,
int,
int,
const PaletteMod*,
const byte*)
override;
207 bool supportsPalIntensity()
const override {
return false; }
208 bool driverBasedTextRendering()
const override {
return false; }
209 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformDOS || p == Common::kPlatformWindows) && checkDriver(&_driverFile, 1); }
211 byte *_compositeBuffer;
212 byte *_currentBitmap;
213 byte *_currentPalette;
214 byte *_egaColorPatterns;
216 const byte *_internalPalette;
217 const byte *_egaMatchTable;
218 const bool _requestRGBMode;
219 typedef void (*LineProc)(byte*&,
const byte*, int,
const byte*,
const byte*);
220 LineProc _renderLine;
221 static const char *_driverFile;
226 UpscaledGfxDriver(uint16 screenWidth, uint16 screenHeight, uint16 textAlignX,
bool scaleCursor,
bool rgbRendering);
229 void setPalette(
const byte *colors, uint start, uint num,
bool update,
const PaletteMod *palMods,
const byte *palModMapping)
override;
230 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;
231 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
235 void drawTextFontGlyph(
const byte *src,
int pitch,
int hiresDestX,
int hiresDestY,
int hiresW,
int hiresH,
int transpColor,
const PaletteMod *palMods,
const byte *palModMapping)
override;
236 bool driverBasedTextRendering()
const override {
return true; }
238 void updateScreen(
int destX,
int destY,
int w,
int h,
const PaletteMod *palMods,
const byte *palModMapping);
239 void adjustCursorBuffer(uint16 newWidth, uint16 newHeight);
240 typedef void (*GlyphRenderProc)(byte*, int,
const byte*, int, int, int, int);
241 GlyphRenderProc _renderGlyph;
242 typedef void (*ScaledRenderProc)(byte*,
const byte*, int, int, int);
243 ScaledRenderProc _renderScaled;
247 const bool _scaleCursor;
249 uint16 _cursorHeight;
250 bool _needCursorBuffer;
258 kFontStyleSpecialSCI1
261 PC98Gfx16ColorsDriver(
int textAlignX,
bool cursorScaleWidth,
bool cursorScaleHeight, SjisFontStyle sjisFontStyle,
bool rgbRendering,
bool needsUnditheringPalette);
264 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
265 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
266 byte remapTextColor(byte color)
const override;
268 const byte *_convPalette;
269 const byte *_textModePalette;
270 const bool _cursorScaleHeightOnly;
271 const bool _needsUnditheringPalette;
272 SjisFontStyle _fontStyle;
280 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
281 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
282 byte remapTextColor(byte color)
const override;
283 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformPC98) && checkDriver(_driverFiles, 2); }
285 const byte *_convPalette;
286 const bool _cursorScaleHeightOnly;
287 const bool _useTextMode;
288 static const char *_driverFiles[2];
296 void setPalette(
const byte*, uint, uint,
bool,
const PaletteMod*,
const byte*)
override {}
297 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;
298 void replaceCursor(
const void *cursor, uint w, uint h,
int hotspotX,
int hotspotY, uint32 keycolor)
override;
299 static bool validateMode(
Common::Platform p) {
return (p == Common::kPlatformPC98) && checkDriver(&_driverFile, 1); }
301 const byte *_ditheringTable;
302 const byte *_convPalette;
303 static const char *_driverFile;
308 #endif // SCI_GRAPHICS_GFXDRIVERS_H Definition: gfxdrivers.h:123
Definition: gfxdrivers.h:160
Definition: gfxdrivers.h:181
Definition: gfxdrivers.h:101
Definition: gfxdrivers.h:253
Definition: gfxdrivers.h:224
Definition: atari-cursor.h:38
Definition: gfxdrivers.h:192
Definition: gfxdrivers.h:66
Definition: gfxdrivers.h:37
Definition: formatinfo.h:28
Definition: gfxdrivers.h:291
Definition: helpers.h:268
Definition: gfxdrivers.h:140
Definition: gfxdrivers.h:275