aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/cine/bg_list.cpp6
-rw-r--r--engines/cine/object.cpp2
-rw-r--r--engines/cine/prc.cpp2
-rw-r--r--engines/cine/rel.cpp2
-rw-r--r--engines/cine/script.cpp4
-rw-r--r--engines/cine/various.cpp15
6 files changed, 15 insertions, 16 deletions
diff --git a/engines/cine/bg_list.cpp b/engines/cine/bg_list.cpp
index 84fb8db133..837744c594 100644
--- a/engines/cine/bg_list.cpp
+++ b/engines/cine/bg_list.cpp
@@ -93,7 +93,7 @@ void createBgIncrustListElement(int16 objIdx, int16 param) {
bgIncrustPtr = bgIncrustPtr->next;
}
- bgIncrustPtr = (BGIncrustList *)malloc(sizeof(BGIncrustList));
+ bgIncrustPtr = new BGIncrustList;
if (bgIncrustPtrP)
bgIncrustPtrP->next = bgIncrustPtr;
else
@@ -115,7 +115,7 @@ void freeBgIncrustList(void) {
while (bgIncrustPtr) {
bgIncrustPtrN = bgIncrustPtr->next;
- free(bgIncrustPtr);
+ delete bgIncrustPtr;
bgIncrustPtr = bgIncrustPtrN;
}
@@ -137,7 +137,7 @@ void loadBgIncrustFromSave(Common::InSaveFile *fHandle) {
bgIncrustPtr = bgIncrustPtr->next;
}
- bgIncrustPtr = (BGIncrustList *)malloc(sizeof(BGIncrustList));
+ bgIncrustPtr = new BGIncrustList;
if (bgIncrustPtrP)
bgIncrustPtrP->next = bgIncrustPtr;
else
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index 5b1ad6f96f..23a3697d3c 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -183,7 +183,7 @@ void loadOverlayElement(uint16 objIdx, uint16 param) {
currentHeadPtr = tempHead->next;
}
- pNewElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
+ pNewElement = new overlayHeadElement;
assert(pNewElement);
diff --git a/engines/cine/prc.cpp b/engines/cine/prc.cpp
index 4081d6fd5a..a8a14cc013 100644
--- a/engines/cine/prc.cpp
+++ b/engines/cine/prc.cpp
@@ -53,7 +53,7 @@ void freePrcLinkedList(void) {
temp = currentHead->next;
- free(currentHead);
+ delete currentHead;
currentHead = temp;
}
diff --git a/engines/cine/rel.cpp b/engines/cine/rel.cpp
index 15697c2cf1..c9c5755ac6 100644
--- a/engines/cine/rel.cpp
+++ b/engines/cine/rel.cpp
@@ -48,7 +48,7 @@ void releaseObjectScripts(void) {
temp = currentHead->next;
- free(currentHead);
+ delete currentHead;
currentHead = temp;
}
diff --git a/engines/cine/script.cpp b/engines/cine/script.cpp
index 3b9437bd78..c92fd4560a 100644
--- a/engines/cine/script.cpp
+++ b/engines/cine/script.cpp
@@ -474,7 +474,7 @@ void addGfxElementA0(int16 param1, int16 param2) {
if (currentHead && currentHead->objIdx == param1 && currentHead->type == 20 && currentHead->x == param2)
return;
- newElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
+ newElement = new overlayHeadElement;
newElement->next = tempHead->next;
tempHead->next = newElement;
@@ -652,7 +652,7 @@ void addScriptToList0(uint16 idx) {
currentHead = tempHead->next;
}
- pNewElement =(prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
+ pNewElement = new prcLinkedListStruct;
assert(pNewElement);
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index 037bb203fb..bf08c29b43 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -162,7 +162,7 @@ void runObjectScript(int16 entryIdx) {
currentHead = tempHead->next;
}
- pNewElement = (prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
+ pNewElement = new prcLinkedListStruct;
assert(pNewElement);
@@ -202,7 +202,7 @@ void addPlayerCommandMessage(int16 cmd) {
currentHeadPtr = tempHead->next;
}
- pNewElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
+ pNewElement = new overlayHeadElement;
assert(pNewElement);
@@ -324,8 +324,7 @@ void loadObjectScriptFromSave(Common::InSaveFile *fHandle) {
currentHead = tempHead->next;
}
- newElement =
- (prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
+ newElement = new prcLinkedListStruct;
newElement->next = tempHead->next;
tempHead->next = newElement;
@@ -357,7 +356,7 @@ void loadGlobalScriptFromSave(Common::InSaveFile *fHandle) {
currentHead = tempHead->next;
}
- newElement = (prcLinkedListStruct *)malloc(sizeof(prcLinkedListStruct));
+ newElement = new prcLinkedListStruct;
newElement->next = tempHead->next;
tempHead->next = newElement;
@@ -387,7 +386,7 @@ void loadOverlayFromSave(Common::InSaveFile *fHandle) {
currentHead = tempHead->next;
}
- newElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
+ newElement = new overlayHeadElement;
fHandle->readUint32BE();
fHandle->readUint32BE();
@@ -2321,7 +2320,7 @@ void addMessage(byte param1, int16 param2, int16 param3, int16 param4, int16 par
currentHead = tempHead->next;
}
- newElement = (overlayHeadElement *)malloc(sizeof(overlayHeadElement));
+ newElement = new overlayHeadElement;
newElement->next = tempHead->next;
tempHead->next = newElement;
@@ -2356,7 +2355,7 @@ void addSeqListElement(int16 param0, int16 param1, int16 param2, int16 param3, i
currentHead = tempHead->next;
}
- newElement = (SeqListElement *)malloc(sizeof(SeqListElement));
+ newElement = new SeqListElement;
newElement->next = tempHead->next;
tempHead->next = newElement;