From 22eaffcb343c688defbcd53445ad111390edb71d Mon Sep 17 00:00:00 2001 From: Nicola Mettifogo Date: Fri, 15 Aug 2008 08:44:41 +0000 Subject: Updated layer calculation: animations are now hidden properly by background elements (but not items yet). svn-id: r33894 --- engines/parallaction/objects.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'engines/parallaction/objects.cpp') diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp index 6aeae3a92f..d2332643ed 100644 --- a/engines/parallaction/objects.cpp +++ b/engines/parallaction/objects.cpp @@ -71,6 +71,20 @@ uint16 Animation::height() const { return r.height(); } +int16 Animation::getFrameX() const { + if (!gfxobj) return _left; + Common::Rect r; + gfxobj->getRect(_frame, r); + return r.left + _left; +} + +int16 Animation::getFrameY() const { + if (!gfxobj) return _top; + Common::Rect r; + gfxobj->getRect(_frame, r); + return r.top + _top; +} + uint16 Animation::getFrameNum() const { if (!gfxobj) return 0; return gfxobj->getNum(); @@ -198,13 +212,6 @@ Zone::~Zone() { free(_linkedName); } -void Zone::getRect(Common::Rect& r) const { - r.left = _left; - r.right = _right; - r.top = _top; - r.bottom = _bottom; -} - void Zone::translate(int16 x, int16 y) { _left += x; _right += x; -- cgit v1.2.3