CVSROOT: /sources/gnash Module name: gnash Changes by: Chad Musick <cmusick> 07/09/10 04:29:54
Modified files: . : ChangeLog server : fill_style.cpp styles.cpp server/parser : morph2_character_def.cpp shape_character_def.cpp Log message: Fix morph (and morph2) displays. Should fix bug #19085, as well as letting morph2 (SWF8+) work correctly. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4255&r2=1.4256 http://cvs.savannah.gnu.org/viewcvs/gnash/server/fill_style.cpp?cvsroot=gnash&r1=1.11&r2=1.12 http://cvs.savannah.gnu.org/viewcvs/gnash/server/styles.cpp?cvsroot=gnash&r1=1.34&r2=1.35 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/morph2_character_def.cpp?cvsroot=gnash&r1=1.14&r2=1.15 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/shape_character_def.cpp?cvsroot=gnash&r1=1.38&r2=1.39 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4255 retrieving revision 1.4256 diff -u -b -r1.4255 -r1.4256 --- ChangeLog 9 Sep 2007 15:47:43 -0000 1.4255 +++ ChangeLog 10 Sep 2007 04:29:53 -0000 1.4256 @@ -1,10 +1,18 @@ -<<<<<<< ChangeLog +2007-09-10 Chad Musick <[EMAIL PROTECTED]> + + * server/fill_style.cpp: Correct handling of morph fills. + * server/styles.cpp: Correct handling of morph colors. + * server/parser/morph2_character_def.cpp: Remove @@hack + * line, and fix underlying problem instead. Should fix + * bug #19085. Morph and Morph2 shapes now work correctly. + * server/parser/shape_character_def.cpp: Be sure to read + * on alignment where needed. + 2007-09-09 Rob Savoye <[EMAIL PROTECTED]> * macros/kde.m4: Look for shared libraries that don't end in .so. patch #6191. -======= 2007-09-08 Sandro Santilli <[EMAIL PROTECTED]> * server/parser/video_stream_def.h: document class members, @@ -21,7 +29,6 @@ always set output parameters to 0 if requested frame number is not available. ->>>>>>> 1.4254 2007-09-07 Sandro Santilli <[EMAIL PROTECTED]> * server/dlist.{cpp,h}: change signature of .reset() to Index: server/fill_style.cpp =================================================================== RCS file: /sources/gnash/gnash/server/fill_style.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -b -r1.11 -r1.12 --- server/fill_style.cpp 4 Sep 2007 11:27:42 -0000 1.11 +++ server/fill_style.cpp 10 Sep 2007 04:29:54 -0000 1.12 @@ -203,7 +203,7 @@ if (num_gradients > 0) { m_color = m_gradients[0].m_color; if (is_morph) - pOther->m_color = m_gradients[0].m_color; + pOther->m_color = pOther->m_gradients[0].m_color; } if (md->get_create_bitmaps() == DO_LOAD_BITMAPS) { @@ -265,6 +265,7 @@ if (is_morph) { + pOther->m_bitmap_character = m_bitmap_character; m.read(in); pOther->m_bitmap_matrix.set_inverse(m); } Index: server/styles.cpp =================================================================== RCS file: /sources/gnash/gnash/server/styles.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -b -r1.34 -r1.35 --- server/styles.cpp 4 Sep 2007 11:27:42 -0000 1.34 +++ server/styles.cpp 10 Sep 2007 04:29:54 -0000 1.35 @@ -70,6 +70,7 @@ fill_style f, g; f.read(in, tag_type, md, &g); m_color = f.get_color(); + pOther->m_color = g.get_color(); } else { Index: server/parser/morph2_character_def.cpp =================================================================== RCS file: /sources/gnash/gnash/server/parser/morph2_character_def.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- server/parser/morph2_character_def.cpp 4 Sep 2007 11:27:43 -0000 1.14 +++ server/parser/morph2_character_def.cpp 10 Sep 2007 04:29:54 -0000 1.15 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: morph2_character_def.cpp,v 1.14 2007/09/04 11:27:43 cmusick Exp $ */ +/* $Id: morph2_character_def.cpp,v 1.15 2007/09/10 04:29:54 cmusick Exp $ */ // Based on the public domain morph2.cpp of: // Thatcher Ulrich <[EMAIL PROTECTED]>, Mike Shaver <[EMAIL PROTECTED]> 2003, @@ -164,13 +164,6 @@ p.reset ( new_ax, new_ay, p1.getLeftFill(), p2.getRightFill(), p1.getLineStyle() ); - // @@ hack. - if (p.getLeftFill() == 0 && p.getRightFill() == 0) - { - if (m_shape1->get_fill_styles().size() > 0) p.setLeftFill(1); - } - - // edges; size_t len = p1.size(); p.m_edges.resize(len); @@ -246,117 +239,6 @@ // Next line will throw ParserException on malformed SWF fill_style_count = in->read_variable_count(); int i; - if (tag_type == SWF::DEFINEMORPHSHAPE) - { - for (i = 0; i < fill_style_count; i++) { - fill_style fs1, fs2; - - in->ensureBytes(1); - 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 - in->ensureBytes(1); - 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) - { - - in->ensureBytes(2); - 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_def(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); - } - } - else // MorphShape2 - { fill_style fs1, fs2; for (i = 0; i < fill_style_count; ++i) { @@ -364,24 +246,8 @@ m_shape1->m_fill_styles.push_back(fs1); m_shape2->m_fill_styles.push_back(fs2); } - } line_style_count = in->read_variable_count(); - if (tag_type == SWF::DEFINEMORPHSHAPE) - { - for (i = 0; i < line_style_count; i++) { - line_style ls1, ls2; - in->ensureBytes(4); - 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); - } - } - else // MorphShape2 is different - { line_style ls1, ls2; for (i = 0; i < line_style_count; ++i) { @@ -389,7 +255,6 @@ 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(); Index: server/parser/shape_character_def.cpp =================================================================== RCS file: /sources/gnash/gnash/server/parser/shape_character_def.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -b -r1.38 -r1.39 --- server/parser/shape_character_def.cpp 2 Sep 2007 12:57:01 -0000 1.38 +++ server/parser/shape_character_def.cpp 10 Sep 2007 04:29:54 -0000 1.39 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: shape_character_def.cpp,v 1.38 2007/09/02 12:57:01 cmusick Exp $ */ +/* $Id: shape_character_def.cpp,v 1.39 2007/09/10 04:29:54 cmusick Exp $ */ // Based on the public domain shape.cpp of Thatcher Ulrich <[EMAIL PROTECTED]> 2003 @@ -211,8 +211,10 @@ //log_msg("Read %u fill styles, %u line styles", m_fill_styles.size(), m_line_styles.size()); - int num_fill_bits = in->read_uint(4); - int num_line_bits = in->read_uint(4); + // Use read_u8 to force alignment. + uint8_t num_bits = in->read_u8(); + int num_fill_bits = (num_bits & 0xF0) >> 4; + int num_line_bits = (num_bits & 0x0F); IF_VERBOSE_PARSE ( @@ -441,8 +443,8 @@ // EDGERECORD bool edge_flag = in->read_bit(); if (edge_flag == 0) { - // curved edge int num_bits = 2 + in->read_uint(4); + // curved edge int cx = x + in->read_sint(num_bits); int cy = y + in->read_sint(num_bits); int ax = cx + in->read_sint(num_bits); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit