aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/backgroundIncrust.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/backgroundIncrust.cpp')
-rw-r--r--engines/cruise/backgroundIncrust.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/cruise/backgroundIncrust.cpp b/engines/cruise/backgroundIncrust.cpp
index 78cf49c653..6bd8b270e0 100644
--- a/engines/cruise/backgroundIncrust.cpp
+++ b/engines/cruise/backgroundIncrust.cpp
@@ -49,7 +49,7 @@ void backupBackground(backgroundIncrustStruct *pIncrust, int X, int Y, int width
pIncrust->savedX = X;
pIncrust->savedY = Y;
- pIncrust->ptr = (uint8*)malloc(width * height);
+ pIncrust->ptr = (uint8*)MemAlloc(width * height);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
int xp = j + X;
@@ -239,9 +239,9 @@ void freeBackgroundIncrustList(backgroundIncrustStruct *pHead) {
backgroundIncrustStruct *pNext = pCurrent->next;
if (pCurrent->ptr)
- free(pCurrent->ptr);
+ MemFree(pCurrent->ptr);
- free(pCurrent);
+ MemFree(pCurrent);
pCurrent = pNext;
}
@@ -292,10 +292,10 @@ void removeBackgroundIncrust(int overlay, int idx, backgroundIncrustStruct * pHe
bx->prev = pCurrent->next;
if (pCurrent->ptr) {
- free(pCurrent->ptr);
+ MemFree(pCurrent->ptr);
}
- free(pCurrent);
+ MemFree(pCurrent);
pCurrent = pNext;
} else {