aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorFilippos Karapetis2014-12-29 12:34:55 +0200
committerFilippos Karapetis2014-12-29 12:34:55 +0200
commitf4d5b150f1e4b786f2f6f79a1acd3315da9a8699 (patch)
treee1cadcc9561ed34e7462239bc5a2c82fd342cb89 /engines/zvision
parent83dd389d255ae63affc3600742d564a8d2cb914c (diff)
downloadscummvm-rg350-f4d5b150f1e4b786f2f6f79a1acd3315da9a8699.tar.gz
scummvm-rg350-f4d5b150f1e4b786f2f6f79a1acd3315da9a8699.tar.bz2
scummvm-rg350-f4d5b150f1e4b786f2f6f79a1acd3315da9a8699.zip
ZVISION: Show system messages when subtitles are disabled
Thanks to Marisa-Chan for spotting this
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/graphics/render_manager.cpp2
-rw-r--r--engines/zvision/scripting/sidefx/music_node.cpp2
-rw-r--r--engines/zvision/scripting/sidefx/syncsound_node.cpp2
-rw-r--r--engines/zvision/video/video.cpp4
4 files changed, 6 insertions, 4 deletions
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index 033d099042..1b80b379bf 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -741,7 +741,7 @@ void RenderManager::processSubs(uint16 deltatime) {
}
}
- if (redraw && _engine->getScriptManager()->getStateValue(StateKey_Subtitles) == 1) {
+ if (redraw) {
_subtitleSurface.fillRect(Common::Rect(_subtitleSurface.w, _subtitleSurface.h), 0);
for (SubtitleMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) {
diff --git a/engines/zvision/scripting/sidefx/music_node.cpp b/engines/zvision/scripting/sidefx/music_node.cpp
index 6be08b46dc..0cada6d748 100644
--- a/engines/zvision/scripting/sidefx/music_node.cpp
+++ b/engines/zvision/scripting/sidefx/music_node.cpp
@@ -137,7 +137,7 @@ bool MusicNode::process(uint32 deltaTimeInMillis) {
if (_pantrack || _volume != _newvol)
setVolume(_newvol);
- if (_sub)
+ if (_sub && _engine->getScriptManager()->getStateValue(StateKey_Subtitles) == 1)
_sub->process(_engine->_mixer->getSoundElapsedTime(_handle) / 100);
}
return false;
diff --git a/engines/zvision/scripting/sidefx/syncsound_node.cpp b/engines/zvision/scripting/sidefx/syncsound_node.cpp
index c1f139694b..eec320bf2e 100644
--- a/engines/zvision/scripting/sidefx/syncsound_node.cpp
+++ b/engines/zvision/scripting/sidefx/syncsound_node.cpp
@@ -76,7 +76,7 @@ bool SyncSoundNode::process(uint32 deltaTimeInMillis) {
if (_engine->getScriptManager()->getSideFX(_syncto) == NULL)
return stop();
- if (_sub)
+ if (_sub && _engine->getScriptManager()->getStateValue(StateKey_Subtitles) == 1)
_sub->process(_engine->_mixer->getSoundElapsedTime(_handle) / 100);
}
return false;
diff --git a/engines/zvision/video/video.cpp b/engines/zvision/video/video.cpp
index e67e6570c5..0913b28818 100644
--- a/engines/zvision/video/video.cpp
+++ b/engines/zvision/video/video.cpp
@@ -29,6 +29,7 @@
#include "zvision/zvision.h"
#include "zvision/core/clock.h"
#include "zvision/graphics/render_manager.h"
+#include "zvision/scripting//script_manager.h"
#include "zvision/text/subtitles.h"
#include "zvision/video/rlf_decoder.h"
#include "zvision/video/zork_avi_decoder.h"
@@ -75,6 +76,7 @@ void ZVision::playVideo(Video::VideoDecoder &vid, const Common::Rect &destRect,
uint16 y = _workingWindow.top + dst.top;
uint16 finalWidth = dst.width() < _workingWindow.width() ? dst.width() : _workingWindow.width();
uint16 finalHeight = dst.height() < _workingWindow.height() ? dst.height() : _workingWindow.height();
+ bool showSubs = (_scriptManager->getStateValue(StateKey_Subtitles) == 1);
_clock.stop();
vid.start();
@@ -106,7 +108,7 @@ void ZVision::playVideo(Video::VideoDecoder &vid, const Common::Rect &destRect,
if (vid.needsUpdate()) {
const Graphics::Surface *frame = vid.decodeNextFrame();
- if (sub)
+ if (sub && showSubs)
sub->process(vid.getCurFrame());
if (frame) {