gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/Makefile.am server/impl....


From: Sandro Santilli
Subject: [Gnash-commit] gnash ChangeLog server/Makefile.am server/impl....
Date: Sat, 26 Aug 2006 10:14:52 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Sandro Santilli <strk>  06/08/26 10:14:51

Modified files:
        .              : ChangeLog 
        server         : Makefile.am impl.cpp 
        server/parser  : Makefile.am 
        server/swf     : tag_loaders.cpp 
Added files:
        server/parser  : morph2_character_def.cpp morph2_character_def.h 
Removed files:
        server         : morph2.cpp morph2.h 

Log message:
                * server/morph2.{cpp,h}, 
server/parser/morph2_character_def.{cpp,h},
                  server/Makefile.am, server/parser/Makefile.am, 
server/impl.cpp,
                  server/swf/tag_loaders.cpp:
                  moved morph2 definition class to parser dir.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.722&r2=1.723
http://cvs.savannah.gnu.org/viewcvs/gnash/server/Makefile.am?cvsroot=gnash&r1=1.61&r2=1.62
http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/gnash/server/morph2.cpp?cvsroot=gnash&r1=1.14&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/server/morph2.h?cvsroot=gnash&r1=1.4&r2=0
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/Makefile.am?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.cpp?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.h?cvsroot=gnash&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.31&r2=1.32

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.722
retrieving revision 1.723
diff -u -b -r1.722 -r1.723
--- ChangeLog   26 Aug 2006 08:49:16 -0000      1.722
+++ ChangeLog   26 Aug 2006 10:14:51 -0000      1.723
@@ -1,5 +1,9 @@
 2006-08-26 Sandro Santilli  <address@hidden>
 
+       * server/morph2.{cpp,h}, server/parser/morph2_character_def.{cpp,h},
+         server/Makefile.am, server/parser/Makefile.am, server/impl.cpp,
+         server/swf/tag_loaders.cpp:
+         moved morph2 definition class to parser dir.
        * server/render.cpp: add a DEBUG_RENDER_CALLS macro to
          enable function calls info log.
 

Index: server/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/Makefile.am,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -b -r1.61 -r1.62
--- server/Makefile.am  24 Aug 2006 00:59:55 -0000      1.61
+++ server/Makefile.am  26 Aug 2006 10:14:51 -0000      1.62
@@ -92,7 +92,6 @@
         font.cpp \
         fontlib.cpp \
         impl.cpp \
-        morph2.cpp \
         render.cpp \
         shape.cpp \
        shm.cpp \
@@ -135,7 +134,6 @@
        gnash.h \
        gstring.h \
        impl.h \
-       morph2.h \
        morph.h \
        movie.h \
        movie_interface.h \

Index: server/impl.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/impl.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- server/impl.cpp     14 Aug 2006 20:05:12 -0000      1.51
+++ server/impl.cpp     26 Aug 2006 10:14:51 -0000      1.52
@@ -57,7 +57,7 @@
 #include "font.h"
 #include "fontlib.h"
 #include "log.h"
-#include "morph2.h"
+//#include "morph2.h"
 #include "render.h"
 #include "shape.h"
 #include "stream.h"

Index: server/parser/Makefile.am
===================================================================
RCS file: /sources/gnash/gnash/server/parser/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- server/parser/Makefile.am   24 Aug 2006 16:59:07 -0000      1.2
+++ server/parser/Makefile.am   26 Aug 2006 10:14:51 -0000      1.3
@@ -72,6 +72,7 @@
        edit_text_character_def.cpp \
        text_character_def.cpp \
        movie_def_impl.cpp \
+        morph2_character_def.cpp \
        shape_character_def.cpp \
        sprite_definition.cpp 
 
@@ -81,6 +82,7 @@
        bitmap_character_def.h \
        edit_text_character_def.h \
        text_character_def.h \
+       morph2_character_def.h \
        movie_definition.h \
        movie_def_impl.h \
        shape_character_def.h \

