From 46bc7e6c4d6ec9addccff397f1c8439d6a86bb20 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 21 Sep 2011 19:44:42 -0400 Subject: PEGASUS: Fix bounds of Pictures --- engines/pegasus/surface.cpp | 16 ++++++++++++++++ engines/pegasus/surface.h | 3 +++ 2 files changed, 19 insertions(+) diff --git a/engines/pegasus/surface.cpp b/engines/pegasus/surface.cpp index 48f9fa3cb2..fb64c92c21 100755 --- a/engines/pegasus/surface.cpp +++ b/engines/pegasus/surface.cpp @@ -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 diff --git a/engines/pegasus/surface.h b/engines/pegasus/surface.h index 9493323af6..72d614f963 100755 --- a/engines/pegasus/surface.h +++ b/engines/pegasus/surface.h @@ -120,6 +120,9 @@ public: 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 &); }; -- cgit v1.2.3