2002-03-22 03:31:55 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2001 Ludvig Strigeus
|
2003-03-06 21:46:56 +00:00
|
|
|
* Copyright (C) 2001-2003 The ScummVM project
|
2002-03-22 03:31:55 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2002-07-17 20:55:36 +00:00
|
|
|
#ifndef GFX_H
|
|
|
|
#define GFX_H
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
enum { /* Camera modes */
|
|
|
|
CM_NORMAL = 1,
|
|
|
|
CM_FOLLOW_ACTOR = 2,
|
|
|
|
CM_PANNING = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
struct CameraData { /* Camera state data */
|
|
|
|
ScummPoint _cur;
|
|
|
|
ScummPoint _dest;
|
|
|
|
ScummPoint _accel;
|
|
|
|
ScummPoint _last;
|
|
|
|
int _leftTrigger, _rightTrigger;
|
|
|
|
byte _follows, _mode;
|
|
|
|
bool _movingToActor;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct VirtScreen { /* Virtual screen areas */
|
|
|
|
int number;
|
|
|
|
uint16 topline;
|
2002-08-20 02:20:40 +00:00
|
|
|
uint16 width, height;
|
2002-12-26 01:15:09 +00:00
|
|
|
int size;
|
2002-03-22 03:30:57 +00:00
|
|
|
byte alloctwobuffers;
|
2002-10-20 01:02:52 +00:00
|
|
|
bool scrollable;
|
2002-03-22 03:30:57 +00:00
|
|
|
uint16 xstart;
|
2002-10-24 06:28:54 +00:00
|
|
|
uint16 tdirty[80];
|
|
|
|
uint16 bdirty[80];
|
2002-03-22 03:30:57 +00:00
|
|
|
byte *screenPtr;
|
|
|
|
byte *backBuf;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MouseCursor { /* Mouse cursor */
|
|
|
|
int8 hotspot_x, hotspot_y;
|
|
|
|
byte colors[4];
|
|
|
|
byte data[32];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ColorCycle { /* Palette cycles */
|
|
|
|
uint16 delay;
|
|
|
|
uint16 counter;
|
|
|
|
uint16 flags;
|
|
|
|
byte start;
|
|
|
|
byte end;
|
|
|
|
};
|
|
|
|
|
2002-04-21 21:20:32 +00:00
|
|
|
struct BlastObject { /* BlastObjects to draw */
|
2002-11-06 15:29:49 +00:00
|
|
|
uint16 number;
|
2002-08-20 02:20:40 +00:00
|
|
|
int16 posX, posY;
|
|
|
|
uint16 width, height;
|
2002-09-19 11:06:10 +00:00
|
|
|
uint16 scaleX, scaleY;
|
|
|
|
uint16 image;
|
2002-04-21 21:20:32 +00:00
|
|
|
uint16 mode;
|
2002-03-22 03:30:57 +00:00
|
|
|
};
|
|
|
|
|
2002-05-01 00:13:03 +00:00
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma START_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
struct BompHeader { /* Bomp header */
|
2002-12-25 03:48:27 +00:00
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
uint16 unk;
|
|
|
|
uint16 width, height;
|
|
|
|
} GCC_PACK old;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
uint32 width, height;
|
|
|
|
} GCC_PACK v8;
|
|
|
|
} GCC_PACK;
|
2002-03-22 03:30:57 +00:00
|
|
|
} GCC_PACK;
|
|
|
|
|
2002-05-01 00:13:03 +00:00
|
|
|
#if !defined(__GNUC__)
|
|
|
|
#pragma END_PACK_STRUCTS
|
|
|
|
#endif
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
struct BompDrawData { /* Bomp graphics data */
|
|
|
|
byte *out;
|
|
|
|
int outwidth, outheight;
|
2002-08-20 02:20:40 +00:00
|
|
|
int x, y;
|
2002-03-22 03:30:57 +00:00
|
|
|
byte scale_x, scale_y;
|
|
|
|
byte *dataptr;
|
|
|
|
int srcwidth, srcheight;
|
2002-11-06 15:29:49 +00:00
|
|
|
uint16 shadowMode;
|
2002-03-22 03:30:57 +00:00
|
|
|
};
|
|
|
|
|
2002-12-04 13:36:27 +00:00
|
|
|
class Gdi {
|
|
|
|
friend class Scumm; // Mostly for the code in saveload.cpp ...
|
|
|
|
public:
|
2002-03-22 03:30:57 +00:00
|
|
|
Scumm *_vm;
|
|
|
|
|
|
|
|
int _numZBuffer;
|
2002-12-26 18:10:14 +00:00
|
|
|
int _imgBufOffs[8];
|
2002-03-22 03:30:57 +00:00
|
|
|
byte _disable_zbuffer;
|
2002-10-24 06:28:54 +00:00
|
|
|
int32 _numStrips;
|
2002-12-04 15:00:35 +00:00
|
|
|
int16 _mask_top, _mask_bottom, _mask_right, _mask_left;
|
2002-03-22 03:30:57 +00:00
|
|
|
|
2002-12-04 13:36:27 +00:00
|
|
|
protected:
|
2002-12-04 15:00:35 +00:00
|
|
|
byte *_readPtr;
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
bool _useOrDecompress;
|
2002-04-12 21:26:59 +00:00
|
|
|
byte _cursorActive;
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
byte *_mask_ptr;
|
|
|
|
byte *_mask_ptr_dest;
|
|
|
|
|
2002-04-17 03:11:37 +00:00
|
|
|
byte _palette_mod;
|
2002-03-22 03:30:57 +00:00
|
|
|
byte _decomp_shr, _decomp_mask;
|
2002-12-31 14:59:06 +00:00
|
|
|
byte _transparentColor;
|
2002-04-23 23:58:31 +00:00
|
|
|
uint32 _vertStripNextInc;
|
2002-03-22 03:30:57 +00:00
|
|
|
|
|
|
|
/* Bitmap decompressors */
|
2002-12-31 14:59:06 +00:00
|
|
|
bool decompressBitmap(byte *bgbak_ptr, byte *smap_ptr, int numLinesToProcess);
|
2003-04-09 19:14:05 +00:00
|
|
|
void decodeStripEGA(byte *dst, byte *src, int height);
|
2003-04-30 05:48:55 +00:00
|
|
|
void decodeStripOldEGA(byte *dst, byte *src, int height, int stripnr);
|
|
|
|
void decompressMaskImgOld(byte *dst, byte *src, int stripnr);
|
2002-12-31 14:59:06 +00:00
|
|
|
void unkDecodeA(byte *dst, byte *src, int height);
|
|
|
|
void unkDecodeA_trans(byte *dst, byte *src, int height);
|
|
|
|
void unkDecodeB(byte *dst, byte *src, int height);
|
|
|
|
void unkDecodeB_trans(byte *dst, byte *src, int height);
|
|
|
|
void unkDecodeC(byte *dst, byte *src, int height);
|
|
|
|
void unkDecodeC_trans(byte *dst, byte *src, int height);
|
|
|
|
|
2002-12-16 01:25:21 +00:00
|
|
|
void unkDecode7(byte *dst, byte *src, int height);
|
|
|
|
void unkDecode8(byte *dst, byte *src, int height);
|
|
|
|
void unkDecode9(byte *dst, byte *src, int height);
|
|
|
|
void unkDecode10(byte *dst, byte *src, int height);
|
|
|
|
void unkDecode11(byte *dst, byte *src, int height);
|
2002-03-22 03:30:57 +00:00
|
|
|
|
2002-12-04 13:36:27 +00:00
|
|
|
void draw8ColWithMasking(byte *dst, byte *src, int height, byte *mask);
|
|
|
|
void draw8Col(byte *dst, byte *src, int height);
|
|
|
|
void clear8ColWithMasking(byte *dst, int height, byte *mask);
|
|
|
|
void clear8Col(byte *dst, int height);
|
|
|
|
void decompressMaskImgOr(byte *dst, byte *src, int height);
|
|
|
|
void decompressMaskImg(byte *dst, byte *src, int height);
|
2002-03-22 03:30:57 +00:00
|
|
|
|
2002-12-15 23:40:37 +00:00
|
|
|
void drawStripToScreen(VirtScreen *vs, int x, int w, int t, int b);
|
|
|
|
void updateDirtyScreen(VirtScreen *vs);
|
|
|
|
|
2002-12-04 13:36:27 +00:00
|
|
|
public:
|
2002-12-16 01:25:21 +00:00
|
|
|
void drawBitmap(byte *ptr, VirtScreen *vs, int x, int y, const int h, int stripnr, int numstrip, byte flag);
|
2002-12-04 15:00:35 +00:00
|
|
|
void clearUpperMask();
|
|
|
|
|
|
|
|
void disableZBuffer() { _disable_zbuffer++; }
|
|
|
|
void enableZBuffer() { _disable_zbuffer--; }
|
|
|
|
|
|
|
|
void resetBackground(int top, int bottom, int strip);
|
|
|
|
|
2002-03-22 03:30:57 +00:00
|
|
|
enum DrawBitmapFlags {
|
|
|
|
dbAllowMaskOr = 1,
|
2002-09-29 15:20:02 +00:00
|
|
|
dbDrawMaskOnAll = 2,
|
2002-03-22 03:30:57 +00:00
|
|
|
dbClear = 4
|
|
|
|
};
|
|
|
|
};
|
2002-07-17 20:55:36 +00:00
|
|
|
|
|
|
|
#endif
|