diff options
author | Marisa-Chan | 2014-02-24 22:46:00 +0700 |
---|---|---|
committer | Marisa-Chan | 2014-02-24 22:46:00 +0700 |
commit | 8e02e06db153a68e86239c09b79565b0372cd789 (patch) | |
tree | 61f8f0c706464a447097e44f122b6b791311cc8a /engines | |
parent | ac9b74dd16fb5950cdaa6c540b1e0d2e968ed129 (diff) | |
download | scummvm-rg350-8e02e06db153a68e86239c09b79565b0372cd789.tar.gz scummvm-rg350-8e02e06db153a68e86239c09b79565b0372cd789.tar.bz2 scummvm-rg350-8e02e06db153a68e86239c09b79565b0372cd789.zip |
ZVISION: Change rendermanager code for correct subtitles handle.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/render_manager.cpp | 19 | ||||
-rw-r--r-- | engines/zvision/render_manager.h | 2 | ||||
-rw-r--r-- | engines/zvision/zvision.cpp | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/engines/zvision/render_manager.cpp b/engines/zvision/render_manager.cpp index 6cfc0509c7..071affffab 100644 --- a/engines/zvision/render_manager.cpp +++ b/engines/zvision/render_manager.cpp @@ -24,6 +24,7 @@ #include "zvision/zvision.h" #include "zvision/render_manager.h" +#include "zvision/text.h" #include "zvision/lzss_read_stream.h" @@ -746,9 +747,14 @@ void RenderManager::updateSubArea(uint16 id, const Common::String &txt) { } } -void RenderManager::renderSubsToScreen() { +void RenderManager::processSubs(uint16 deltatime) { bool redraw = false; for (subMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) { + if (it->_value.timer != -1) { + it->_value.timer -= deltatime; + if (it->_value.timer <= 0) + it->_value.todelete = true; + } if (it->_value.todelete) { _subsList.erase(it); redraw = true; @@ -761,7 +767,16 @@ void RenderManager::renderSubsToScreen() { _subWnd.fillRect(Common::Rect(_subWnd.w, _subWnd.h), 0); for (subMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) { - //draw subs + oneSub *sub = &it->_value; + if (sub->_txt.size()) { + Graphics::Surface *rndr = new Graphics::Surface(); + rndr->create(sub->_r.width(), sub->_r.height(), _pixelFormat); + _engine->getTextRenderer()->drawTxtInOneLine(sub->_txt, *rndr); + blitSurfaceToSurface(*rndr, _subWnd, sub->_r.left - _subWndRect.left + _workingWindow.left, sub->_r.top - _subWndRect.top + _workingWindow.top); + rndr->free(); + delete rndr; + } + sub->redraw = false; } _system->copyRectToScreen(_subWnd.getPixels(), _subWnd.pitch, diff --git a/engines/zvision/render_manager.h b/engines/zvision/render_manager.h index 3c03331d0f..668c8acc41 100644 --- a/engines/zvision/render_manager.h +++ b/engines/zvision/render_manager.h @@ -236,7 +236,7 @@ public: void deleteSubArea(uint16 id); void deleteSubArea(uint16 id, int16 delay); void updateSubArea(uint16 id, const Common::String &txt); - void renderSubsToScreen(); + void processSubs(uint16 deltatime); Common::Point getBkgSize(); diff --git a/engines/zvision/zvision.cpp b/engines/zvision/zvision.cpp index 178c7978ae..4c5164cd6e 100644 --- a/engines/zvision/zvision.cpp +++ b/engines/zvision/zvision.cpp @@ -192,7 +192,7 @@ Common::Error ZVision::run() { // Render the backBuffer to the screen _renderManager->prepareBkg(); _renderManager->renderMenuToScreen(); - _renderManager->renderSubsToScreen(); + _renderManager->processSubs(deltaTime); _renderManager->renderBackbufferToScreen(); // Update the screen |