Skip to content

Commit

Permalink
ZVISION: Show system messages when subtitles are disabled
Browse files Browse the repository at this point in the history
Thanks to Marisa-Chan for spotting this
  • Loading branch information
bluegr committed Dec 29, 2014
1 parent 83dd389 commit f4d5b15
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engines/zvision/graphics/render_manager.cpp
Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/sidefx/music_node.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion engines/zvision/scripting/sidefx/syncsound_node.cpp
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion engines/zvision/video/video.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit f4d5b15

Please sign in to comment.