Skip to content

Commit

Permalink
DIRECTOR: Generalize sprite dimension getter
Browse files Browse the repository at this point in the history
  • Loading branch information
npjg committed Jul 7, 2020
1 parent 1c2f2b9 commit 2f12428
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions engines/director/sprite.cpp
Expand Up @@ -173,12 +173,10 @@ void Sprite::setCast(uint16 castId) {
Common::Rect Sprite::getDims() {
Common::Rect result;

if (!_cast || _cast->_type == kCastShape) {
result = Common::Rect(_width, _height);
} else if (_cast->_widget) {
if (_cast && _cast->_widget) {
result = Common::Rect(_cast->_widget->_dims.width(), _cast->_widget->_dims.height());
} else {
warning("Sprite::getDims(): Unable to find sprite dimensions");
result = Common::Rect(_width, _height);
}

if (_puppet && _stretch) {
Expand Down

0 comments on commit 2f12428

Please sign in to comment.