aboutsummaryrefslogtreecommitdiff
path: root/gob
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-05 11:11:49 +0000
committerTorbjörn Andersson2005-05-05 11:11:49 +0000
commitfd326b4ce2adc73960a7d71d5d8f3ef8faacf753 (patch)
tree6167c768125f9de586806ec21072be657a0046a4 /gob
parent4120ae9921cfb135777a4fb25e98545a7038e7aa (diff)
downloadscummvm-rg350-fd326b4ce2adc73960a7d71d5d8f3ef8faacf753.tar.gz
scummvm-rg350-fd326b4ce2adc73960a7d71d5d8f3ef8faacf753.tar.bz2
scummvm-rg350-fd326b4ce2adc73960a7d71d5d8f3ef8faacf753.zip
Cleanup
svn-id: r17913
Diffstat (limited to 'gob')
-rw-r--r--gob/game.cpp17
-rw-r--r--gob/goblin.cpp21
-rw-r--r--gob/init.cpp15
-rw-r--r--gob/mult.cpp37
-rw-r--r--gob/palanim.cpp6
5 files changed, 28 insertions, 68 deletions
diff --git a/gob/game.cpp b/gob/game.cpp
index 881f1ef714..62c1ba2c91 100644
--- a/gob/game.cpp
+++ b/gob/game.cpp
@@ -1870,26 +1870,21 @@ void game_playTot(int16 skipPlay) {
draw_blitInvalidated();
free(game_totFileData);
game_totFileData = 0;
- if (game_totTextData != 0 && needTextFree != 0)
- free(game_totTextData);
+ if (needTextFree)
+ free(game_totTextData);
game_totTextData = 0;
- if (game_totResourceTable != 0
- && needFreeResTable != 0)
+ if (needFreeResTable)
free(game_totResourceTable);
-
game_totResourceTable = 0;
- if (game_imFileData != 0)
- free(game_imFileData);
-
+ free(game_imFileData);
game_imFileData = 0;
- if (game_extTable != 0)
- free(game_extTable);
-
+ free(game_extTable);
game_extTable = 0;
+
if (game_extHandle >= 0)
data_closeData(game_extHandle);
diff --git a/gob/goblin.cpp b/gob/goblin.cpp
index cb704fdf3e..a5d7fae268 100644
--- a/gob/goblin.cpp
+++ b/gob/goblin.cpp
@@ -1842,23 +1842,14 @@ void gob_freeObjects(void) {
for (state = 0; state < 40; state++) {
for (col = 0; col < 6; col++) {
-
- if (gob_goblins[i]->stateMach[state][col] != 0) {
- free(gob_goblins[i]->
- stateMach[state][col]);
- gob_goblins[i]->stateMach[state][col] =
- 0;
- }
+ free(gob_goblins[i]->stateMach[state][col]);
+ gob_goblins[i]->stateMach[state][col] = 0;
}
}
if (i == 3) {
for (state = 40; state < 70; state++) {
- if (gob_goblins[3]->stateMach[state][0] == 0)
- continue;
-
- free(gob_goblins[3]->
- stateMach[state][0]);
+ free(gob_goblins[3]->stateMach[state][0]);
gob_goblins[3]->stateMach[state][0] = 0;
}
}
@@ -1876,11 +1867,7 @@ void gob_freeObjects(void) {
for (state = 0; state < 40; state++) {
for (col = 0; col < 6; col++) {
- if (gob_objects[i]->stateMach[state][col] == 0)
- continue;
-
- free(gob_objects[i]->
- stateMach[state][col]);
+ free(gob_objects[i]->stateMach[state][col]);
gob_objects[i]->stateMach[state][col] = 0;
}
}
diff --git a/gob/init.cpp b/gob/init.cpp
index 2a972ef52c..17868060af 100644
--- a/gob/init.cpp
+++ b/gob/init.cpp
@@ -282,17 +282,10 @@ memBlocks = word ptr -2*/
cd_stopPlaying();
cd_freeLICbuffer();
- if (inter_variables != 0)
- free(inter_variables);
-
- if (game_totFileData != 0)
- free(game_totFileData);
-
- if (game_totTextData != 0)
- free(game_totTextData);
-
- if (game_totResourceTable != 0)
- free(game_totResourceTable);
+ free(inter_variables);
+ free(game_totFileData);
+ free(game_totTextData);
+ free(game_totResourceTable);
}
for (i = 0; i < 4; i++) {
diff --git a/gob/mult.cpp b/gob/mult.cpp
index 798d59dd9d..878f1b7e9d 100644
--- a/gob/mult.cpp
+++ b/gob/mult.cpp
@@ -475,11 +475,8 @@ void mult_freeMult(void) {
if (anim_underAnimSurf != 0)
vid_freeSurfDesc(anim_underAnimSurf);
- if (mult_objects != 0)
- free(mult_objects);
-
- if (mult_renderData != 0)
- free(mult_renderData);
+ free(mult_objects);
+ free(mult_renderData);
mult_objects = 0;
mult_renderData = 0;
@@ -931,24 +928,19 @@ void mult_playMult(int16 startFrame, int16 endFrame, char checkEscape,
if (stopNoClear == 0) {
if (mult_animDataAllocated) {
- if (mult_objects)
- free(mult_objects);
+ free(mult_objects);
mult_objects = 0;
- if (mult_renderData)
- free(mult_renderData);
+ free(mult_renderData);
mult_renderData = 0;
- if (mult_animArrayX)
- free(mult_animArrayX);
+ free(mult_animArrayX);
mult_animArrayX = 0;
- if (mult_animArrayY)
- free(mult_animArrayY);
+ free(mult_animArrayY);
mult_animArrayY = 0;
- if (mult_animArrayData)
- free(mult_animArrayData);
+ free(mult_animArrayData);
mult_animArrayData = 0;
if (anim_underAnimSurf)
@@ -1178,24 +1170,19 @@ void mult_freeMultKeys(void) {
mult_multData = 0;
if (mult_animDataAllocated != 0) {
- if (mult_objects)
- free(mult_objects);
+ free(mult_objects);
mult_objects = 0;
- if (mult_renderData)
- free(mult_renderData);
+ free(mult_renderData);
mult_renderData = 0;
- if (mult_animArrayX)
- free(mult_animArrayX);
+ free(mult_animArrayX);
mult_animArrayX = 0;
- if (mult_animArrayY)
- free(mult_animArrayY);
+ free(mult_animArrayY);
mult_animArrayY = 0;
- if (mult_animArrayData)
- free(mult_animArrayData);
+ free(mult_animArrayData);
mult_animArrayData = 0;
if (anim_underAnimSurf)
diff --git a/gob/palanim.cpp b/gob/palanim.cpp
index 8fb9c9094d..3dc912f5f7 100644
--- a/gob/palanim.cpp
+++ b/gob/palanim.cpp
@@ -228,10 +228,8 @@ void pal_fade(PalDesc *palDesc, int16 fade, int16 allColors) {
util_clearPalette();
}
- if (tmpPalBuffer != 0) {
- free(tmpPalBuffer);
- tmpPalBuffer = 0;
- }
+ free(tmpPalBuffer);
+ tmpPalBuffer = 0;
}
} // End of namespace Gob