[Scummvm-git-logs] scummvm branch-2-1 -> cbb7928587efa0d338984663992db1697b995b46
sluicebox
22204938+sluicebox at users.noreply.github.com
Sun Sep 29 02:57:05 CEST 2019
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:
cbb7928587 SCI32: Sync HOYLE5 Bridge volume control
Commit: cbb7928587efa0d338984663992db1697b995b46
https://github.com/scummvm/scummvm/commit/cbb7928587efa0d338984663992db1697b995b46
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-09-28T17:56:43-07:00
Commit Message:
SCI32: Sync HOYLE5 Bridge volume control
Changed paths:
engines/sci/engine/guest_additions.cpp
diff --git a/engines/sci/engine/guest_additions.cpp b/engines/sci/engine/guest_additions.cpp
index 7f5a11c..581cbbf 100644
--- a/engines/sci/engine/guest_additions.cpp
+++ b/engines/sci/engine/guest_additions.cpp
@@ -114,6 +114,9 @@ bool GuestAdditions::shouldSyncAudioToScummVM() const {
return true;
} else if (gameId == GID_GK2 && objName == "soundSlider") {
return true;
+ } else if (gameId == GID_HOYLE5 && objName == "volumeSliderF") {
+ // Hoyle5 has a second control panel with a different slider name
+ return true;
} else if (gameId == GID_KQ7 && (objName == "volumeUp" ||
objName == "volumeDown")) {
return true;
@@ -1406,17 +1409,22 @@ void GuestAdditions::syncGK2UI() const {
}
void GuestAdditions::syncHoyle5UI(const int16 musicVolume) const {
- const reg_t sliderId = _segMan->findObjectByName("volumeSlider");
- if (!sliderId.isNull()) {
- const int16 yPosition = 167 - musicVolume * 145 / 10;
- writeSelectorValue(_segMan, sliderId, SELECTOR(y), yPosition);
-
- // There does not seem to be any good way to learn whether the
- // volume slider is visible (and thus eligible for
- // kUpdateScreenItem)
- const reg_t planeId = readSelector(_segMan, sliderId, SELECTOR(plane));
- if (g_sci->_gfxFrameout->getPlanes().findByObject(planeId) != nullptr) {
- g_sci->_gfxFrameout->kernelUpdateScreenItem(sliderId);
+ // Hoyle5 has two control panels with different slider names
+ const reg_t sliders[] = { _segMan->findObjectByName("volumeSlider"),
+ _segMan->findObjectByName("volumeSliderF") };
+ for (int i = 0; i < ARRAYSIZE(sliders); ++i) {
+ const reg_t sliderId = sliders[i];
+ if (!sliderId.isNull()) {
+ const int16 yPosition = 167 - musicVolume * 145 / 10;
+ writeSelectorValue(_segMan, sliderId, SELECTOR(y), yPosition);
+
+ // There does not seem to be any good way to learn whether the
+ // volume slider is visible (and thus eligible for
+ // kUpdateScreenItem)
+ const reg_t planeId = readSelector(_segMan, sliderId, SELECTOR(plane));
+ if (g_sci->_gfxFrameout->getPlanes().findByObject(planeId) != nullptr) {
+ g_sci->_gfxFrameout->kernelUpdateScreenItem(sliderId);
+ }
}
}
}
More information about the Scummvm-git-logs
mailing list