From 4b2fca203e19b831b76a7d0ec0ee3c5235ed89ee Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 22 Jul 2010 23:16:33 +0000 Subject: KYRA: Implement missing dialog code. This finally enables animations for all of Darm's talk sequences. svn-id: r51179 --- engines/kyra/kyra_lok.cpp | 1 + engines/kyra/kyra_lok.h | 2 ++ engines/kyra/text_lok.cpp | 22 ++++++++++++++++++---- 3 files changed, 21 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/kyra/kyra_lok.cpp b/engines/kyra/kyra_lok.cpp index cf61b58326..159230e928 100644 --- a/engines/kyra/kyra_lok.cpp +++ b/engines/kyra/kyra_lok.cpp @@ -234,6 +234,7 @@ Common::Error KyraEngine_LoK::init() { _talkingCharNum = -1; _charSayUnk3 = -1; + _disabledTalkAnimObject = _enabledTalkAnimObject = 0; memset(_currSentenceColor, 0, 3); _startSentencePalIndex = -1; _fadeText = false; diff --git a/engines/kyra/kyra_lok.h b/engines/kyra/kyra_lok.h index 239ca26a11..9f1eb282f5 100644 --- a/engines/kyra/kyra_lok.h +++ b/engines/kyra/kyra_lok.h @@ -473,6 +473,8 @@ protected: int8 _charSayUnk2; int8 _charSayUnk3; int8 _currHeadShape; + int8 _disabledTalkAnimObject; + int8 _enabledTalkAnimObject; uint8 _currSentenceColor[3]; int8 _startSentencePalIndex; bool _fadeText; diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp index 3e45c0f286..79b16bc1be 100644 --- a/engines/kyra/text_lok.cpp +++ b/engines/kyra/text_lok.cpp @@ -137,8 +137,11 @@ void KyraEngine_LoK::endCharacterChat(int8 charNum, int16 convoInitialized) { _charSayUnk3 = -1; if (charNum > 4 && charNum < 11) { - //TODO: weird _game_inventory stuff here - //warning("STUB: endCharacterChat() for high charnums"); + _animator->sprites()[_disabledTalkAnimObject].active = 1; + _sprites->_anims[_disabledTalkAnimObject].play = true; + + _animator->sprites()[_enabledTalkAnimObject].active = 0; + _sprites->_anims[_enabledTalkAnimObject].play = false; } if (convoInitialized != 0) { @@ -225,8 +228,19 @@ int KyraEngine_LoK::initCharacterChat(int8 charNum) { _animator->restoreAllObjectBackgrounds(); if (charNum > 4 && charNum < 11) { - // TODO: Fill in weird _game_inventory stuff here - //warning("STUB: initCharacterChat() for high charnums"); + const uint8 animDisableTable[] = { 3, 1, 1, 5, 0, 6 }; + const uint8 animEnableTable[] = { 4, 2, 5, 6, 1, 7 }; + + _disabledTalkAnimObject = animDisableTable[charNum - 5]; + _enabledTalkAnimObject = animEnableTable[charNum - 5]; + + _animator->sprites()[_disabledTalkAnimObject].active = 0; + _sprites->_anims[_disabledTalkAnimObject].play = false; + + _animator->sprites()[_enabledTalkAnimObject].active = 1; + _sprites->_anims[_enabledTalkAnimObject].play = true; + + _charSayUnk2 = _enabledTalkAnimObject; } _animator->flagAllObjectsForRefresh(); -- cgit v1.2.3