aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/zvision/render_manager.cpp19
-rw-r--r--engines/zvision/render_manager.h2
-rw-r--r--engines/zvision/zvision.cpp2
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