diff options
author | Martin Kiewitz | 2010-10-04 09:23:06 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-10-04 09:23:06 +0000 |
commit | 04a8ff06a21959f3048de5b0d09bbc45b5114f3c (patch) | |
tree | be52b4d58037604a4a5755b94394be56a9720694 | |
parent | fd4a78292fd81e405fbb66578bae36ac25b67a5e (diff) | |
download | scummvm-rg350-04a8ff06a21959f3048de5b0d09bbc45b5114f3c.tar.gz scummvm-rg350-04a8ff06a21959f3048de5b0d09bbc45b5114f3c.tar.bz2 scummvm-rg350-04a8ff06a21959f3048de5b0d09bbc45b5114f3c.zip |
SCI: fixing crash in mag cursor code for pharkas
svn-id: r53014
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index 86e06dc06b..0fa490cfa8 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -411,6 +411,8 @@ void GfxCursor::kernelClearZoomZone() { _zoomColor = 0; _zoomMultiplier = 0; _zoomZoneActive = false; + delete _zoomCursorView; + delete _zoomPicView; } void GfxCursor::kernelSetZoomZone(byte multiplier, Common::Rect zone, GuiResourceId viewNum, int loopNum, int celNum, GuiResourceId picNum, byte zoomColor) { @@ -421,20 +423,10 @@ void GfxCursor::kernelSetZoomZone(byte multiplier, Common::Rect zone, GuiResourc _zoomMultiplier = multiplier; - if (_cachedCursors.size() >= MAX_CACHED_CURSORS) - purgeCache(); - - if (!_cachedCursors.contains(viewNum)) - _cachedCursors[viewNum] = new GfxView(_resMan, _screen, _palette, viewNum); - if (!_cachedCursors.contains(picNum)) - _cachedCursors[picNum] = new GfxView(_resMan, _screen, _palette, picNum); - - _zoomCursorView = _cachedCursors[viewNum]; + _zoomCursorView = new GfxView(_resMan, _screen, _palette, viewNum); _zoomCursorLoop = (byte)loopNum; _zoomCursorCel = (byte)celNum; - _zoomPicView = _cachedCursors[picNum]; - - kernelSetView(viewNum, loopNum, celNum, NULL); + _zoomPicView = new GfxView(_resMan, _screen, _palette, picNum); _zoomZone = zone; kernelSetMoveZone(_zoomZone); |