aboutsummaryrefslogtreecommitdiff
path: root/engines/agi/sprite.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:32:25 +0000
committerEugene Sandulenko2010-06-15 10:32:25 +0000
commit88421532aa2fc34fda1a940a4ba994f96e324574 (patch)
tree5dba6a6a16f879f27ccdeafb7f110e157df2ec23 /engines/agi/sprite.cpp
parent462d1afed8ffbc9a018d07d0c0b280af448e7b52 (diff)
downloadscummvm-rg350-88421532aa2fc34fda1a940a4ba994f96e324574.tar.gz
scummvm-rg350-88421532aa2fc34fda1a940a4ba994f96e324574.tar.bz2
scummvm-rg350-88421532aa2fc34fda1a940a4ba994f96e324574.zip
AGI: Implemented immediate update for most of gfx to match original.
This fixes many subtle effects as in many cases there were no special pausing and engine relied only on the slowliness of the machine. svn-id: r49745
Diffstat (limited to 'engines/agi/sprite.cpp')
-rw-r--r--engines/agi/sprite.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/agi/sprite.cpp b/engines/agi/sprite.cpp
index 611dd16478..d3bd1a6212 100644
--- a/engines/agi/sprite.cpp
+++ b/engines/agi/sprite.cpp
@@ -391,7 +391,7 @@ void SpritesMgr::freeList(SpriteList &l) {
* Copy sprites from the pic buffer to the screen buffer, and check if
* sprites of the given list have moved.
*/
-void SpritesMgr::commitSprites(SpriteList &l) {
+void SpritesMgr::commitSprites(SpriteList &l, bool immediate) {
SpriteList::iterator iter;
for (iter = l.begin(); iter != l.end(); ++iter) {
Sprite *s = *iter;
@@ -404,7 +404,7 @@ void SpritesMgr::commitSprites(SpriteList &l) {
s->v->celData2 = s->v->celData;
- commitBlock(x1, y1, x2, y2);
+ commitBlock(x1, y1, x2, y2, immediate);
if (s->v->stepTimeCount != s->v->stepTime)
continue;
@@ -458,11 +458,11 @@ void SpritesMgr::blitSprites(SpriteList& l) {
*/
void SpritesMgr::commitUpdSprites() {
- commitSprites(_sprUpd);
+ commitSprites(_sprUpd, true);
}
void SpritesMgr::commitNonupdSprites() {
- commitSprites(_sprNonupd);
+ commitSprites(_sprNonupd, true);
}
// check moves in both lists
@@ -651,7 +651,7 @@ void SpritesMgr::addToPic(int view, int loop, int cel, int x, int y, int pri, in
blitBoth();
- commitBlock(x1, y1, x2, y2);
+ commitBlock(x1, y1, x2, y2, true);
}
/**
@@ -682,15 +682,15 @@ void SpritesMgr::showObj(int n) {
objsSaveArea(&s);
blitCel(x1, y1, 15, c, _vm->_game.views[n].agi256_2);
- commitBlock(x1, y1, x2, y2);
+ commitBlock(x1, y1, x2, y2, true);
_vm->messageBox(_vm->_game.views[n].descr);
objsRestoreArea(&s);
- commitBlock(x1, y1, x2, y2);
+ commitBlock(x1, y1, x2, y2, true);
free(s.buffer);
}
-void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2) {
+void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2, bool immediate) {
int i, w, offset;
uint8 *q;
@@ -714,6 +714,9 @@ void SpritesMgr::commitBlock(int x1, int y1, int x2, int y2) {
}
_gfx->flushBlockA(x1, y1 + offset, x2, y2 + offset);
+
+ if (immediate)
+ _gfx->doUpdate();
}
SpritesMgr::SpritesMgr(AgiEngine *agi, GfxMgr *gfx) {