aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction/objects.cpp
diff options
context:
space:
mode:
authorNicola Mettifogo2007-09-02 18:34:11 +0000
committerNicola Mettifogo2007-09-02 18:34:11 +0000
commit21e4f4f1760e204de6e8d0a413f8e8f8987dd083 (patch)
tree1902fcb1756b1226e05dc12a4bfabead8ba9215d /engines/parallaction/objects.cpp
parentf1f324cee424cb97da1a14789db2806002ba3f6e (diff)
downloadscummvm-rg350-21e4f4f1760e204de6e8d0a413f8e8f8987dd083.tar.gz
scummvm-rg350-21e4f4f1760e204de6e8d0a413f8e8f8987dd083.tar.bz2
scummvm-rg350-21e4f4f1760e204de6e8d0a413f8e8f8987dd083.zip
Simplified global label management and added subtitles for BRA.
svn-id: r28828
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;