diff options
author | Gregory Montoir | 2004-01-19 21:47:20 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-19 21:47:20 +0000 |
commit | 392940e7dd396c932dfba946642f0e567f656dc9 (patch) | |
tree | 7f8c63cbb5bf1e09e68f8f51a634aa8e1658271e | |
parent | 3de67205c3caa287d17b7a54c200f3930a33a94d (diff) | |
download | scummvm-rg350-392940e7dd396c932dfba946642f0e567f656dc9.tar.gz scummvm-rg350-392940e7dd396c932dfba946642f0e567f656dc9.tar.bz2 scummvm-rg350-392940e7dd396c932dfba946642f0e567f656dc9.zip |
re-use BobFrame
svn-id: r12526
-rw-r--r-- | queen/graphics.cpp | 18 | ||||
-rw-r--r-- | queen/graphics.h | 2 |
2 files changed, 9 insertions, 11 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp index 800f3d0bf5..b831e7c7c4 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -200,22 +200,21 @@ void Graphics::setupMouseCursor() { _vm->display()->setMouseCursor(bf->data, bf->width, bf->height); } -void Graphics::drawBob(const BobSlot *bs, int16 x, int16 y) { +void Graphics::drawBob(const BobSlot *bs, BobFrame *bf, int16 x, int16 y) { debug(9, "Graphics::drawBob(%d, %d, %d)", bs->frameNum, x, y); uint16 w, h; - BobFrame *pbf = _vm->bankMan()->fetchFrame(bs->frameNum); if (bs->scale < 100) { - shrinkFrame(pbf, bs->scale); - pbf = &_shrinkBuffer; + shrinkFrame(bf, bs->scale); + bf = &_shrinkBuffer; } - w = pbf->width; - h = pbf->height; + w = bf->width; + h = bf->height; const Box *box = &bs->box; if(w != 0 && h != 0 && box->intersects(x, y, w, h)) { - uint8 *src = pbf->data; + uint8 *src = bf->data; uint16 x_skip = 0; uint16 y_skip = 0; uint16 w_new = w; @@ -274,8 +273,7 @@ void Graphics::shrinkFrame(const BobFrame *bf, uint16 percentage) { // computing new size, rounding to upper value uint16 new_w = (bf->width * percentage + 50) / 100; uint16 new_h = (bf->height * percentage + 50) / 100; - - debug(9, "Graphics::shrinkFrame() - scale = %d, bufsize = %d", percentage, new_w * new_h); + assert(new_w * new_h < BOB_SHRINK_BUF_SIZE); if (new_w != 0 && new_h != 0) { @@ -389,7 +387,7 @@ void Graphics::drawBobs() { x = pbs->x - xh - _vm->display()->horizontalScroll(); y = pbs->y - yh; - drawBob(pbs, x, y); + drawBob(pbs, pbf, x, y); } } } diff --git a/queen/graphics.h b/queen/graphics.h index 28afbb62ae..88fc2a65c0 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -95,7 +95,7 @@ public: void unpackControlBank(); void setupMouseCursor(); - void drawBob(const BobSlot *bs, int16 x, int16 y); + void drawBob(const BobSlot *bs, BobFrame *bf, int16 x, int16 y); void drawInventoryItem(uint32 frameNum, uint16 x, uint16 y); void pasteBob(uint16 objNum, uint16 image); void shrinkFrame(const BobFrame *bf, uint16 percentage); |