Index: server/swf/tag_loaders.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -b -r1.31 -r1.32
--- server/swf/tag_loaders.cpp  26 Aug 2006 02:08:32 -0000      1.31
+++ server/swf/tag_loaders.cpp  26 Aug 2006 10:14:51 -0000      1.32
@@ -51,7 +51,7 @@
 #include "font.h"
 #include "fontlib.h"
 #include "log.h"
-#include "morph2.h"
+#include "morph2_character_def.h"
 #include "render.h"
 #include "shape.h"
 #include "stream.h"

Index: server/parser/morph2_character_def.cpp
===================================================================
RCS file: server/parser/morph2_character_def.cpp
diff -N server/parser/morph2_character_def.cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/parser/morph2_character_def.cpp      26 Aug 2006 10:14:51 -0000      
1.1
@@ -0,0 +1,297 @@
+// morph2.cpp
+// -- Thatcher Ulrich <address@hidden>, Mike Shaver <address@hidden> 2003, 
Vitalij Alexeev <address@hidden> 2004.
+
+// This source code has been donated to the Public Domain.  Do
+// whatever you want with it.
+
+// Loading and rendering of morphing shapes using gnash_shape.
+
+#include "morph2_character_def.h"
+#include "stream.h"
+#include "movie_definition.h"
+#include "bitmap_character_def.h"
+#include "sprite_instance.h"
+
+
+namespace gnash {
+       morph2_character_def::morph2_character_def():
+               m_last_ratio(-1.0f), m_mesh(0)
+       {
+               m_shape1 = new shape_character_def();
+               m_shape2 = new shape_character_def();
+       }
+
+
+       morph2_character_def::~morph2_character_def()
+       {
+               delete m_shape2;
+               delete m_shape1;
+       }
+
+       void    morph2_character_def::display(character* inst)
+       {
+//             GNASH_REPORT_FUNCTION;
+               
+               unsigned int i;
+               float ratio = inst->get_ratio(); //m_ratio;
+
+               // bounds
+               rect    new_bound;
+               new_bound.set_lerp(m_shape1->get_bound(), 
m_shape2->get_bound(), ratio);
+               set_bound(new_bound);
+
+               // fill styles
+               for (i=0; i < m_fill_styles.size(); i++)
+               {
+                       fill_style& fs = m_fill_styles[i];
+
+                       const fill_style& fs1 = m_shape1->get_fill_styles()[i];
+                       const fill_style& fs2 = m_shape2->get_fill_styles()[i];
+
+                       fs.set_lerp(fs1, fs2, ratio);
+               }
+
+               // line styles
+               for (i=0; i < m_line_styles.size(); i++)
+               {
+                       line_style& ls = m_line_styles[i];
+                       const line_style& ls1 = m_shape1->get_line_styles()[i];
+                       const line_style& ls2 = m_shape2->get_line_styles()[i];
+                       ls.m_width = (uint16_t)frnd(flerp(ls1.get_width(), 
ls2.get_width(), ratio));
+                       ls.m_color.set_lerp(ls1.get_color(), ls2.get_color(), 
ratio);
+               }
+
+               // shape
+               unsigned int k=0, n=0;
+               for (i=0; i < m_paths.size(); i++)
+               {
+                       path& p = m_paths[i];
+                       const path& p1 = m_shape1->get_paths()[i];
+
+                       p.m_fill0 = p1.m_fill0;
+                       p.m_fill1 = p1.m_fill1;
+
+                       // @@ hack.
+                       if (p.m_fill0 == 0 && p.m_fill1 == 0)
+                       {
+                               if (m_shape1->get_fill_styles().size() > 0) 
p.m_fill0 = 1;
+                       }
+      
+                       p.m_line = p1.m_line;
+
+                       p.m_ax = flerp(p1.m_ax, m_shape2->get_paths()[n].m_ax, 
ratio);
+                       p.m_ay = flerp(p1.m_ay, m_shape2->get_paths()[n].m_ay, 
ratio);
+      
+                       //  edges;
+                       int len = p1.m_edges.size();
+                       p.m_edges.resize(len);
+
+                       for (unsigned int j=0; j < p.m_edges.size(); j++)
+                       {
+                               p.m_edges[j].m_cx = flerp(p1.m_edges[j].m_cx, 
m_shape2->get_paths()[n].m_edges[k].m_cx, ratio);
+                               p.m_edges[j].m_cy = flerp(p1.m_edges[j].m_cy, 
m_shape2->get_paths()[n].m_edges[k].m_cy, ratio);
+                               p.m_edges[j].m_ax = flerp(p1.m_edges[j].m_ax, 
m_shape2->get_paths()[n].m_edges[k].m_ax, ratio);
+                               p.m_edges[j].m_ay = flerp(p1.m_edges[j].m_ay, 
m_shape2->get_paths()[n].m_edges[k].m_ay, ratio);
+                               k++;
+                               if (m_shape2->get_paths()[n].m_edges.size() <= 
k)
+                               {
+                                       k=0; n++;
+                               }
+                       }
+               }
+    
+//  display
+
+               matrix mat = inst->get_world_matrix();
+               cxform cx = inst->get_world_cxform();
+               float max_error = 20.0f / mat.get_max_scale() / 
inst->get_parent()->get_pixel_scale();
+               if (ratio != m_last_ratio)
+               {
+                       delete m_mesh;
+                       m_last_ratio = ratio;
+                       m_mesh = new mesh_set(this, max_error * 0.75f);
+               }
+               m_mesh->display(mat, cx, m_fill_styles, m_line_styles);
+       }
+
+  
+       void    morph2_character_def::read(stream* in, int tag_type, bool 
with_style, movie_definition* md)
+       {
+               assert(tag_type == SWF::DEFINEMORPHSHAPE);
+
+               UNUSED(tag_type);
+               UNUSED(with_style);
+
+               rect    bound1, bound2;
+               bound1.read(in);
+               bound2.read(in);
+               m_shape1->set_bound(bound1);
+               m_shape2->set_bound(bound2);
+
+               offset = in->read_u32();
+
+               fill_style_count = in->read_variable_count();
+               int i;
+               for (i = 0; i < fill_style_count; i++) {
+                       fill_style fs1, fs2;
+
+                       fs1.m_type = in->read_u8();
+                       fs2.m_type = fs1.m_type;
+
+                       IF_VERBOSE_PARSE(
+                         log_parse("morph fill style type = 0x%X",
+                           fs1.m_type);
+                       );
+
+                       if (fs1.m_type == 0x00)
+                       {
+                               fs1.m_color.read_rgba(in);
+                               fs2.m_color.read_rgba(in);
+
+                               IF_VERBOSE_PARSE(
+                                 log_parse("morph fill style begin color: ");
+                                 fs1.m_color.print();
+                                 log_parse("morph fill style end color: ");
+                                 fs2.m_color.print();
+                               );
+                       }
+                       else if (fs1.m_type == 0x10 || fs1.m_type == 0x12)
+                       {
+                               matrix  input_matrix1, input_matrix2;
+
+                               input_matrix1.read(in);
+                               input_matrix2.read(in);
+
+                               fs1.m_gradient_matrix.set_identity();
+                               fs2.m_gradient_matrix.set_identity();
+                               if (fs1.m_type == 0x10)
+                               {
+                                       
fs1.m_gradient_matrix.concatenate_translation(128.f, 0.f);
+                                       
fs1.m_gradient_matrix.concatenate_scale(1.0f / 128.0f);
+                                       
fs2.m_gradient_matrix.concatenate_translation(128.f, 0.f);
+                                       
fs2.m_gradient_matrix.concatenate_scale(1.0f / 128.0f);
+                               }
+                               else
+                               {
+                                       
fs1.m_gradient_matrix.concatenate_translation(32.f, 32.f);
+                                       
fs1.m_gradient_matrix.concatenate_scale(1.0f / 512.0f);
+                                       
fs2.m_gradient_matrix.concatenate_translation(32.f, 32.f);
+                                       
fs2.m_gradient_matrix.concatenate_scale(1.0f / 512.0f);
+                               }
+
+                               matrix  m1, m2;
+                               m1.set_inverse(input_matrix1);
+                               fs1.m_gradient_matrix.concatenate(m1);
+                               m2.set_inverse(input_matrix2);
+                               fs2.m_gradient_matrix.concatenate(m2);
+
+                               // GRADIENT
+                               int     num_gradients = in->read_u8();
+                               assert(num_gradients >= 1 && num_gradients <= 
8);
+
+                               fs1.m_gradients.resize(num_gradients);
+                               fs2.m_gradients.resize(num_gradients);
+
+                               for (int j = 0; j < num_gradients; j++)
+                               {
+                                       fs1.m_gradients[j].read(in, tag_type);
+                                       fs2.m_gradients[j].read(in, tag_type);
+                               }
+
+                               IF_VERBOSE_PARSE(
+                                 log_parse("morph fsr: num_gradients = %d",
+                                   num_gradients);
+                               );
+
+                               // @@ hack.
+                               if (num_gradients > 0)
+                               {
+                                       fs1.m_color = 
fs1.m_gradients[0].m_color;
+                                       fs2.m_color = 
fs2.m_gradients[0].m_color;
+                               }
+                       }
+                       else if (fs1.m_type == 0x40 || fs1.m_type == 0x41)
+                       {
+
+                               int     bitmap_char_id = in->read_u16();
+                               IF_VERBOSE_PARSE(
+                                 log_parse("morph fsr bitmap_char = %d",
+                                   bitmap_char_id);
+                               );
+
+                               // Look up the bitmap character.
+                               fs1.m_bitmap_character = 
md->get_bitmap_character(bitmap_char_id);
+                               fs2.m_bitmap_character = fs1.m_bitmap_character;
+
+                               matrix  m1, m2;
+                               m1.read(in);
+                               m2.read(in);
+
+                               // For some reason, it looks like they store 
the inverse of the
+                               // TWIPS-to-texcoords matrix.
+                               fs1.m_bitmap_matrix.set_inverse(m1);
+                               fs2.m_bitmap_matrix.set_inverse(m2);
+                       }
+                       m_shape1->m_fill_styles.push_back(fs1);
+                       m_shape2->m_fill_styles.push_back(fs2);
+               }
+
+               line_style_count = in->read_variable_count();
+               for (i = 0; i < line_style_count; i++) {
+                       line_style ls1, ls2;
+                       ls1.m_width = in->read_u16();
+                       ls2.m_width = in->read_u16();
+                       ls1.m_color.read(in, tag_type);
+                       ls2.m_color.read(in, tag_type);
+                       m_shape1->m_line_styles.push_back(ls1);
+                       m_shape2->m_line_styles.push_back(ls2);
+               }
+
+               m_shape1->read(in, tag_type, false, md);
+               in->align();
+               m_shape2->read(in, tag_type, false, md);
+
+               assert(m_shape1->m_fill_styles.size() == 
m_shape2->m_fill_styles.size());
+               assert(m_shape1->m_line_styles.size() == 
m_shape2->m_line_styles.size());
+
+               // setup array size
+               m_fill_styles.resize(m_shape1->m_fill_styles.size());
+               unsigned int k;
+               for (k = 0; k < m_fill_styles.size(); k++)
+               {
+                       fill_style& fs = m_fill_styles[k];
+                       fill_style& fs1 = m_shape1->m_fill_styles[k];
+                       fs.m_gradients.resize(fs1.m_gradients.size());
+               }
+               m_line_styles.resize(m_shape1->m_line_styles.size());
+               m_paths.resize(m_shape1->m_paths.size());
+
+               int edges_count1 = 0;
+               for (k = 0; k < m_paths.size(); k++)
+               {
+                       path& p = m_paths[k];
+                       path& p1 = m_shape1->m_paths[k];
+                       int len = p1.m_edges.size();
+                       edges_count1 += len;
+                       p.m_edges.resize(len);
+               }
+
+               int edges_count2 = 0;
+               for (k = 0; k < m_shape2->m_paths.size(); k++)
+               {
+                       path& p2 = m_shape2->m_paths[k];
+                       int len = p2.m_edges.size();
+                       edges_count2 += len;
+               }
+               assert(edges_count1 == edges_count2);
+       }
+}
+
+
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 8 
+// tab-width: 8
+// indent-tabs-mode: t
+// End:

Index: server/parser/morph2_character_def.h
===================================================================
RCS file: server/parser/morph2_character_def.h
diff -N server/parser/morph2_character_def.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ server/parser/morph2_character_def.h        26 Aug 2006 10:14:51 -0000      
1.1
@@ -0,0 +1,45 @@
+// morph2.h -- Mike Shaver <address@hidden> 2003, , Vitalij Alexeev 
<address@hidden> 2004.
+
+// This source code has been donated to the Public Domain.  Do
+// whatever you want with it.
+
+#ifndef GNASH_MORPH2_H
+#define GNASH_MORPH2_H
+
+#include "shape.h"
+#include "shape_character_def.h" // for inheritance of morph2_character_def
+
+
+namespace gnash {
+
+       /// DefineMorphShape tag
+       //
+       class morph2_character_def : public shape_character_def
+       {
+       public:
+               morph2_character_def();
+               virtual ~morph2_character_def();
+               void    read(stream* in, int tag_type, bool with_style, 
movie_definition* m);
+               virtual void    display(character* inst);
+               void lerp_matrix(matrix& t, const matrix& m1, const matrix& m2, 
const float ratio);
+
+       private:
+               shape_character_def* m_shape1;
+               shape_character_def* m_shape2;
+               unsigned int offset;
+               int fill_style_count;
+               int line_style_count;
+               float m_last_ratio;
+               mesh_set*       m_mesh;
+       };
+}
+
+
+#endif // GNASH_MORPH2_H
+
+// Local Variables:
+// mode: C++
+// c-basic-offset: 8 
+// tab-width: 8
+// indent-tabs-mode: t
+// End:

