Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GNASH_MORPH_SHAPE_H
00021 #define GNASH_MORPH_SHAPE_H
00022
00023 #include "DisplayObject.h"
00024 #include "swf/DefineMorphShapeTag.h"
00025 #include <boost/intrusive_ptr.hpp>
00026 #include <cassert>
00027
00028 namespace gnash {
00029 class Renderer;
00030 }
00031
00032 namespace gnash {
00033
00035
00039
00045
00048 class MorphShape : public DisplayObject
00049 {
00050
00051 public:
00052
00053 MorphShape(movie_root& mr, as_object* object,
00054 const SWF::DefineMorphShapeTag* def, DisplayObject* parent);
00055
00056 virtual void display(Renderer& renderer, const Transform& xform);
00057
00058 virtual SWFRect getBounds() const;
00059
00060 virtual bool pointInShape(boost::int32_t x, boost::int32_t y) const;
00061
00062 const SWF::ShapeRecord& shape() const {
00063 return _shape;
00064 }
00065
00066 private:
00067
00068 void morph();
00069
00070 double currentRatio() const;
00071
00072 const boost::intrusive_ptr<const SWF::DefineMorphShapeTag> _def;
00073
00074 SWF::ShapeRecord _shape;
00075
00076 };
00077
00078
00079 }
00080
00081
00082 #endif
00083
00084
00085
00086
00087
00088