aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/objects.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/parallaction/objects.cpp')
-rw-r--r--engines/parallaction/objects.cpp31
1 files changed, 27 insertions, 4 deletions
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 195d814265..c856d419e3 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -131,8 +131,6 @@ Zone::Zone() {
Zone::~Zone() {
// printf("~Zone(%s)\n", _label._text);
- _label._cnv.free();
-
switch (_type & 0xFFFF) {
case kZoneExamine:
free(u.examine->_filename);
@@ -198,15 +196,40 @@ uint16 Zone::height() const {
}
Label::Label() {
- _text = NULL;
+ resetPosition();
+ _text = 0;
}
Label::~Label() {
+ free();
+}
+
+void Label::free() {
_cnv.free();
if (_text)
- free(_text);
+ ::free(_text);
+ _text = 0;
+
+ resetPosition();
}
+void Label::resetPosition() {
+ _pos.x = -1000;
+ _pos.y = -1000;
+ _old.x = -1000;
+ _old.y = -1000;
+}
+
+void Label::getRect(Common::Rect &r, bool old) {
+ r.setWidth(_cnv.w);
+ r.setHeight(_cnv.h);
+
+ if (old) {
+ r.moveTo(_old);
+ } else {
+ r.moveTo(_pos);
+ }
+}
Answer::Answer() {
_text = NULL;