diff options
author | Matthew Hoops | 2011-09-20 21:45:39 -0400 |
---|---|---|
committer | Matthew Hoops | 2011-09-20 21:45:39 -0400 |
commit | 335a043bd06ab269c8c263fb86a2bc48f5ba9f7b (patch) | |
tree | 891869b1b69a2227021e2c1b264762fab35c9d86 /engines | |
parent | de23530a4eada1dd244bf5533479399b8747287a (diff) | |
download | scummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.tar.gz scummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.tar.bz2 scummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.zip |
PEGASUS: Add picture class
Diffstat (limited to 'engines')
-rwxr-xr-x | engines/pegasus/surface.cpp | 16 | ||||
-rwxr-xr-x | engines/pegasus/surface.h | 9 |
2 files changed, 25 insertions, 0 deletions
diff --git a/engines/pegasus/surface.cpp b/engines/pegasus/surface.cpp index 7da5cd1124..48f9fa3cb2 100755 --- a/engines/pegasus/surface.cpp +++ b/engines/pegasus/surface.cpp @@ -218,4 +218,20 @@ void Frame::initFromPICTResource(Common::MacResManager *resFork, uint16 id, bool _transparent = transparent; } +void Picture::draw(const Common::Rect &r) { + Common::Rect surfaceBounds; + getSurfaceBounds(surfaceBounds); + Common::Rect r1 = r; + + Common::Rect bounds; + getBounds(bounds); + surfaceBounds.moveTo(bounds.left, bounds.top); + r1 = r1.findIntersectingRect(surfaceBounds); + getSurfaceBounds(surfaceBounds); + + Common::Rect r2 = r1; + r2.translate(surfaceBounds.left - bounds.left, surfaceBounds.top - bounds.top); + drawImage(r2, r1); +} + } // End of namespace Pegasus diff --git a/engines/pegasus/surface.h b/engines/pegasus/surface.h index 1b63702960..9493323af6 100755 --- a/engines/pegasus/surface.h +++ b/engines/pegasus/surface.h @@ -29,6 +29,7 @@ #include "common/rect.h" #include "common/str.h" +#include "pegasus/elements.h" #include "pegasus/types.h" namespace Common { @@ -114,6 +115,14 @@ protected: uint32 _referenceCount; }; +class Picture : public DisplayElement, public Frame { +public: + Picture(const tDisplayElementID id) : DisplayElement(id) {} + virtual ~Picture() {} + + virtual void draw(const Common::Rect &); +}; + } // End of namespace Pegasus #endif |