aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/parallaction/graphics.cpp3
-rw-r--r--engines/parallaction/parallaction.cpp2
-rw-r--r--engines/parallaction/walk.cpp2
-rw-r--r--engines/parallaction/zone.cpp17
-rw-r--r--engines/parallaction/zone.h5
5 files changed, 19 insertions, 10 deletions
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 7d21c81a5a..dfd67ff461 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -897,6 +897,9 @@ Gfx::Gfx(Parallaction* vm) :
setBlackPalette();
+ _bgLayers[0] = _bgLayers[1] = _bgLayers[2] = _bgLayers[3] = 0;
+
+ memset(_palette, 0, sizeof(_palette));
memset(_palettefx, 0, sizeof(_palettefx));
initMouse( 0 );
diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp
index 490ca38e31..cc94da3094 100644
--- a/engines/parallaction/parallaction.cpp
+++ b/engines/parallaction/parallaction.cpp
@@ -139,6 +139,8 @@ Parallaction::~Parallaction() {
if (_localFlagNames)
delete _localFlagNames;
+
+ delete _gfx;
}
diff --git a/engines/parallaction/walk.cpp b/engines/parallaction/walk.cpp
index 4910bc07ba..a5f9a62ddf 100644
--- a/engines/parallaction/walk.cpp
+++ b/engines/parallaction/walk.cpp
@@ -182,7 +182,7 @@ WalkNodeList *PathBuilder::buildPath(uint16 x, uint16 y) {
_list->insert(_list->begin(), _subPath.begin(), _subPath.end());
for (WalkNodeList::iterator it = _list->begin(); it != _list->end(); it++)
- printf("node (%i, %i)\n", (*it)->_x, (*it)->_y);
+// printf("node (%i, %i)\n", (*it)->_x, (*it)->_y);
delete v44;
return _list;
diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp
index ebf2136f05..d447992445 100644
--- a/engines/parallaction/zone.cpp
+++ b/engines/parallaction/zone.cpp
@@ -601,7 +601,7 @@ Zone::Zone() {
}
Zone::~Zone() {
- printf("~Zone(%s)\n", _label._text);
+// printf("~Zone(%s)\n", _label._text);
switch (_type & 0xFFFF) {
case kZoneExamine:
@@ -642,11 +642,6 @@ Zone::~Zone() {
default:
break;
}
-
- free(_label._text);
- _label._text = NULL;
- _vm->_gfx->freeStaticCnv(&_label._cnv);
-
}
void Zone::getRect(Common::Rect& r) const {
@@ -671,5 +666,15 @@ uint16 Zone::height() const {
return _bottom - _top;
}
+Label::Label() {
+ _text = NULL;
+}
+
+Label::~Label() {
+ _vm->_gfx->freeStaticCnv(&_cnv);
+ if (_text)
+ free(_text);
+}
+
} // namespace Parallaction
diff --git a/engines/parallaction/zone.h b/engines/parallaction/zone.h
index 1a0a616624..559eedb0fe 100644
--- a/engines/parallaction/zone.h
+++ b/engines/parallaction/zone.h
@@ -184,9 +184,8 @@ struct Label {
char* _text;
StaticCnv _cnv;
- Label() {
- _text = NULL;
- }
+ Label();
+ ~Label();
};
struct Zone {