Skip to content

Commit

Permalink
MORTEVIELLE: Implement ScreenSurface::fillBox method
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster authored and Strangerke committed Apr 6, 2012
1 parent 02724f7 commit 8c5e725
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions engines/mortevielle/graphics.cpp
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions engines/mortevielle/graphics.h
Expand Up @@ -84,6 +84,8 @@ class ScreenSurface: public Graphics::Surface {
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);
};
Expand Down
3 changes: 2 additions & 1 deletion engines/mortevielle/var_mor.cpp
Expand Up @@ -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'; *)
Expand Down

0 comments on commit 8c5e725

Please sign in to comment.