diff options
author | Paul Gilbert | 2012-01-19 08:51:18 +1100 |
---|---|---|
committer | Strangerke | 2012-04-06 08:19:56 +0200 |
commit | 78a653b24583506c1229b080000643e70685b065 (patch) | |
tree | d7d97dd552d727cdec7fb83d579a0be25e366920 /engines/mortevielle | |
parent | 45083e7c94508d09e8e96e8e90c452218e2a07bc (diff) | |
download | scummvm-rg350-78a653b24583506c1229b080000643e70685b065.tar.gz scummvm-rg350-78a653b24583506c1229b080000643e70685b065.tar.bz2 scummvm-rg350-78a653b24583506c1229b080000643e70685b065.zip |
MORTEVIELLE: Implement ScreenSurface::fillBox method
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/graphics.cpp | 16 | ||||
-rw-r--r-- | engines/mortevielle/graphics.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/var_mor.cpp | 3 |
3 files changed, 20 insertions, 1 deletions
diff --git a/engines/mortevielle/graphics.cpp b/engines/mortevielle/graphics.cpp index 44bd58dfb5..0c2872f226 100644 --- a/engines/mortevielle/graphics.cpp +++ b/engines/mortevielle/graphics.cpp @@ -982,6 +982,22 @@ void ScreenSurface::drawBox(int x, int y, int dx, int dy, int col) { destSurface.vLine(dx - 2, 2, destSurface.h - 3, col); } +/** + * Fills an area with the specified colour + * @remarks Because the ScummVM surface is using a double height 640x400 surface to + * simulate the original 640x400 surface, all Y values have to be doubled + */ +void ScreenSurface::fillBox(int colour, const Common::Rect &bounds, int patt) { + Graphics::Surface destSurface = lockArea(Common::Rect(bounds.left, bounds.top * 2, + bounds.right, bounds.bottom * 2)); + + // Fill the area + destSurface.fillRect(Common::Rect(0, 0, destSurface.w, destSurface.h), 0); + + // TODO: Figure out what effect patterns of other than '0xff' have + if (patt != 0xff) + warning("TODO: Figure out operation of ScreenSurface::box when pattern is %xh", patt); +} /** * Sets a single pixel at the specified co-ordinates diff --git a/engines/mortevielle/graphics.h b/engines/mortevielle/graphics.h index f3d09858bd..4f3956bdcf 100644 --- a/engines/mortevielle/graphics.h +++ b/engines/mortevielle/graphics.h @@ -84,6 +84,8 @@ public: void drawPicture(GfxSurface &surface, int x, int y); void writeCharacter(const Common::Point &pt, unsigned char ch, int palIndex); void drawBox(int x, int y, int dx, int dy, int col); + void fillBox(int colour, const Common::Rect &bounds, int patt); + // TODO: Refactor code to remove this method, for increased performance void setPixel(const Common::Point &pt, int palIndex); }; diff --git a/engines/mortevielle/var_mor.cpp b/engines/mortevielle/var_mor.cpp index 0b004a163a..2b20173174 100644 --- a/engines/mortevielle/var_mor.cpp +++ b/engines/mortevielle/var_mor.cpp @@ -394,7 +394,8 @@ void s_sauv(int Gd, int y, int dy) { // (* external 'c:\mc\boite.com'; *) void box(int c, int Gd, int xo, int yo, int xi, int yi, int patt) { - warning("TODO: box method not yet implemented"); + warning("TODO: box deprecated in favour of GfxSurface::fillBox"); + g_vm->_screenSurface.fillBox(c, Common::Rect(xo, yo, xi, yi), patt); } // (* external 'c:\mc\decomp.com'; *) |