aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/gfx.h
diff options
context:
space:
mode:
authorMax Horn2006-09-18 21:20:21 +0000
committerMax Horn2006-09-18 21:20:21 +0000
commit13246773955961d761f3e757da0888a0a203703c (patch)
tree756edee0101aafb346ed91aff0462167fd697a06 /engines/scumm/gfx.h
parenta0e1a986471436709cdafe7ef5af27ab3f9ab26e (diff)
downloadscummvm-rg350-13246773955961d761f3e757da0888a0a203703c.tar.gz
scummvm-rg350-13246773955961d761f3e757da0888a0a203703c.tar.bz2
scummvm-rg350-13246773955961d761f3e757da0888a0a203703c.zip
Moved NES specific code from class Gdi to GdiNES
svn-id: r23934
Diffstat (limited to 'engines/scumm/gfx.h')
-rw-r--r--engines/scumm/gfx.h61
1 files changed, 42 insertions, 19 deletions
diff --git a/engines/scumm/gfx.h b/engines/scumm/gfx.h
index 8663acf99a..415e40c6bc 100644
--- a/engines/scumm/gfx.h
+++ b/engines/scumm/gfx.h
@@ -190,6 +190,7 @@ struct StripTable;
#define CHARSET_MASK_TRANSPARENCY 253
class Gdi {
+protected:
ScummEngine *_vm;
public:
@@ -197,9 +198,6 @@ public:
int _imgBufOffs[8];
int32 _numStrips;
- Gdi(ScummEngine *vm);
- virtual ~Gdi();
-
protected:
byte _paletteMod;
byte *_roomPalette;
@@ -219,14 +217,6 @@ protected:
byte maskMap[4096], maskChar[4096];
} _C64;
- struct {
- byte nametable[16][64], nametableObj[16][64];
- byte attributes[64], attributesObj[64];
- byte masktable[16][8], masktableObj[16][8];
- int objX;
- bool hasmask;
- } _NES;
-
/** For V2 games, we cache offsets into the room graphics, to speed up things. */
StripTable *_roomStrips;
@@ -236,7 +226,6 @@ protected:
void drawStripEGA(byte *dst, int dstPitch, const byte *src, int height) const;
void drawStripC64Object(byte *dst, int dstPitch, int stripnr, int width, int height);
void drawStripC64Background(byte *dst, int dstPitch, int stripnr, int height);
- void drawStripNES(byte *dst, byte *mask, int dstPitch, int stripnr, int top, int height);
void drawStripComplex(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
void drawStripBasicH(byte *dst, int dstPitch, const byte *src, int height, const bool transpCheck) const;
@@ -253,7 +242,6 @@ protected:
/* Mask decompressors */
void drawStripC64Mask(byte *dst, int stripnr, int width, int height) const;
- void drawStripNESMask(byte *dst, int stripnr, int top, int height) const;
void decompressTMSK(byte *dst, const byte *tmsk, const byte *src, int height) const;
void decompressMaskImgOr(byte *dst, const byte *src, int height) const;
void decompressMaskImg(byte *dst, const byte *src, int height) const;
@@ -275,17 +263,18 @@ protected:
int stripnr, int numzbuf, const byte *zplane_list[9],
bool transpStrip, byte flag, const byte *tmsk_ptr);
+ virtual void prepareDrawBitmap(const byte *ptr, int x, int y, const int width, const int height);
+
public:
- void init();
- void roomChanged(byte *roomptr, uint32 IM00_offs, byte transparentColor);
+ Gdi(ScummEngine *vm);
+ virtual ~Gdi();
+
+ virtual void init();
+ virtual void roomChanged(byte *roomptr, uint32 IM00_offs, byte transparentColor);
void drawBitmap(const byte *ptr, VirtScreen *vs, int x, int y, const int width, const int height,
int stripnr, int numstrip, byte flag);
- void decodeNESGfx(const byte *room);
- void decodeNESObject(const byte *ptr, int xpos, int ypos, int width, int height);
-
-
#ifndef DISABLE_HE
void drawBMAPBg(const byte *ptr, VirtScreen *vs);
void drawBMAPObject(const byte *ptr, VirtScreen *vs, int obj, int x, int y, int w, int h);
@@ -304,6 +293,40 @@ public:
};
};
+class GdiNES : public Gdi {
+protected:
+ //ScummEngine *_vm;
+
+ struct {
+ byte nametable[16][64], nametableObj[16][64];
+ byte attributes[64], attributesObj[64];
+ byte masktable[16][8], masktableObj[16][8];
+ int objX;
+ bool hasmask;
+ } _NES;
+
+ void decodeNESGfx(const byte *room);
+ void decodeNESObject(const byte *ptr, int xpos, int ypos, int width, int height);
+
+ void drawStripNES(byte *dst, byte *mask, int dstPitch, int stripnr, int top, int height);
+ void drawStripNESMask(byte *dst, int stripnr, int top, int height) const;
+
+ virtual bool drawStrip(byte *dstPtr, VirtScreen *vs,
+ int x, int y, const int width, const int height,
+ int stripnr, const byte *smap_ptr);
+
+ virtual void decodeMask(int x, int y, const int width, const int height,
+ int stripnr, int numzbuf, const byte *zplane_list[9],
+ bool transpStrip, byte flag, const byte *tmsk_ptr);
+
+ virtual void prepareDrawBitmap(const byte *ptr, int x, int y, const int width, const int height);
+
+public:
+ GdiNES(ScummEngine *vm);
+
+ virtual void roomChanged(byte *roomptr, uint32 IM00_offs, byte transparentColor);
+};
+
} // End of namespace Scumm