aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2006-02-11 00:17:20 +0000
committerJohannes Schickel2006-02-11 00:17:20 +0000
commit590289d937be8104f03a22727f0796c22106ffda (patch)
treee64b21d7d98be13c921f313411972ddb0c43ad39
parent651faae2a4797627a50e99a9f182478bf1f27c1a (diff)
downloadscummvm-rg350-590289d937be8104f03a22727f0796c22106ffda.tar.gz
scummvm-rg350-590289d937be8104f03a22727f0796c22106ffda.tar.bz2
scummvm-rg350-590289d937be8104f03a22727f0796c22106ffda.zip
Fixes the bug when displaying the falling leafe scene in room 12 and text bugs which overwride the interface. (also in the scene with the ruby tree)
svn-id: r20483
-rw-r--r--kyra/animator.cpp10
-rw-r--r--kyra/animator.h2
-rw-r--r--kyra/kyra.cpp2
-rw-r--r--kyra/scene.cpp7
-rw-r--r--kyra/screen.cpp2
-rw-r--r--kyra/script_v1.cpp4
-rw-r--r--kyra/sprites.cpp2
-rw-r--r--kyra/sprites.h1
-rw-r--r--kyra/text.cpp6
9 files changed, 21 insertions, 15 deletions
diff --git a/kyra/animator.cpp b/kyra/animator.cpp
index e6d5d09862..bc82a28aeb 100644
--- a/kyra/animator.cpp
+++ b/kyra/animator.cpp
@@ -115,7 +115,7 @@ void ScreenAnimator::preserveAllBackgrounds() {
AnimObject *curObject = _objectQueue;
while (curObject) {
- if (curObject->active && !curObject->unk1) {
+ if (curObject->active && !curObject->disable) {
preserveOrRestoreBackground(curObject, false);
curObject->bkgdChangeFlag = 0;
}
@@ -148,7 +148,7 @@ void ScreenAnimator::restoreAllObjectBackgrounds() {
_screen->_curPage = 2;
while (curObject) {
- if (curObject->active && !curObject->unk1) {
+ if (curObject->active && !curObject->disable) {
preserveOrRestoreBackground(curObject, true);
curObject->x2 = curObject->x1;
curObject->y2 = curObject->y1;
@@ -165,7 +165,7 @@ void ScreenAnimator::preserveAnyChangedBackgrounds() {
_screen->_curPage = 2;
while (curObject) {
- if (curObject->active && !curObject->unk1 && curObject->bkgdChangeFlag) {
+ if (curObject->active && !curObject->disable && curObject->bkgdChangeFlag) {
preserveOrRestoreBackground(curObject, false);
curObject->bkgdChangeFlag = 0;
}
@@ -202,7 +202,7 @@ void ScreenAnimator::preserveOrRestoreBackground(AnimObject *obj, bool restore)
if (temp >= 136) {
y = 136 - height;
}
-
+
if (restore) {
_screen->copyBlockToPage(_screen->_curPage, x, y, width, height, obj->background);
} else {
@@ -230,7 +230,7 @@ void ScreenAnimator::prepDrawAllObjects() {
int drawLayer = 0;
if (!(curObject->flags & 0x800)) {
drawLayer = 7;
- } else if (curObject->unk1) {
+ } else if (curObject->disable) {
drawLayer = 0;
} else {
drawLayer = _vm->_sprites->getDrawLayer(curObject->drawY);
diff --git a/kyra/animator.h b/kyra/animator.h
index 5a08c5f467..6197898a3d 100644
--- a/kyra/animator.h
+++ b/kyra/animator.h
@@ -32,7 +32,7 @@ struct AnimObject {
uint32 active;
uint32 refreshFlag;
uint32 bkgdChangeFlag;
- uint32 unk1;
+ bool disable;
uint32 flags;
int16 drawY;
uint8 *sceneAnimPtr;
diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp
index bd1cdaf2a9..dcdd281d92 100644
--- a/kyra/kyra.cpp
+++ b/kyra/kyra.cpp
@@ -311,6 +311,8 @@ KyraEngine::KyraEngine(GameDetector *detector, OSystem *system)
int KyraEngine::init(GameDetector &detector) {
_system->beginGFXTransaction();
initCommonGFX(detector);
+ //for debug reasons (see Screen::updateScreen)
+ //_system->initSize(640, 200);
_system->initSize(320, 200);
_system->endGFXTransaction();
diff --git a/kyra/scene.cpp b/kyra/scene.cpp
index e99812b439..4e126b4fac 100644
--- a/kyra/scene.cpp
+++ b/kyra/scene.cpp
@@ -770,8 +770,7 @@ void KyraEngine::initSceneObjectList(int brandonAlive) {
curAnimState->active = 1;
curAnimState->refreshFlag = 1;
curAnimState->bkgdChangeFlag = 1;
- }
- else {
+ } else {
curAnimState->active = 0;
curAnimState->refreshFlag = 0;
curAnimState->bkgdChangeFlag = 0;
@@ -786,7 +785,9 @@ void KyraEngine::initSceneObjectList(int brandonAlive) {
curAnimState->background = _sprites->_anims[i].background;
curAnimState->sceneAnimPtr = _sprites->_sceneShapes[_sprites->_anims[i].sprite];
- if(_sprites->_anims[i].unk2)
+ curAnimState->disable = _sprites->_anims[i].disable;
+
+ if (_sprites->_anims[i].unk2)
curAnimState->flags = 0x800;
else
curAnimState->flags = 0;
diff --git a/kyra/screen.cpp b/kyra/screen.cpp
index 8e28023be6..4bf2d8da75 100644
--- a/kyra/screen.cpp
+++ b/kyra/screen.cpp
@@ -108,6 +108,8 @@ Screen::~Screen() {
void Screen::updateScreen() {
debug(9, "Screen::updateScreen()");
_system->copyRectToScreen(getPagePtr(0), SCREEN_W, 0, 0, SCREEN_W, SCREEN_H);
+ //for debug reasons (needs 640x200 screen)
+ //_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
_system->updateScreen();
}
diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp
index 209e894023..a2ccd2adb8 100644
--- a/kyra/script_v1.cpp
+++ b/kyra/script_v1.cpp
@@ -234,10 +234,10 @@ int KyraEngine::cmd_destroyMouseItem(ScriptState *script) {
int KyraEngine::cmd_runSceneAnimUntilDone(ScriptState *script) {
debug(3, "cmd_runSceneAnimUntilDone(0x%X) (%d)", script, stackPos(0));
- _sprites->_anims[stackPos(0)].play = true;
- _animator->sprites()[stackPos(0)].active = 1;
_screen->hideMouse();
_animator->restoreAllObjectBackgrounds();
+ _sprites->_anims[stackPos(0)].play = true;
+ _animator->sprites()[stackPos(0)].active = 1;
_animator->flagAllObjectsForBkgdChange();
_animator->preserveAnyChangedBackgrounds();
while (_sprites->_anims[stackPos(0)].play) {
diff --git a/kyra/sprites.cpp b/kyra/sprites.cpp
index 91d6eedb45..200182c0c8 100644
--- a/kyra/sprites.cpp
+++ b/kyra/sprites.cpp
@@ -71,7 +71,7 @@ void Sprites::setupSceneAnims() {
assert( READ_LE_UINT16(data) == 0xFF86 );
data += 4;
- //sceneUnk16[i] = READ_LE_UINT16(data);
+ _anims[i].disable = READ_LE_UINT16(data) != 0;
data += 4;
_anims[i].unk2 = READ_LE_UINT16(data);
data += 4;
diff --git a/kyra/sprites.h b/kyra/sprites.h
index b37f0990cd..b1ce9ae8e7 100644
--- a/kyra/sprites.h
+++ b/kyra/sprites.h
@@ -54,6 +54,7 @@ struct Anim {
uint16 drawY;
uint16 unk2;
uint8 *background;
+ bool disable;
};
class Sprites {
diff --git a/kyra/text.cpp b/kyra/text.cpp
index 540044dcd9..8b1d62f20d 100644
--- a/kyra/text.cpp
+++ b/kyra/text.cpp
@@ -271,7 +271,7 @@ void KyraEngine::characterSays(char *chatStr, int8 charNum, int8 chatDuration) {
_text->_talkMessageH = lineNum * 10;
_animator->restoreAllObjectBackgrounds();
- _screen->copyRegion(12, _text->_talkMessageY, 12, 136, 308, _text->_talkMessageH, 2, 2);
+ _screen->copyRegion(12, _text->_talkMessageY, 12, 136, 296, _text->_talkMessageH, 2, 2);
_screen->hideMouse();
_text->printCharacterText(processedString, charNum, _characterList[charNum].x1);
@@ -286,12 +286,12 @@ void KyraEngine::characterSays(char *chatStr, int8 charNum, int8 chatDuration) {
_animator->restoreAllObjectBackgrounds();
- _screen->copyRegion(12, 136, 12, _text->_talkMessageY, 308, _text->_talkMessageH, 2, 2);
+ _screen->copyRegion(12, 136, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 2);
_animator->preserveAllBackgrounds();
_animator->prepDrawAllObjects();
_screen->hideMouse();
- _screen->copyRegion(12, _text->_talkMessageY, 12, _text->_talkMessageY, 308, _text->_talkMessageH, 2, 0);
+ _screen->copyRegion(12, _text->_talkMessageY, 12, _text->_talkMessageY, 296, _text->_talkMessageH, 2, 0);
_screen->showMouse();
_animator->flagAllObjectsForRefresh();
_animator->copyChangedObjectsForward(0);