removed special case of Graphics::copyRect in favor of more general code

svn-id: r26126
This commit is contained in:
Nicola Mettifogo 2007-03-13 20:47:59 +00:00
parent dbca9d0c47
commit 922c0a7ea0
3 changed files with 12 additions and 15 deletions

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}