aboutsummaryrefslogtreecommitdiff
path: root/engines/draci/walking.cpp
diff options
context:
space:
mode:
authorRobert Špalek2009-11-01 10:03:37 +0000
committerRobert Špalek2009-11-01 10:03:37 +0000
commitf91c89560f9e50f6cecfe93795d4c00513f45206 (patch)
tree343af44f00fde18843d29a4b340d144adb827447 /engines/draci/walking.cpp
parentb3eef9e066d8155bb9ba28bf1935f3024deebccf (diff)
downloadscummvm-rg350-f91c89560f9e50f6cecfe93795d4c00513f45206.tar.gz
scummvm-rg350-f91c89560f9e50f6cecfe93795d4c00513f45206.tar.bz2
scummvm-rg350-f91c89560f9e50f6cecfe93795d4c00513f45206.zip
Get rid of doubling memory allocation and a lot of copying.
The Sprite class points to the original buffer (which is cached in the memory thanks to BArchive machinery) instead of allocating its own buffer and copying the source there. svn-id: r45594
Diffstat (limited to 'engines/draci/walking.cpp')
-rw-r--r--engines/draci/walking.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/engines/draci/walking.cpp b/engines/draci/walking.cpp
index b9d7434349..f7c85d9bcd 100644
--- a/engines/draci/walking.cpp
+++ b/engines/draci/walking.cpp
@@ -71,8 +71,8 @@ Sprite *WalkingMap::constructDrawableOverlay() const {
}
}
- Sprite *ov = new Sprite(wlk, kScreenWidth, kScreenHeight, 0, 0, false);
- delete[] wlk;
+ Sprite *ov = new Sprite(kScreenWidth, kScreenHeight, wlk, 0, 0, false);
+ // ov has taken the ownership of wlk.
return ov;
}