[Scummvm-git-logs] scummvm master -> faf42d0f842100b92c64207d86f3276ffb83fe24
bluegr
noreply at scummvm.org
Sun Jun 12 18:13:05 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
faf42d0f84 CHEWY: Play audio commentary in inventory - bug #13522
Commit: faf42d0f842100b92c64207d86f3276ffb83fe24
https://github.com/scummvm/scummvm/commit/faf42d0f842100b92c64207d86f3276ffb83fe24
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2022-06-12T21:12:48+03:00
Commit Message:
CHEWY: Play audio commentary in inventory - bug #13522
Changed paths:
engines/chewy/atds.h
engines/chewy/dialogs/inventory.cpp
diff --git a/engines/chewy/atds.h b/engines/chewy/atds.h
index 89fdba35c60..0a260215ea0 100644
--- a/engines/chewy/atds.h
+++ b/engines/chewy/atds.h
@@ -25,6 +25,7 @@
#include "common/str.h"
#include "common/str-array.h"
#include "chewy/resource.h"
+#include "chewy/text.h"
namespace Chewy {
@@ -274,6 +275,7 @@ public:
Common::StringArray getTextArray(uint dialogNum, uint entryNum, int type, int subEntry = -1);
Common::String getTextEntry(uint dialogNum, uint entryNum, int type, int subEntry = -1);
+ int16 getLastSpeechId() { return _text->getLastSpeechId(); }
private:
void init();
diff --git a/engines/chewy/dialogs/inventory.cpp b/engines/chewy/dialogs/inventory.cpp
index 51b26b88d26..86360c210da 100644
--- a/engines/chewy/dialogs/inventory.cpp
+++ b/engines/chewy/dialogs/inventory.cpp
@@ -28,6 +28,7 @@
#include "chewy/main.h"
#include "chewy/menus.h"
#include "chewy/mouse.h"
+#include "chewy/sound.h"
namespace Chewy {
namespace Dialogs {
@@ -383,6 +384,7 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
bool endLoop = false;
int16 startLine = 0;
bool mouseFl = true;
+ bool firstTime = true;
if (mode == INV_ATS_MODE) {
itemName = _G(atds)->getTextEntry(invent_nr, TXT_MARK_NAME, INV_ATS_DATA);
@@ -409,6 +411,8 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
endLoop = true;
}
+ const int16 speechId = _G(atds)->getLastSpeechId();
+
while (!endLoop) {
int16 rect = _G(in)->findHotspot(_G(inventoryHotspots));
@@ -518,6 +522,11 @@ int16 Inventory::look(int16 invent_nr, int16 mode, int16 ats_nr) {
_G(scr_width), itemDesc[i].c_str());
++k;
}
+
+ if (g_engine->_sound->speechEnabled() && speechId >= 0 && firstTime) {
+ g_engine->_sound->playSpeech(speechId, false);
+ firstTime = false;
+ }
}
_G(cur)->plot_cur();
More information about the Scummvm-git-logs
mailing list