Updated layer calculation: animations are now hidden properly by background elements (but not items yet).

svn-id: r33894
This commit is contained in:
Nicola Mettifogo 2008-08-15 08:44:41 +00:00
parent 0606fef24e
commit 22eaffcb34
7 changed files with 62 additions and 29 deletions

View file

@ -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;