KYRA: Implement missing dialog code.

This finally enables animations for all of Darm's talk sequences.

svn-id: r51179
This commit is contained in:
Johannes Schickel 2010-07-22 23:16:33 +00:00
parent 1f60595cdc
commit 4b2fca203e
3 changed files with 21 additions and 4 deletions

View File

@ -234,6 +234,7 @@ Common::Error KyraEngine_LoK::init() {
_talkingCharNum = -1;
_charSayUnk3 = -1;
_disabledTalkAnimObject = _enabledTalkAnimObject = 0;
memset(_currSentenceColor, 0, 3);
_startSentencePalIndex = -1;
_fadeText = false;

View File

@ -473,6 +473,8 @@ protected:
int8 _charSayUnk2;
int8 _charSayUnk3;
int8 _currHeadShape;
int8 _disabledTalkAnimObject;
int8 _enabledTalkAnimObject;
uint8 _currSentenceColor[3];
int8 _startSentencePalIndex;
bool _fadeText;

View File

@ -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();