From c1ad4a1110e7f5a9b9e8e88015052cf51abda1a3 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Thu, 22 Jul 2010 14:33:14 +0000 Subject: Use new[]/delete[] instead of malloc/free svn-id: r51144 --- engines/sci/graphics/frameout.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines') 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::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(); } -- cgit v1.2.3