aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2007-03-13 20:47:59 +0000
committerNicola Mettifogo2007-03-13 20:47:59 +0000
commit922c0a7ea0a47eb8a6445866b1ef6c84ccb65337 (patch)
tree1a4799e9baf61c47e267fd3d7fdbc057e939499b
parentdbca9d0c4787eae76846c738e4a958a97bd860bd (diff)
downloadscummvm-rg350-922c0a7ea0a47eb8a6445866b1ef6c84ccb65337.tar.gz
scummvm-rg350-922c0a7ea0a47eb8a6445866b1ef6c84ccb65337.tar.bz2
scummvm-rg350-922c0a7ea0a47eb8a6445866b1ef6c84ccb65337.zip
removed special case of Graphics::copyRect in favor of more general code
svn-id: r26126
-rw-r--r--engines/parallaction/graphics.cpp12
-rw-r--r--engines/parallaction/graphics.h1
-rw-r--r--engines/parallaction/inventory.cpp14
3 files changed, 12 insertions, 15 deletions
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;
}