1
// morph2.h -- Mike Shaver <shaver@off.net> 2003, , Vitalij Alexeev <tishka92@mail.ru> 2004.
3
// This source code has been donated to the Public Domain. Do
4
// whatever you want with it.
10
#include "shape_character_def.h" // for inheritance of morph2_character_def
15
/// DefineMorphShape tag
17
class morph2_character_def : public shape_character_def
20
morph2_character_def();
21
virtual ~morph2_character_def();
23
/// Read a DefineMorphShape tag from stream
25
/// Throw ParserException if the tag is malformed
28
/// The stream to read the definition from.
29
/// Tag type is assumed to have been read already
33
/// Need be SWF::DEFINEMORPHSHAPE or an assertion would fail.
37
/// Unused. TODO: drop.
40
/// Movie definition. Used to resolv character ids for fill styles.
41
/// Must be not-null or would segfault.
42
/// TODO: take by reference !
44
void read(stream* in, int tag_type, bool with_style, movie_definition* m);
46
virtual void display(character* inst);
47
void lerp_matrix(matrix& t, const matrix& m1, const matrix& m2, const float ratio);
49
// Question: What is the bound of a morph? Is this conceptually correct?
50
/// TODO: optimize this by take ratio into consideration, to decrease some
51
/// invalidated area when rendering morphs
52
virtual const rect& get_bound() const
54
m_bound.expand_to_rect(m_shape1->m_bound);
55
m_bound.expand_to_rect(m_shape2->m_bound);
62
/// Mark all reachable resources of a morph2_character_def, for the GC
64
/// Reachable resources are:
65
/// - The start and end shapes (m_shape1, m_shape2)
67
virtual void markReachableResources() const
69
if ( m_shape1 ) m_shape1->setReachable();
70
if ( m_shape2 ) m_shape2->setReachable();
72
#endif // GNASH_USE_GC
75
boost::intrusive_ptr<shape_character_def> m_shape1;
76
boost::intrusive_ptr<shape_character_def> m_shape2;
86
#endif // GNASH_MORPH2_H
92
// indent-tabs-mode: t