~ubuntu-branches/ubuntu/saucy/gnash/saucy-proposed

« back to all changes in this revision

Viewing changes to server/parser/morph2_character_def.h

  • Committer: Bazaar Package Importer
  • Author(s): Alexander Sack
  • Date: 2008-10-13 14:29:49 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20081013142949-f6qdvnu4mn05ltdc
Tags: 0.8.4~~bzr9980-0ubuntu1
* new upstream release 0.8.4 (LP: #240325)
* ship new lib usr/lib/gnash/libmozsdk.so.* in mozilla-plugin-gnash
  - update debian/mozilla-plugin-gnash.install
* ship new lib usr/lib/gnash/libgnashnet.so.* in gnash-common
  - update debian/gnash-common.install
* add basic debian/build_head script to build latest CVS head packages.
  - add debian/build_head
* new sound architecture requires build depend on libsdl1.2-dev
  - update debian/control
* head build script now has been completely migrated to bzr (upstream +
  ubuntu)
  - update debian/build_head
* disable kde gui until klash/qt4 has been fixed; keep kde packages as empty
  packages for now.
  - update debian/rules
  - debian/klash.install
  - debian/klash.links
  - debian/klash.manpages
  - debian/konqueror-plugin-gnash.install
* drop libkonq5-dev build dependency accordingly
  - update debian/control
* don't install headers manually anymore. gnash doesnt provide a -dev
  package after all
  - update debian/rules
* update libs installed in gnash-common; libgnashserver-*.so is not available
  anymore (removed); in turn we add the new libgnashcore-*.so
  - update debian/gnash-common.install
* use -Os for optimization and properly pass CXXFLAGS=$(CFLAGS) to configure
  - update debian/rules
* touch firefox .autoreg in postinst of mozilla plugin
  - update debian/mozilla-plugin-gnash.postinst
* link gnash in ubufox plugins directory for the plugin alternative switcher
  - add debian/mozilla-plugin-gnash.links
* suggest ubufox accordingly
  - update debian/control
* add new required build-depends on libgif-dev
  - update debian/control
* add Xb-Npp-Description and Xb-Npp-File as new plugin database meta data
  - update debian/control

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// morph2.h -- Mike Shaver <shaver@off.net> 2003, , Vitalij Alexeev <tishka92@mail.ru> 2004.
2
 
 
3
 
// This source code has been donated to the Public Domain.  Do
4
 
// whatever you want with it.
5
 
 
6
 
#ifndef GNASH_MORPH2_H
7
 
#define GNASH_MORPH2_H
8
 
 
9
 
#include "shape.h"
10
 
#include "shape_character_def.h" // for inheritance of morph2_character_def
11
 
 
12
 
 
13
 
namespace gnash {
14
 
 
15
 
        /// DefineMorphShape tag
16
 
        //
17
 
        class morph2_character_def : public shape_character_def
18
 
        {
19
 
        public:
20
 
                morph2_character_def();
21
 
                virtual ~morph2_character_def();
22
 
 
23
 
                /// Read a DefineMorphShape tag from stream
24
 
                //
25
 
                /// Throw ParserException if the tag is malformed
26
 
                ///
27
 
                /// @param in
28
 
                ///     The stream to read the definition from.
29
 
                ///     Tag type is assumed to have been read already
30
 
                ///
31
 
                /// @param tag_type
32
 
                ///     Type of the tag.
33
 
                ///     Need be SWF::DEFINEMORPHSHAPE or an assertion would fail.
34
 
                ///     TODO: drop ?
35
 
                ///
36
 
                /// @param with_style
37
 
                ///     Unused. TODO: drop.
38
 
                ///
39
 
                /// @param md
40
 
                ///     Movie definition. Used to resolv character ids for fill styles.
41
 
                ///     Must be not-null or would segfault. 
42
 
                ///     TODO: take by reference !
43
 
                ///
44
 
                void    read(stream* in, int tag_type, bool with_style, movie_definition* m);
45
 
 
46
 
                virtual void    display(character* inst);
47
 
                void lerp_matrix(matrix& t, const matrix& m1, const matrix& m2, const float ratio);
48
 
 
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 
53
 
                { 
54
 
                        m_bound.expand_to_rect(m_shape1->m_bound);
55
 
                        m_bound.expand_to_rect(m_shape2->m_bound);
56
 
                        return m_bound;
57
 
                }
58
 
 
59
 
        protected:
60
 
 
61
 
#ifdef GNASH_USE_GC
62
 
        /// Mark all reachable resources of a morph2_character_def, for the GC
63
 
        //
64
 
        /// Reachable resources are:
65
 
        ///     - The start and end shapes (m_shape1, m_shape2)
66
 
        ///
67
 
        virtual void markReachableResources() const
68
 
        {
69
 
                if ( m_shape1 ) m_shape1->setReachable();
70
 
                if ( m_shape2 ) m_shape2->setReachable();
71
 
        }
72
 
#endif // GNASH_USE_GC
73
 
 
74
 
        private:
75
 
                boost::intrusive_ptr<shape_character_def> m_shape1;
76
 
                boost::intrusive_ptr<shape_character_def> m_shape2;
77
 
                unsigned int offset;
78
 
                int fill_style_count;
79
 
                int line_style_count;
80
 
                float m_last_ratio;
81
 
                mutable rect m_bound;
82
 
        };
83
 
}
84
 
 
85
 
 
86
 
#endif // GNASH_MORPH2_H
87
 
 
88
 
// Local Variables:
89
 
// mode: C++
90
 
// c-basic-offset: 8 
91
 
// tab-width: 8
92
 
// indent-tabs-mode: t
93
 
// End: