31
31
#include "common/ptr.h"
33
33
#include "gob/gob.h"
34
#include "gob/surface.h"
40
Font(const byte *data);
43
43
uint8 getCharWidth (uint8 c) const;
44
44
uint8 getCharWidth () const;
45
45
uint8 getCharHeight() const;
46
uint16 getCharCount () const;
47
uint8 getFirstChar () const;
48
uint8 getLastChar () const;
49
uint8 getCharSize () const;
51
47
bool isMonospaced() const;
53
const byte *getCharData(uint8 c) const;
55
Font(const byte *data);
49
void drawLetter(Surface &surf, uint8 c, uint16 x, uint16 y,
50
uint32 color1, uint32 color2, bool transp) const;
59
53
const byte *_dataPtr;
71
// Some Surfaces are simultaneous in Draw::spritesArray and discrete
72
// variables, so if in doubt you should use a SurfaceDescPtr shared
73
// pointer object to refer to any SurfaceDesc.
78
int16 getWidth() const { return _width; }
79
int16 getHeight() const { return _height; }
80
byte *getVidMem() { return _vidMem; }
81
const byte *getVidMem() const { return _vidMem; }
82
bool hasOwnVidMem() const { return _ownVidMem; }
84
void setVidMem(byte *vidMem);
85
void resize(int16 width, int16 height);
86
void swap(SurfaceDesc &surf);
88
SurfaceDesc(int16 vidMode, int16 width, int16 height, byte *vidMem = 0);
89
~SurfaceDesc() { if (_ownVidMem) delete[] _vidMem; }
98
typedef Common::SharedPtr<SurfaceDesc> SurfaceDescPtr;
64
uint16 getCharCount() const;
65
const byte *getCharData(uint8 c) const;
103
#define GDR_VERSION 4
105
#define PRIMARY_SURFACE 0x80
106
#define RETURN_PRIMARY 0x01
107
#define DISABLE_SPR_ALLOC 0x20
108
#define SCUMMVM_CURSOR 0x100
72
#define PRIMARY_SURFACE 0x80
73
#define RETURN_PRIMARY 0x01
74
#define DISABLE_SPR_ALLOC 0x20
75
#define SCUMMVM_CURSOR 0x100
110
77
#include "common/pack-start.h" // START STRUCT PACKING
154
117
void waitRetrace(bool mouse = true);
155
118
void sparseRetrace(int max);
157
void putPixel(int16 x, int16 y, int16 color, SurfaceDesc &dest);
158
virtual void fillRect(SurfaceDesc &dest, int16 left, int16 top,
159
int16 right, int16 bottom, int16 color);
160
void drawLine(SurfaceDesc &dest, int16 x0, int16 y0, int16 x1, int16 y1,
162
void drawCircle(SurfaceDesc &dest, int16 x0, int16 y0,
163
int16 radius, int16 color);
164
void clearSurf(SurfaceDesc &dest);
165
void drawSprite(SurfaceDesc &source, SurfaceDesc &dest,
166
int16 left, int16 top, int16 right, int16 bottom,
167
int16 x, int16 y, int16 transp);
168
void drawSpriteDouble(SurfaceDesc &source, SurfaceDesc &dest,
169
int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp);
170
void drawLetter(int16 item, int16 x, int16 y, const Font &font,
171
int16 color1, int16 color2, int16 transp, SurfaceDesc &dest);
172
120
void drawPackedSprite(byte *sprBuf, int16 width, int16 height,
173
int16 x, int16 y, int16 transp, SurfaceDesc &dest);
174
void drawPackedSprite(const char *path, SurfaceDesc &dest,
121
int16 x, int16 y, int16 transp, Surface &dest);
122
void drawPackedSprite(const char *path, Surface &dest, int width = 320);
177
124
void setPalColor(byte *pal, byte red, byte green, byte blue) {
178
125
pal[0] = red << 2;
179
126
pal[1] = green << 2;
180
127
pal[2] = blue << 2;
183
129
void setPalColor(byte *pal, Color &color) {
184
130
setPalColor(pal, color.red, color.green, color.blue);
219
char initDriver(int16 vidMode);
222
void drawOSDText(const char *text);
159
void drawPacked(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, Surface &dest);
225
162
class Video_v1 : public Video {
227
164
virtual char spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
228
int16 x, int16 y, int16 transp, SurfaceDesc &destDesc);
165
int16 x, int16 y, int16 transp, Surface &destDesc);
230
167
Video_v1(GobEngine *vm);
231
168
virtual ~Video_v1() {}
243
180
class Video_v6 : public Video_v2 {
245
182
virtual char spriteUncompressor(byte *sprBuf, int16 srcWidth, int16 srcHeight,
246
int16 x, int16 y, int16 transp, SurfaceDesc &destDesc);
248
virtual void fillRect(SurfaceDesc &dest, int16 left, int16 top,
249
int16 right, int16 bottom, int16 color);
253
virtual void setPrePalette();
183
int16 x, int16 y, int16 transp, Surface &destDesc);
255
185
Video_v6(GobEngine *vm);
256
186
virtual ~Video_v6() {}
259
static const byte _ditherPalette[768];
263
void shadeRect(SurfaceDesc &dest,
264
int16 left, int16 top, int16 right, int16 bottom, byte color, byte strength);
266
void drawPacked(const byte *sprBuf, int16 x, int16 y, SurfaceDesc &surfDesc);
267
void drawYUVData(const byte *srcData, SurfaceDesc &destDesc,
189
void drawPacked(const byte *sprBuf, int16 x, int16 y, Surface &surfDesc);
190
void drawYUVData(const byte *srcData, Surface &destDesc,
268
191
int16 width, int16 height, int16 x, int16 y);
269
void drawYUV(SurfaceDesc &destDesc, int16 x, int16 y,
192
void drawYUV(Surface &destDesc, int16 x, int16 y,
270
193
int16 dataWidth, int16 dataHeight, int16 width, int16 height,
271
194
const byte *dataY, const byte *dataU, const byte *dataV);
277
virtual ~VideoDriver() {}
278
virtual void drawSprite(SurfaceDesc &source, SurfaceDesc &dest, int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp) = 0;
279
virtual void drawSpriteDouble(SurfaceDesc &source, SurfaceDesc &dest, int16 left, int16 top, int16 right, int16 bottom, int16 x, int16 y, int16 transp) = 0;
280
virtual void fillRect(SurfaceDesc &dest, int16 left, int16 top, int16 right, int16 bottom, byte color) = 0;
281
virtual void putPixel(int16 x, int16 y, byte color, SurfaceDesc &dest) = 0;
282
virtual void drawLetter(unsigned char item, int16 x, int16 y, const Font &font, byte color1, byte color2, byte transp, SurfaceDesc &dest) = 0;
283
virtual void drawLine(SurfaceDesc &dest, int16 x0, int16 y0, int16 x1, int16 y1, byte color) = 0;
284
virtual void drawPackedSprite(byte *sprBuf, int16 width, int16 height, int16 x, int16 y, byte transp, SurfaceDesc &dest) = 0;
287
197
} // End of namespace Gob
289
199
#endif // GOB_VIDEO_H