Index: server/morph2.cpp
===================================================================
RCS file: server/morph2.cpp
diff -N server/morph2.cpp
--- server/morph2.cpp   19 Aug 2006 13:31:20 -0000      1.14
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,295 +0,0 @@
-// morph2.cpp
-// -- Thatcher Ulrich <address@hidden>, Mike Shaver <address@hidden> 2003, 
Vitalij Alexeev <address@hidden> 2004.
-
-// This source code has been donated to the Public Domain.  Do
-// whatever you want with it.
-
-// Loading and rendering of morphing shapes using gnash_shape.
-
-#include "morph2.h"
-#include "stream.h"
-#include "movie_definition.h"
-#include "bitmap_character_def.h"
-#include "sprite_instance.h"
-
-
-namespace gnash {
-       morph2_character_def::morph2_character_def():
-               m_last_ratio(-1.0f), m_mesh(0)
-       {
-               m_shape1 = new shape_character_def();
-               m_shape2 = new shape_character_def();
-       }
-
-
-       morph2_character_def::~morph2_character_def()
-       {
-               delete m_shape2;
-               delete m_shape1;
-       }
-
-       void    morph2_character_def::display(character* inst)
-       {
-//             GNASH_REPORT_FUNCTION;
-               
-               unsigned int i;
-               float ratio = inst->get_ratio(); //m_ratio;
-
-               // bounds
-               rect    new_bound;
-               new_bound.set_lerp(m_shape1->get_bound(), 
m_shape2->get_bound(), ratio);
-               set_bound(new_bound);
-
-               // fill styles
-               for (i=0; i < m_fill_styles.size(); i++)
-               {
-                       fill_style& fs = m_fill_styles[i];
-
-                       const fill_style& fs1 = m_shape1->get_fill_styles()[i];
-                       const fill_style& fs2 = m_shape2->get_fill_styles()[i];
-
-                       fs.set_lerp(fs1, fs2, ratio);
-               }
-
-               // line styles
-               for (i=0; i < m_line_styles.size(); i++)
-               {
-                       line_style& ls = m_line_styles[i];
-                       const line_style& ls1 = m_shape1->get_line_styles()[i];
-                       const line_style& ls2 = m_shape2->get_line_styles()[i];
-                       ls.m_width = (uint16_t)frnd(flerp(ls1.get_width(), 
ls2.get_width(), ratio));
-                       ls.m_color.set_lerp(ls1.get_color(), ls2.get_color(), 
ratio);
-               }
-
-               // shape
-               unsigned int k=0, n=0;
-               for (i=0; i < m_paths.size(); i++)
-               {
-                       path& p = m_paths[i];
-                       const path& p1 = m_shape1->get_paths()[i];
-
-                       p.m_fill0 = p1.m_fill0;
-                       p.m_fill1 = p1.m_fill1;
-
-                       // @@ hack.
-                       if (p.m_fill0 == 0 && p.m_fill1 == 0)
-                       {
-                               if (m_shape1->get_fill_styles().size() > 0) 
p.m_fill0 = 1;
-                       }
-      
-                       p.m_line = p1.m_line;
-
-                       p.m_ax = flerp(p1.m_ax, m_shape2->get_paths()[n].m_ax, 
ratio);
-                       p.m_ay = flerp(p1.m_ay, m_shape2->get_paths()[n].m_ay, 
ratio);
-      
-                       //  edges;
-                       int len = p1.m_edges.size();
-                       p.m_edges.resize(len);
-
-                       for (unsigned int j=0; j < p.m_edges.size(); j++)
-                       {
-                               p.m_edges[j].m_cx = flerp(p1.m_edges[j].m_cx, 
m_shape2->get_paths()[n].m_edges[k].m_cx, ratio);
-                               p.m_edges[j].m_cy = flerp(p1.m_edges[j].m_cy, 
m_shape2->get_paths()[n].m_edges[k].m_cy, ratio);
-                               p.m_edges[j].m_ax = flerp(p1.m_edges[j].m_ax, 
m_shape2->get_paths()[n].m_edges[k].m_ax, ratio);
-                               p.m_edges[j].m_ay = flerp(p1.m_edges[j].m_ay, 
m_shape2->get_paths()[n].m_edges[k].m_ay, ratio);
-                               k++;
-                               if (m_shape2->get_paths()[n].m_edges.size() <= 
k)
-                               {
-                                       k=0; n++;
-                               }
-                       }
-               }
-    
-//  display
-
-               matrix mat = inst->get_world_matrix();
-               cxform cx = inst->get_world_cxform();
-               float max_error = 20.0f / mat.get_max_scale() / 
inst->get_parent()->get_pixel_scale();
-               if (ratio != m_last_ratio)
-               {
-                       delete m_mesh;
-                       m_last_ratio = ratio;
-                       m_mesh = new mesh_set(this, max_error * 0.75f);
-               }
-               m_mesh->display(mat, cx, m_fill_styles, m_line_styles);
-       }
-
-  
-       void    morph2_character_def::read(stream* in, int tag_type, bool 
with_style, movie_definition* md)
-       {
-               UNUSED(tag_type);
-               UNUSED(with_style);
-
-               rect    bound1, bound2;
-               bound1.read(in);
-               bound2.read(in);
-               m_shape1->set_bound(bound1);
-               m_shape2->set_bound(bound2);
-
-               offset = in->read_u32();
-
-               fill_style_count = in->read_variable_count();
-               int i;
-               for (i = 0; i < fill_style_count; i++) {
-                       fill_style fs1, fs2;
-
-                       fs1.m_type = in->read_u8();
-                       fs2.m_type = fs1.m_type;
-
-                       IF_VERBOSE_PARSE(
-                         log_parse("morph fill style type = 0x%X",
-                           fs1.m_type);
-                       );
-
-                       if (fs1.m_type == 0x00)
-                       {
-                               fs1.m_color.read_rgba(in);
-                               fs2.m_color.read_rgba(in);
-
-                               IF_VERBOSE_PARSE(
-                                 log_parse("morph fill style begin color: ");
-                                 fs1.m_color.print();
-                                 log_parse("morph fill style end color: ");
-                                 fs2.m_color.print();
-                               );
-                       }
-                       else if (fs1.m_type == 0x10 || fs1.m_type == 0x12)
-                       {
-                               matrix  input_matrix1, input_matrix2;
-
-                               input_matrix1.read(in);
-                               input_matrix2.read(in);
-
-                               fs1.m_gradient_matrix.set_identity();
-                               fs2.m_gradient_matrix.set_identity();
-                               if (fs1.m_type == 0x10)
-                               {
-                                       
fs1.m_gradient_matrix.concatenate_translation(128.f, 0.f);
-                                       
fs1.m_gradient_matrix.concatenate_scale(1.0f / 128.0f);
-                                       
fs2.m_gradient_matrix.concatenate_translation(128.f, 0.f);
-                                       
fs2.m_gradient_matrix.concatenate_scale(1.0f / 128.0f);
-                               }
-                               else
-                               {
-                                       
fs1.m_gradient_matrix.concatenate_translation(32.f, 32.f);
-                                       
fs1.m_gradient_matrix.concatenate_scale(1.0f / 512.0f);
-                                       
fs2.m_gradient_matrix.concatenate_translation(32.f, 32.f);
-                                       
fs2.m_gradient_matrix.concatenate_scale(1.0f / 512.0f);
-                               }
-
-                               matrix  m1, m2;
-                               m1.set_inverse(input_matrix1);
-                               fs1.m_gradient_matrix.concatenate(m1);
-                               m2.set_inverse(input_matrix2);
-                               fs2.m_gradient_matrix.concatenate(m2);
-
-                               // GRADIENT
-                               int     num_gradients = in->read_u8();
-                               assert(num_gradients >= 1 && num_gradients <= 
8);
-
-                               fs1.m_gradients.resize(num_gradients);
-                               fs2.m_gradients.resize(num_gradients);
-
-                               for (int j = 0; j < num_gradients; j++)
-                               {
-                                       fs1.m_gradients[j].read(in, tag_type);
-                                       fs2.m_gradients[j].read(in, tag_type);
-                               }
-
-                               IF_VERBOSE_PARSE(
-                                 log_parse("morph fsr: num_gradients = %d",
-                                   num_gradients);
-                               );
-
-                               // @@ hack.
-                               if (num_gradients > 0)
-                               {
-                                       fs1.m_color = 
fs1.m_gradients[0].m_color;
-                                       fs2.m_color = 
fs2.m_gradients[0].m_color;
-                               }
-                       }
-                       else if (fs1.m_type == 0x40 || fs1.m_type == 0x41)
-                       {
-
-                               int     bitmap_char_id = in->read_u16();
-                               IF_VERBOSE_PARSE(
-                                 log_parse("morph fsr bitmap_char = %d",
-                                   bitmap_char_id);
-                               );
-
-                               // Look up the bitmap character.
-                               fs1.m_bitmap_character = 
md->get_bitmap_character(bitmap_char_id);
-                               fs2.m_bitmap_character = fs1.m_bitmap_character;
-
-                               matrix  m1, m2;
-                               m1.read(in);
-                               m2.read(in);
-
-                               // For some reason, it looks like they store 
the inverse of the
-                               // TWIPS-to-texcoords matrix.
-                               fs1.m_bitmap_matrix.set_inverse(m1);
-                               fs2.m_bitmap_matrix.set_inverse(m2);
-                       }
-                       m_shape1->m_fill_styles.push_back(fs1);
-                       m_shape2->m_fill_styles.push_back(fs2);
-               }
-
-               line_style_count = in->read_variable_count();
-               for (i = 0; i < line_style_count; i++) {
-                       line_style ls1, ls2;
-                       ls1.m_width = in->read_u16();
-                       ls2.m_width = in->read_u16();
-                       ls1.m_color.read(in, tag_type);
-                       ls2.m_color.read(in, tag_type);
-                       m_shape1->m_line_styles.push_back(ls1);
-                       m_shape2->m_line_styles.push_back(ls2);
-               }
-
-               m_shape1->read(in, tag_type, false, md);
-               in->align();
-               m_shape2->read(in, tag_type, false, md);
-
-               assert(m_shape1->m_fill_styles.size() == 
m_shape2->m_fill_styles.size());
-               assert(m_shape1->m_line_styles.size() == 
m_shape2->m_line_styles.size());
-
-               // setup array size
-               m_fill_styles.resize(m_shape1->m_fill_styles.size());
-               unsigned int k;
-               for (k = 0; k < m_fill_styles.size(); k++)
-               {
-                       fill_style& fs = m_fill_styles[k];
-                       fill_style& fs1 = m_shape1->m_fill_styles[k];
-                       fs.m_gradients.resize(fs1.m_gradients.size());
-               }
-               m_line_styles.resize(m_shape1->m_line_styles.size());
-               m_paths.resize(m_shape1->m_paths.size());
-
-               int edges_count1 = 0;
-               for (k = 0; k < m_paths.size(); k++)
-               {
-                       path& p = m_paths[k];
-                       path& p1 = m_shape1->m_paths[k];
-                       int len = p1.m_edges.size();
-                       edges_count1 += len;
-                       p.m_edges.resize(len);
-               }
-
-               int edges_count2 = 0;
-               for (k = 0; k < m_shape2->m_paths.size(); k++)
-               {
-                       path& p2 = m_shape2->m_paths[k];
-                       int len = p2.m_edges.size();
-                       edges_count2 += len;
-               }
-               assert(edges_count1 == edges_count2);
-       }
-}
-
-
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 8 
-// tab-width: 8
-// indent-tabs-mode: t
-// End:

