mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 00:12:59 +00:00
PETKA: implemented handling dialog opcode 0x2 when engine needs speech info
This commit is contained in:
parent
a366e65aad
commit
464718e896
@ -100,14 +100,39 @@ void BigDialogue::loadSpeechesInfo() {
|
||||
delete[] str;
|
||||
}
|
||||
|
||||
const SpeechInfo *BigDialogue::getSpeechInfo() {
|
||||
const SpeechInfo *BigDialogue::getSpeechInfo(int unk) {
|
||||
if (!_ip)
|
||||
return nullptr;
|
||||
int *oldIp = _ip;
|
||||
int op = *_ip;
|
||||
byte opcode = (byte)(*_ip >> 24);
|
||||
switch (opcode) {
|
||||
case 2:
|
||||
// not implemented
|
||||
break;
|
||||
case 2: {
|
||||
int unk1 = 1;
|
||||
byte arg = (byte)*_ip;
|
||||
if (arg <= unk || unk >= 0) {
|
||||
break;
|
||||
}
|
||||
while (true) {
|
||||
_ip += 1;
|
||||
if (unk == 0 && (unk1 & ((op >> 8) & 0xFFFF)))
|
||||
break;
|
||||
if ((*_ip >> 24) == 0x1) {
|
||||
if (unk1 & ((op >> 8) & 0xFFFF))
|
||||
unk--;
|
||||
unk1 *= 2;
|
||||
}
|
||||
}
|
||||
if ((*_ip >> 24) != 0x7)
|
||||
sub40B670(-1);
|
||||
if ((*_ip >> 24) != 0x7) {
|
||||
_ip = oldIp;
|
||||
break;
|
||||
}
|
||||
uint index = (uint16)*_ip;
|
||||
_ip = oldIp;
|
||||
return &_speeches[index];
|
||||
}
|
||||
case 8:
|
||||
_ip += 1;
|
||||
for (uint i = 0; i < ((*_ip >> 16) & 0xFF); ++i) {
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
const Dialog *findDialog(uint objId, uint opcode, bool *res) const;
|
||||
void setDialog(uint objId, uint opcode, int index);
|
||||
|
||||
const SpeechInfo *getSpeechInfo();
|
||||
const SpeechInfo *getSpeechInfo(int unk);
|
||||
|
||||
private:
|
||||
void loadSpeechesInfo();
|
||||
|
@ -81,7 +81,7 @@ void DialogInterface::sub_4155D0(int a) {
|
||||
return;
|
||||
int talkerId = -1;
|
||||
if (a == -1 && !_field8) {
|
||||
talkerId = g_vm->getBigDialogue()->getSpeechInfo()->speakerId;
|
||||
talkerId = g_vm->getBigDialogue()->getSpeechInfo(-1)->speakerId;
|
||||
}
|
||||
_field8 = _field4;
|
||||
g_vm->getQSystem()->_cursor.get()->_isShown = 0;
|
||||
@ -93,7 +93,7 @@ void DialogInterface::sub_4155D0(int a) {
|
||||
g_vm->getBigDialogue()->sub40B670(a);
|
||||
switch (g_vm->getBigDialogue()->opcode()) {
|
||||
case 1: {
|
||||
const SpeechInfo *info = g_vm->getBigDialogue()->getSpeechInfo();
|
||||
const SpeechInfo *info = g_vm->getBigDialogue()->getSpeechInfo(-1);
|
||||
g_vm->soundMgr()->removeSound(_soundName);
|
||||
if (talkerId != info->speakerId) {
|
||||
sendMsg(kSaid);
|
||||
|
Loading…
x
Reference in New Issue
Block a user