aboutsummaryrefslogtreecommitdiff
path: root/engines/tinsel
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tinsel')
-rw-r--r--engines/tinsel/actors.cpp6
-rw-r--r--engines/tinsel/bmv.cpp12
-rw-r--r--engines/tinsel/handle.cpp16
-rw-r--r--engines/tinsel/object.cpp6
-rw-r--r--engines/tinsel/savescn.cpp6
-rw-r--r--engines/tinsel/strres.cpp14
6 files changed, 21 insertions, 39 deletions
diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index efcefb442c..3577f4e0cc 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -197,10 +197,8 @@ void RegisterActors(int num) {
}
void FreeActors() {
- if (actorInfo) {
- free(actorInfo);
- actorInfo = NULL;
- }
+ free(actorInfo);
+ actorInfo = NULL;
}
/**
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 938507c3f9..b13de103c0 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -730,16 +730,12 @@ void BMVPlayer::FinishBMV() {
stream.close();
// Release the data buffer
- if (bigBuffer != NULL) {
- free(bigBuffer);
- bigBuffer = NULL;
- }
+ free(bigBuffer);
+ bigBuffer = NULL;
// Release the screen buffer
- if (screenBuffer != NULL) {
- free(screenBuffer);
- screenBuffer = NULL;
- }
+ free(screenBuffer);
+ screenBuffer = NULL;
// Ditch any text objects
for (i = 0; i < 2; i++) {
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index 60eb08a2dd..fdc4484a7c 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -175,22 +175,18 @@ void SetupHandleTable() {
}
void FreeHandleTable() {
- if (handleTable) {
- free(handleTable);
- handleTable = NULL;
- }
- if (cdGraphStream) {
- delete cdGraphStream;
- cdGraphStream = 0;
- }
+ free(handleTable);
+ handleTable = NULL;
+
+ delete cdGraphStream;
+ cdGraphStream = NULL;
}
/**
* Loads a memory block as a file.
*/
void OpenCDGraphFile() {
- if (cdGraphStream)
- delete cdGraphStream;
+ delete cdGraphStream;
// As the theory goes, the right CD will be in there!
diff --git a/engines/tinsel/object.cpp b/engines/tinsel/object.cpp
index f91e37a063..7a93a0b30a 100644
--- a/engines/tinsel/object.cpp
+++ b/engines/tinsel/object.cpp
@@ -49,10 +49,8 @@ static int maxObj = 0;
#endif
void FreeObjectList() {
- if (objectList) {
- free(objectList);
- objectList = NULL;
- }
+ free(objectList);
+ objectList = NULL;
}
/**
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 50231d34bb..2b5c815d3c 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -162,10 +162,8 @@ void InitialiseSaveScenes() {
}
void FreeSaveScenes() {
- if (ssData) {
- free(ssData);
- ssData = NULL;
- }
+ free(ssData);
+ ssData = NULL;
}
/**
diff --git a/engines/tinsel/strres.cpp b/engines/tinsel/strres.cpp
index 8f9f72f446..2416d6a8fa 100644
--- a/engines/tinsel/strres.cpp
+++ b/engines/tinsel/strres.cpp
@@ -88,11 +88,9 @@ void ChangeLanguage(LANGUAGE newLang) {
textLanguage = newLang;
sampleLanguage = newLang;
- if (textBuffer) {
- // free the previous buffer
- free(textBuffer);
- textBuffer = NULL;
- }
+ // free the previous buffer
+ free(textBuffer);
+ textBuffer = NULL;
// Try and open the specified language file. If it fails, and the language
// isn't English, try falling back on opening 'english.txt' - some foreign
@@ -355,10 +353,8 @@ int SubStringCount(int id) {
void FreeTextBuffer() {
- if (textBuffer) {
- free(textBuffer);
- textBuffer = NULL;
- }
+ free(textBuffer);
+ textBuffer = NULL;
}
/**