aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorRichieSams2015-02-11 15:08:32 -0600
committerRichieSams2015-02-11 15:13:20 -0600
commit2d2cfbe005b93397f1e121888b0358e137ccc863 (patch)
tree4602adba968eee869c935eafede2cf114ba3d5b6 /engines/zvision
parent8ecc5e52c5ad49d9fe40490d666d47349569d151 (diff)
downloadscummvm-rg350-2d2cfbe005b93397f1e121888b0358e137ccc863.tar.gz
scummvm-rg350-2d2cfbe005b93397f1e121888b0358e137ccc863.tar.bz2
scummvm-rg350-2d2cfbe005b93397f1e121888b0358e137ccc863.zip
ZVISION: Create temporary subtitle surfaces on the stack rather than the heap
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/graphics/render_manager.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/engines/zvision/graphics/render_manager.cpp b/engines/zvision/graphics/render_manager.cpp
index 67410b4b6a..3772d5909e 100644
--- a/engines/zvision/graphics/render_manager.cpp
+++ b/engines/zvision/graphics/render_manager.cpp
@@ -753,13 +753,12 @@ void RenderManager::processSubs(uint16 deltatime) {
for (SubtitleMap::iterator it = _subsList.begin(); it != _subsList.end(); it++) {
OneSubtitle *sub = &it->_value;
if (sub->txt.size()) {
- Graphics::Surface *rndr = new Graphics::Surface();
- rndr->create(sub->r.width(), sub->r.height(), _engine->_resourcePixelFormat);
- _engine->getTextRenderer()->drawTextWithWordWrapping(sub->txt, *rndr);
+ Graphics::Surface subtitleSurface;
+ subtitleSurface.create(sub->r.width(), sub->r.height(), _engine->_resourcePixelFormat);
+ _engine->getTextRenderer()->drawTextWithWordWrapping(sub->txt, subtitleSurface);
Common::Rect empty;
- blitSurfaceToSurface(*rndr, empty, _subtitleSurface, sub->r.left - _subtitleArea.left + _workingWindow.left, sub->r.top - _subtitleArea.top + _workingWindow.top);
- rndr->free();
- delete rndr;
+ blitSurfaceToSurface(subtitleSurface, empty, _subtitleSurface, sub->r.left - _subtitleArea.left + _workingWindow.left, sub->r.top - _subtitleArea.top + _workingWindow.top);
+ subtitleSurface.free();
}
sub->redraw = false;
}