Index: server/morph2.h
===================================================================
RCS file: server/morph2.h
diff -N server/morph2.h
--- server/morph2.h     8 May 2006 13:59:07 -0000       1.4
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,42 +0,0 @@
-// morph2.h -- Mike Shaver <address@hidden> 2003, , Vitalij Alexeev 
<address@hidden> 2004.
-
-// This source code has been donated to the Public Domain.  Do
-// whatever you want with it.
-
-#ifndef GNASH_MORPH2_H
-#define GNASH_MORPH2_H
-
-#include "shape.h"
-#include "shape_character_def.h" // for inheritance of morph2_character_def
-
-
-namespace gnash {
-       class morph2_character_def : public shape_character_def
-       {
-       public:
-               morph2_character_def();
-               virtual ~morph2_character_def();
-               void    read(stream* in, int tag_type, bool with_style, 
movie_definition* m);
-               virtual void    display(character* inst);
-               void lerp_matrix(matrix& t, const matrix& m1, const matrix& m2, 
const float ratio);
-
-       private:
-               shape_character_def* m_shape1;
-               shape_character_def* m_shape2;
-               unsigned int offset;
-               int fill_style_count;
-               int line_style_count;
-               float m_last_ratio;
-               mesh_set*       m_mesh;
-       };
-}
-
-
-#endif // GNASH_MORPH2_H
-
-// Local Variables:
-// mode: C++
-// c-basic-offset: 8 
-// tab-width: 8
-// indent-tabs-mode: t
-// End:




reply via email to

[Prev in Thread] Current Thread [Next in Thread]