Skip to content

Commit

Permalink
PEGASUS: Fix bounds of Pictures
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Hoops committed Sep 21, 2011
1 parent 64d0b6d commit 46bc7e6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions engines/pegasus/surface.cpp
Expand Up @@ -234,4 +234,20 @@ void Picture::draw(const Common::Rect &r) {
drawImage(r2, r1);
}

void Picture::initFromPICTFile(const Common::String &fileName, bool transparent) {
Frame::initFromPICTFile(fileName, transparent);

Common::Rect surfaceBounds;
getSurfaceBounds(surfaceBounds);
setBounds(surfaceBounds);
}

void Picture::initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool transparent) {
Frame::initFromPICTResource(resFork, id, transparent);

Common::Rect surfaceBounds;
getSurfaceBounds(surfaceBounds);
setBounds(surfaceBounds);
}

} // End of namespace Pegasus
3 changes: 3 additions & 0 deletions engines/pegasus/surface.h
Expand Up @@ -120,6 +120,9 @@ class Picture : public DisplayElement, public Frame {
Picture(const tDisplayElementID id) : DisplayElement(id) {}
virtual ~Picture() {}

virtual void initFromPICTFile(const Common::String &fileName, bool transparent = false);
virtual void initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool transparent = false);

virtual void draw(const Common::Rect &);
};

Expand Down

0 comments on commit 46bc7e6

Please sign in to comment.