aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-07-22 14:33:14 +0000
committerMatthew Hoops2010-07-22 14:33:14 +0000
commitc1ad4a1110e7f5a9b9e8e88015052cf51abda1a3 (patch)
tree2372903ef2754f176045bebe5c4ec5b9b958c185 /engines
parentede85a539afae551a0e325b92968c2532bd1d358 (diff)
downloadscummvm-rg350-c1ad4a1110e7f5a9b9e8e88015052cf51abda1a3.tar.gz
scummvm-rg350-c1ad4a1110e7f5a9b9e8e88015052cf51abda1a3.tar.bz2
scummvm-rg350-c1ad4a1110e7f5a9b9e8e88015052cf51abda1a3.zip
Use new[]/delete[] instead of malloc/free
svn-id: r51144
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/frameout.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index a83611396a..71352bb4f9 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -126,7 +126,7 @@ void GfxFrameout::kernelFrameout() {
_palette->palVaryUpdate();
// Allocate enough space for all screen items
- FrameoutEntry *itemData = (FrameoutEntry *)malloc(_screenItems.size() * sizeof(FrameoutEntry));
+ FrameoutEntry *itemData = new FrameoutEntry[_screenItems.size()];
for (Common::List<reg_t>::iterator it = _planes.begin(); it != _planes.end(); it++) {
reg_t planeObject = *it;
@@ -218,7 +218,7 @@ void GfxFrameout::kernelFrameout() {
// Show base picture
// planePicture->drawSci32Vga(0, planePicture->getSci32celX(0), planePicture->getSci32celY(0), planePictureMirrored);
// Allocate memory for picture cels
- pictureCels = (FrameoutEntry *)malloc(planePicture->getSci32celCount() * sizeof(FrameoutEntry));
+ pictureCels = new FrameoutEntry[planePicture->getSci32celCount()];
// Add following cels to the itemlist
FrameoutEntry *picEntry = pictureCels;
for (int pictureCelNr = 0; pictureCelNr < planePictureCels; pictureCelNr++) {
@@ -323,13 +323,13 @@ void GfxFrameout::kernelFrameout() {
}
if (planePicture) {
- free(pictureCels);
+ delete[] pictureCels;
delete planePicture;
planePicture = 0;
}
}
- free(itemData);
+ delete[] itemData;
_screen->copyToScreen();
}