diff options
-rw-r--r-- | engines/sci/gui/gui_animate.cpp | 6 | ||||
-rw-r--r-- | engines/sci/gui/gui_gfx.cpp | 14 |
2 files changed, 18 insertions, 2 deletions
diff --git a/engines/sci/gui/gui_animate.cpp b/engines/sci/gui/gui_animate.cpp index a06f652c74..19bcc418a0 100644 --- a/engines/sci/gui/gui_animate.cpp +++ b/engines/sci/gui/gui_animate.cpp @@ -205,6 +205,8 @@ void SciGuiAnimate::fill(byte &old_picNotValid) { listEntry->signal = signal; listIterator++; + + delete view; } } @@ -466,6 +468,8 @@ void SciGuiAnimate::addToPicDrawCels(List *list) { } listIterator++; + + delete view; } } @@ -478,6 +482,8 @@ void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, // Create rect according to coordinates and given cel view->getCelRect(loopNo, celNo, leftPos, topPos, priority, &celRect); _gfx->drawCel(view, loopNo, celNo, celRect, priority, 0); + + delete view; } } // End of namespace Sci diff --git a/engines/sci/gui/gui_gfx.cpp b/engines/sci/gui/gui_gfx.cpp index ebf54687f4..9a348e5082 100644 --- a/engines/sci/gui/gui_gfx.cpp +++ b/engines/sci/gui/gui_gfx.cpp @@ -671,8 +671,10 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo rect.bottom = rect.top + view->getHeight(loopNo, celNo); clipRect = rect; clipRect.clip(_curPort->rect); - if (clipRect.isEmpty()) // nothing to draw + if (clipRect.isEmpty()) { // nothing to draw + delete view; return; + } Common::Rect clipRectTranslated = clipRect; OffsetRect(clipRectTranslated); @@ -680,6 +682,8 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo if (!_screen->_picNotValid) BitsShow(rect); } + + delete view; } // This version of drawCel is not supposed to call BitsShow()! @@ -689,13 +693,17 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo if (view) { clipRect = celRect; clipRect.clip(_curPort->rect); - if (clipRect.isEmpty()) // nothing to draw + if (clipRect.isEmpty()) { // nothing to draw + delete view; return; + } Common::Rect clipRectTranslated = clipRect; OffsetRect(clipRectTranslated); view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo); } + + delete view; } // This version of drawCel is not supposed to call BitsShow()! @@ -1026,6 +1034,8 @@ void SciGuiGfx::SetNowSeen(reg_t objectReference) { PUT_SEL32V(objectReference, nsTop, celRect.top); PUT_SEL32V(objectReference, nsBottom, celRect.bottom); } + + delete view; } } // End of namespace Sci |