aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-20 21:45:39 -0400
committerMatthew Hoops2011-09-20 21:45:39 -0400
commit335a043bd06ab269c8c263fb86a2bc48f5ba9f7b (patch)
tree891869b1b69a2227021e2c1b264762fab35c9d86 /engines
parentde23530a4eada1dd244bf5533479399b8747287a (diff)
downloadscummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.tar.gz
scummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.tar.bz2
scummvm-rg350-335a043bd06ab269c8c263fb86a2bc48f5ba9f7b.zip
PEGASUS: Add picture class
Diffstat (limited to 'engines')
-rwxr-xr-xengines/pegasus/surface.cpp16
-rwxr-xr-xengines/pegasus/surface.h9
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