aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOystein Eftevaag2006-03-18 04:41:34 +0000
committerOystein Eftevaag2006-03-18 04:41:34 +0000
commit05ee5cf2bdca6b97b6cd7ce93bfbe80cfc9a61fe (patch)
tree5b89b610c0bcdd7be80485de3c5998a239e6047f
parentdcf029e947fc8cfafe06c86957222040a08df321 (diff)
downloadscummvm-rg350-05ee5cf2bdca6b97b6cd7ce93bfbe80cfc9a61fe.tar.gz
scummvm-rg350-05ee5cf2bdca6b97b6cd7ce93bfbe80cfc9a61fe.tar.bz2
scummvm-rg350-05ee5cf2bdca6b97b6cd7ce93bfbe80cfc9a61fe.zip
Extends seq_drinkPotionAnim() so that the color of the flask Brandon
drinks will be correct. Also fixes a bug where an animation (Brandon ringing the bells) would play too quickly. svn-id: r21354
-rw-r--r--engines/kyra/kyra.h2
-rw-r--r--engines/kyra/screen.cpp8
-rw-r--r--engines/kyra/screen.h1
-rw-r--r--engines/kyra/script_v1.cpp3
-rw-r--r--engines/kyra/sequences_v1.cpp54
5 files changed, 63 insertions, 5 deletions
diff --git a/engines/kyra/kyra.h b/engines/kyra/kyra.h
index ab72ea3bcd..a308c56ae9 100644
--- a/engines/kyra/kyra.h
+++ b/engines/kyra/kyra.h
@@ -581,7 +581,7 @@ protected:
void seq_makeBrandonWisp();
void seq_dispelMagicAnimation();
void seq_fillFlaskWithWater(int item, int type);
- void seq_playDrinkPotionAnim(int unk1, int unk2, int flags);
+ void seq_playDrinkPotionAnim(int item, int unk2, int flags);
int seq_playEnd();
void seq_brandonToStone();
void seq_playEnding();
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index f3fec455cc..af55d6f300 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -234,6 +234,14 @@ void Screen::fadePalette(const uint8 *palData, int delay) {
}
}
+void Screen::setPaletteIndex(uint8 index, uint8 red, uint8 green, uint8 blue) {
+ debugC(9, kDebugLevelScreen, "Screen::setPaletteIndex(%u, %u, %u, %u)", index, red, green, blue);
+ _currentPalette[index * 3 + 0] = red;
+ _currentPalette[index * 3 + 1] = green;
+ _currentPalette[index * 3 + 2] = blue;
+ setScreenPalette(_currentPalette);
+}
+
void Screen::setScreenPalette(const uint8 *palData) {
debugC(9, kDebugLevelScreen, "Screen::setScreenPalette(%p)", (const void *)palData);
memcpy(_screenPalette, palData, 768);
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 65e7804753..5b50e2e5b1 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -99,6 +99,7 @@ public:
void fadeToBlack();
void fadeSpecialPalette(int palIndex, int startIndex, int size, int fadeTime);
void fadePalette(const uint8 *palData, int delay);
+ void setPaletteIndex(uint8 index, uint8 red, uint8 green, uint8 blue);
void setScreenPalette(const uint8 *palData);
void copyToPage0(int y, int h, uint8 page, uint8 *seqBuf);
void copyRegion(int x1, int y1, int x2, int y2, int w, int h, int srcPage, int dstPage, int flags=0);
diff --git a/engines/kyra/script_v1.cpp b/engines/kyra/script_v1.cpp
index 313649c276..3f29038948 100644
--- a/engines/kyra/script_v1.cpp
+++ b/engines/kyra/script_v1.cpp
@@ -1331,7 +1331,8 @@ int KyraEngine::cmd_waitForConfirmationMouseClick(ScriptState *script) {
delay(10);
}
// }
- // XXX processButtonList calls
+ processButtonList(_buttonList);
+ _skipFlag = false;
script->variables[1] = _mouseX;
script->variables[2] = _mouseY;
return 0;
diff --git a/engines/kyra/sequences_v1.cpp b/engines/kyra/sequences_v1.cpp
index ac86e46e94..1077a4a62c 100644
--- a/engines/kyra/sequences_v1.cpp
+++ b/engines/kyra/sequences_v1.cpp
@@ -787,9 +787,56 @@ void KyraEngine::seq_fillFlaskWithWater(int item, int type) {
characterSays(_fullFlask[type], 0, -2);
}
-void KyraEngine::seq_playDrinkPotionAnim(int unk1, int unk2, int flags) {
- debugC(9, kDebugLevelMain, "KyraEngine::seq_playDrinkPotionAnim(%d, %d, %d)", unk1, unk2, flags);
- // XXX
+void KyraEngine::seq_playDrinkPotionAnim(int item, int unk2, int flags) {
+ debugC(9, kDebugLevelMain, "KyraEngine::seq_playDrinkPotionAnim(%d, %d, %d)", item, unk2, flags);
+ uint8 red, green, blue;
+
+ switch (item) {
+ case 60:
+ case 61:
+ red = 63;
+ green = blue = 6;
+ break;
+ case 62:
+ case 63:
+ red = green = 0;
+ blue = 67;
+ break;
+ case 64:
+ case 65:
+ red = 84;
+ green = 78;
+ blue = 14;
+ break;
+ case 66:
+ red = blue = 0;
+ green = 48;
+ break;
+ case 67:
+ red = 100;
+ green = 48;
+ blue = 23;
+ break;
+ case 68:
+ red = 73;
+ green = 0;
+ blue = 89;
+ break;
+ case 69:
+ red = green = 73;
+ blue = 86;
+ break;
+ default:
+ red = 33;
+ green = 66;
+ blue = 100;
+ }
+ red = (uint8)((double)red * 0.63);
+ green = (uint8)((double)green * 0.63);
+ blue = (uint8)((double)blue * 0.63);
+
+ _screen->setPaletteIndex(0xFE, red, green, blue);
+
_screen->hideMouse();
checkAmuletAnimFlags();
_currentCharacter->facing = 5;
@@ -827,6 +874,7 @@ void KyraEngine::seq_playDrinkPotionAnim(int unk1, int unk2, int flags) {
_currentCharacter->currentAnimFrame = 7;
_animator->animRefreshNPC(0);
freeShapes123();
+ _screen->setPaletteIndex(0xFE, 30, 30, 30);
_screen->showMouse();
}