mirror of
https://github.com/libretro/scummvm.git
synced 2025-04-01 14:21:41 +00:00
Revert "TRECISION: Fix drawing of the first Smacker frame in some animations"
This reverts commit a33b9877c1573cbc636d4a7d23e731805ee34e02.
This commit is contained in:
parent
4e3c5e2530
commit
f25b899e1d
@ -121,6 +121,8 @@ AnimManager::AnimManager(TrecisionEngine *vm) : _vm(vm) {
|
||||
|
||||
_curCD = 1;
|
||||
swapCD(_curCD);
|
||||
|
||||
_bgAnimRestarted = false;
|
||||
}
|
||||
|
||||
AnimManager::~AnimManager() {
|
||||
@ -289,6 +291,8 @@ void AnimManager::startSmkAnim(uint16 animation) {
|
||||
// choose how to open
|
||||
if (slot == kSmackerBackground) {
|
||||
openSmkAnim(kSmackerBackground, _animTab[animation]._name);
|
||||
_bgAnimRestarted = false;
|
||||
|
||||
toggleMuteBgAnim(animation);
|
||||
} else if (slot == kSmackerIcon) {
|
||||
openSmkAnim(kSmackerIcon, _animTab[animation]._name);
|
||||
@ -434,6 +438,7 @@ void AnimManager::handleEndOfVideo(int animation, int slot) {
|
||||
} else {
|
||||
_smkAnims[slot]->rewind();
|
||||
_vm->_animTypeMgr->init(animation, 0);
|
||||
_bgAnimRestarted = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -446,23 +451,27 @@ void AnimManager::drawSmkBackgroundFrame(int animation) {
|
||||
const Common::Rect *lastRect = smkDecoder->getNextDirtyRect();
|
||||
const byte *palette = smkDecoder->getPalette();
|
||||
|
||||
while (lastRect) {
|
||||
bool intersects = false;
|
||||
for (int32 i = 0; i < MAXCHILD; i++) {
|
||||
if (_animTab[animation]._flag & (SMKANIM_OFF1 << i)) {
|
||||
if (_animTab[animation]._lim[i].intersects(*lastRect)) {
|
||||
intersects = true;
|
||||
break;
|
||||
if (smkDecoder->getCurFrame() == 0 && !_bgAnimRestarted) {
|
||||
_vm->_graphicsMgr->blitToScreenBuffer(frame, 0, TOP, palette, true);
|
||||
} else {
|
||||
while (lastRect) {
|
||||
bool intersects = false;
|
||||
for (int32 a = 0; a < MAXCHILD; a++) {
|
||||
if (_animTab[animation]._flag & (SMKANIM_OFF1 << a)) {
|
||||
if (_animTab[animation]._lim[a].intersects(*lastRect)) {
|
||||
intersects = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!intersects) {
|
||||
Graphics::Surface anim = frame->getSubArea(*lastRect);
|
||||
_vm->_graphicsMgr->blitToScreenBuffer(&anim, lastRect->left, lastRect->top + TOP, palette, true);
|
||||
}
|
||||
if (smkDecoder->getCurFrame() > 0 && !intersects) {
|
||||
Graphics::Surface anim = frame->getSubArea(*lastRect);
|
||||
_vm->_graphicsMgr->blitToScreenBuffer(&anim, lastRect->left, lastRect->top + TOP, palette, true);
|
||||
}
|
||||
|
||||
lastRect = smkDecoder->getNextDirtyRect();
|
||||
lastRect = smkDecoder->getNextDirtyRect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -74,6 +74,7 @@ private:
|
||||
|
||||
FastFile _animFile[MAXSMACK]; // nlanim.cd1 / nlanim.cd2 / nlanim.cd3
|
||||
int _curCD;
|
||||
bool _bgAnimRestarted;
|
||||
|
||||
void openSmk(int slot, Common::SeekableReadStream *stream);
|
||||
void openSmkAnim(int slot, const Common::String &name);
|
||||
|
Loading…
x
Reference in New Issue
Block a user