Ticket #8788: zanthiaTalk.patch
File zanthiaTalk.patch, 3.4 KB (added by , 17 years ago) |
---|
-
kyra_v2.cpp
1871 1871 Opcode(o2_dummy), 1872 1872 OpcodeUnImpl(), 1873 1873 // 0x80 1874 Opcode(o2_objectChat), 1874 1875 OpcodeUnImpl(), 1875 1876 OpcodeUnImpl(), 1876 1877 OpcodeUnImpl(), 1877 OpcodeUnImpl(),1878 1878 // 0x84 1879 1879 OpcodeUnImpl(), 1880 1880 OpcodeUnImpl(), -
kyra_v2.h
615 615 byte _messagePal[3]; 616 616 int _msgUnk1; 617 617 618 uint8 _configTextspeed; 619 618 620 // chat 619 621 int _vocHigh; 620 622 … … 630 632 int chatGetType(const char *text); 631 633 int chatCalcDuration(const char *text); 632 634 633 void objectChat(const char *text, int object, int vocHigh , int vocLow);634 void objectChatInit(const char *text, int object, int vocHigh , int vocLow);635 void objectChat(const char *text, int object, int vocHigh = -1, int vocLow = -1); 636 void objectChatInit(const char *text, int object, int vocHigh = -1, int vocLow = -1); 635 637 void objectChatPrintText(const char *text, int object); 636 638 void objectChatProcess(const char *script); 637 639 void objectChatWaitToFinish(); … … 792 794 int o2_defineSceneAnim(ScriptState *script); 793 795 int o2_updateSceneAnim(ScriptState *script); 794 796 int o2_defineRoom(ScriptState *script); 797 int o2_objectChat(ScriptState *script); 795 798 int o2_countItemInstances(ScriptState *script); 796 799 int o2_initObject(ScriptState *script); 797 800 int o2_deinitObject(ScriptState *script); -
script_v2.cpp
644 644 return 0; 645 645 } 646 646 647 int KyraEngine_v2::o2_objectChat(ScriptState *script) { 648 debugC(3, kDebugLevelScriptFuncs, "o2_objectChat(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1)); 649 objectChat(stackPosString(0), stackPos(1)); 650 return 0; 651 } 652 647 653 int KyraEngine_v2::o2_countItemInstances(ScriptState *script) { 648 654 debugC(3, kDebugLevelScriptFuncs, "o2_countItemInstances(%p) (%d)", (const void *)script, stackPos(0)); 649 655 uint16 item = stackPos(0); … … 823 829 824 830 int KyraEngine_v2::o2t_setShapeFlag(ScriptState *script) { 825 831 debugC(3, kDebugLevelScriptFuncs, "o2t_setShapeFlag(%p) (%d)", (const void *)script, stackPos(0)); 826 _newShapeFlag = stackPos(0); 832 if (_flags.isTalkie) 833 _newShapeFlag = stackPos(0); 827 834 return 0; 828 835 } 829 836 -
text_v2.cpp
126 126 } 127 127 128 128 int KyraEngine_v2::chatCalcDuration(const char *str) { 129 return MIN<int>(strlen(str) << 3, 120); 129 // TODO: text speed support 130 _configTextspeed = 50; 131 132 static const uint8 duration[] = { 16, 14, 12, 10, 8, 8, 7, 6, 5, 4 }; 133 return MAX<int>(strlen(str) * duration[(_configTextspeed / 10)], 120); 130 134 } 131 135 132 136 void KyraEngine_v2::objectChat(const char *str, int object, int vocHigh, int vocLow) { … … 318 322 } 319 323 320 324 const uint32 curTime = _system->getMillis(); 321 if ((1/*textEnabled()*/ && curTime > endTime) || ( 1/*voiceEnabled()*/ && !snd_voiceIsPlaying()) || _skipFlag) {325 if ((1/*textEnabled()*/ && curTime > endTime) || (_flags.isTalkie && 1/*voiceEnabled()*/ && !snd_voiceIsPlaying()) || _skipFlag) { 322 326 _skipFlag = false; 323 327 nextFrame = curTime; 324 328 running = false;