aboutsummaryrefslogtreecommitdiff
path: root/queen/graphics.cpp
diff options
context:
space:
mode:
authorGregory Montoir2004-01-04 20:25:21 +0000
committerGregory Montoir2004-01-04 20:25:21 +0000
commit143b5bea80762464b4d29040b101ec606703a73f (patch)
tree373bf839bcce32e0444c761c7bc3e4d24385aaff /queen/graphics.cpp
parent9d547b183bfd56d94ec0b644f3ae12b668fd864e (diff)
downloadscummvm-rg350-143b5bea80762464b4d29040b101ec606703a73f.tar.gz
scummvm-rg350-143b5bea80762464b4d29040b101ec606703a73f.tar.bz2
scummvm-rg350-143b5bea80762464b4d29040b101ec606703a73f.zip
- added code to only redraw changed blocks in order to avoid full screen refresh
- minor code cleanup in Graphics/Display svn-id: r12147
Diffstat (limited to 'queen/graphics.cpp')
-rw-r--r--queen/graphics.cpp27
1 files changed, 14 insertions, 13 deletions
diff --git a/queen/graphics.cpp b/queen/graphics.cpp
index 4205f21ba9..3e82ecf756 100644
--- a/queen/graphics.cpp
+++ b/queen/graphics.cpp
@@ -339,26 +339,27 @@ void Graphics::bobDraw(const BobSlot *bs, int16 x, int16 y) {
src += w - w_new - x_skip;
x += w_new - 1;
}
- _vm->display()->blit(RB_SCREEN, x, y, src, w_new, h_new, w, bs->xflip, true);
+ _vm->display()->drawBobSprite(src, x, y, w_new, h_new, w, bs->xflip);
}
}
-void Graphics::bobDrawInventoryItem(uint32 bobnum, uint16 x, uint16 y) {
- if (bobnum == 0) {
- // clear panel area
- _vm->display()->fill(RB_PANEL, x, y, 32, 32, INK_BG_PANEL);
+void Graphics::bobDrawInventoryItem(uint32 frameNum, uint16 x, uint16 y) {
+ if (frameNum != 0) {
+ BobFrame *bf = frame(frameNum);
+ _vm->display()->drawInventoryItem(bf->data, x, y, bf->width, bf->height);
} else {
- BobFrame *pbf = &_frames[bobnum];
- _vm->display()->blit(RB_PANEL, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, false);
+ _vm->display()->drawInventoryItem(NULL, x, y, 32, 32);
}
}
-void Graphics::bobPaste(uint32 frameNum, int16 x, int16 y) {
- BobFrame *pbf = &_frames[frameNum];
- _vm->display()->blit(RB_BACKDROP, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, true);
- frameErase(frameNum);
+void Graphics::bobPaste(uint16 objNum, uint16 image) {
+ GraphicData *pgd = _vm->logic()->graphicData(objNum);
+ _vm->graphics()->bankUnpack(pgd->firstFrame, image, 15);
+ BobFrame *bf = frame(image);
+ _vm->display()->drawBobPasteDown(bf->data, pgd->x, pgd->y, bf->width, bf->height);
+ frameErase(image);
}
@@ -407,8 +408,8 @@ void Graphics::bobShrink(const BobFrame *bf, uint16 percentage) {
}
-void Graphics::bobClear(uint32 bobnum) {
- BobSlot *pbs = &_bobs[bobnum];
+void Graphics::bobClear(uint32 bobNum) {
+ BobSlot *pbs = bob(bobNum);
pbs->clear();
if (_vm->display()->fullscreen()) {
pbs->box.y2 = GAME_SCREEN_HEIGHT - 1;