From 78a653b24583506c1229b080000643e70685b065 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Thu, 19 Jan 2012 08:51:18 +1100 Subject: MORTEVIELLE: Implement ScreenSurface::fillBox method --- engines/mortevielle/graphics.cpp | 16 ++++++++++++++++ engines/mortevielle/graphics.h | 2 ++ engines/mortevielle/var_mor.cpp | 3 ++- 3 files changed, 20 insertions(+), 1 deletion(-) (limited to 'engines/mortevielle') 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'; *) -- cgit v1.2.3