From 922c0a7ea0a47eb8a6445866b1ef6c84ccb65337 Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Tue, 13 Mar 2007 20:47:59 +0000 Subject: removed special case of Graphics::copyRect in favor of more general code svn-id: r26126 --- engines/parallaction/graphics.cpp | 12 ++++++++---- engines/parallaction/graphics.h | 1 - engines/parallaction/inventory.cpp | 14 ++++---------- 3 files changed, 12 insertions(+), 15 deletions(-) (limited to 'engines') diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp index c60900a962..056e683bec 100644 --- a/engines/parallaction/graphics.cpp +++ b/engines/parallaction/graphics.cpp @@ -310,7 +310,7 @@ void Gfx::copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer) { return; } - +/* void Gfx::copyRect(Gfx::Buffers srcbuffer, uint16 sx, uint16 sy, Gfx::Buffers dstbuffer, uint16 dx, uint16 dy, uint16 w, uint16 h) { byte *s = _buffers[srcbuffer] + (sx + sy * SCREEN_WIDTH); @@ -328,7 +328,7 @@ void Gfx::copyRect(Gfx::Buffers srcbuffer, uint16 sx, uint16 sy, Gfx::Buffers ds return; } - +*/ void Gfx::floodFill(byte color, uint16 left, uint16 top, uint16 right, uint16 bottom, Gfx::Buffers buffer) { // printf("Gfx::floodFill(%i, %i, %i, %i, %i)\n", color, left, top, right, bottom); @@ -794,7 +794,6 @@ void Gfx::setFont(const char* name) { void Gfx::restoreBackground(const Common::Rect& r) { -// printf("restoreBackground(%i, %i, %i, %i)\n", left, top, width, height); int16 left = r.left; int16 top = r.top; @@ -810,7 +809,12 @@ void Gfx::restoreBackground(const Common::Rect& r) { if (left+width >= SCREEN_WIDTH) width = SCREEN_WIDTH - left; if (top+height >= SCREEN_HEIGHT) height = SCREEN_HEIGHT - top; - copyRect(kBit2, left, top, kBitBack, left, top, width, height); + copyRect( + kBitBack, + left, top, width, height, + _buffers[kBit2] + left + top * SCREEN_WIDTH, + SCREEN_WIDTH + ); return; } diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h index af4ed190a9..ac5eee619d 100644 --- a/engines/parallaction/graphics.h +++ b/engines/parallaction/graphics.h @@ -112,7 +112,6 @@ public: void updateScreen(); void clearScreen(Gfx::Buffers buffer); void copyScreen(Gfx::Buffers srcbuffer, Gfx::Buffers dstbuffer); - void copyRect(Gfx::Buffers srcbuffer, uint16 sx, uint16 sy, Gfx::Buffers dstbuffer, uint16 dx, uint16 dy, uint16 w, uint16 h); void copyRect(Gfx::Buffers dstbuffer, uint16 x, uint16 y, uint16 w, uint16 h, byte *src, uint16 pitch); void grabRect(Gfx::Buffers srcbuffer, byte *dst, uint16 x, uint16 y, uint16 w, uint16 h, uint16 pitch); void drawBorder(Gfx::Buffers buffer, uint16 x, uint16 y, uint16 w, uint16 h, byte color); diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index 9ec5611154..a71cf1aec0 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -297,16 +297,10 @@ void jobHideInventory(void *parm, Job *j) { _engineFlags &= ~kEngineMouse; } - _vm->_gfx->copyRect( - Gfx::kBit2, - _invPosition._x, - _invPosition._y, - Gfx::kBitBack, - _invPosition._x, - _invPosition._y, - INVENTORY_WIDTH, - _numInvLines * INVENTORYITEM_HEIGHT - ); + Common::Rect r(INVENTORY_WIDTH, _numInvLines * INVENTORYITEM_HEIGHT); + r.moveTo(_invPosition._x, _invPosition._y); + + _vm->_gfx->restoreBackground(r); return; } -- cgit v1.2.3