aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/aniobject.h
diff options
context:
space:
mode:
Diffstat (limited to 'engines/gob/aniobject.h')
-rw-r--r--engines/gob/aniobject.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/engines/gob/aniobject.h b/engines/gob/aniobject.h
index 28103007a6..c101d747b7 100644
--- a/engines/gob/aniobject.h
+++ b/engines/gob/aniobject.h
@@ -28,6 +28,7 @@
namespace Gob {
class ANIFile;
+class CMPFile;
class Surface;
/** An ANI object, controlling an animation within an ANI file. */
@@ -38,7 +39,10 @@ public:
kModeOnce ///< Play the animation only once.
};
+ /** Create an animation object from an ANI file. */
ANIObject(const ANIFile &ani);
+ /** Create an animation object from a CMP sprite. */
+ ANIObject(const CMPFile &cmp);
virtual ~ANIObject();
/** Make the object visible/invisible. */
@@ -69,6 +73,11 @@ public:
/** Return the current frame size. */
void getFrameSize(int16 &width, int16 &height) const;
+ /** Are there coordinates within the animation sprite? */
+ bool isIn(int16 x, int16 y) const;
+ /** Is this object within the animation sprite? */
+ bool isIn(const ANIObject &obj) const;
+
/** Set the animation number. */
void setAnimation(uint16 animation);
@@ -93,6 +102,7 @@ public:
private:
const ANIFile *_ani; ///< The managed ANI file.
+ const CMPFile *_cmp; ///< The managed CMP file.
uint16 _animation; ///< The current animation number
uint16 _frame; ///< The current frame.
@@ -112,6 +122,9 @@ private:
int16 _backgroundTop; ///< The top of the saved background.
int16 _backgroundRight; ///< The right position of the saved background.
int16 _backgroundBottom; ///< The bottom position of the saved background.
+
+ void drawCMP(Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom);
+ void drawANI(Surface &dest, int16 &left, int16 &top, int16 &right, int16 &bottom);
};
} // End of namespace Gob