+ else if (has_char == false && flag_move == false) + { + m_place_type = REMOVE; + }
PlaceObject2/3 could act as a REMOVE tag? Sounds interesting, never met this situation before. Any difference compared to RemoveObject tag? On 8/24/07, Chad Musick <[EMAIL PROTECTED]> wrote: > CVSROOT: /sources/gnash > Module name: gnash > Changes by: Chad Musick <cmusick> 07/08/24 05:55:52 > > Modified files: > . : ChangeLog > server : impl.cpp > server/swf : PlaceObject2Tag.cpp PlaceObject2Tag.h > > Log message: > Adding support for PlaceObject3 SWF8 tag. > > CVSWeb URLs: > http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4089&r2=1.4090 > http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.116&r2=1.117 > http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.cpp?cvsroot=gnash&r1=1.17&r2=1.18 > http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/PlaceObject2Tag.h?cvsroot=gnash&r1=1.12&r2=1.13 > > Patches: > Index: ChangeLog > =================================================================== > RCS file: /sources/gnash/gnash/ChangeLog,v > retrieving revision 1.4089 > retrieving revision 1.4090 > diff -u -b -r1.4089 -r1.4090 > --- ChangeLog 24 Aug 2007 05:49:45 -0000 1.4089 > +++ ChangeLog 24 Aug 2007 05:55:51 -0000 1.4090 > @@ -1,5 +1,14 @@ > 2007-08-24 Chad Musick <[EMAIL PROTECTED]> > > + * server/swf/PlaceObject2Tag.cpp,h: Add support for the > + PlaceObject3 tag. This immediately improves some SWF 8 > + support. The tag still needs to do something with the > + filters which it loads. > + * server/impl.cpp: Add a loader for PlaceObject3, remove > + loaders for DefineShape4, which isn't yet functional. > + > +2007-08-24 Chad Musick <[EMAIL PROTECTED]> > + > * server/swf.h: Add FOCAL_GRADIENT to fill styles. > > 2007-08-24 Chad Musick <[EMAIL PROTECTED]> > > Index: server/impl.cpp > =================================================================== > RCS file: /sources/gnash/gnash/server/impl.cpp,v > retrieving revision 1.116 > retrieving revision 1.117 > diff -u -b -r1.116 -r1.117 > --- server/impl.cpp 22 Aug 2007 13:09:10 -0000 1.116 > +++ server/impl.cpp 24 Aug 2007 05:55:51 -0000 1.117 > @@ -17,7 +17,7 @@ > // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > // > > -/* $Id: impl.cpp,v 1.116 2007/08/22 13:09:10 cmusick Exp $ */ > +/* $Id: impl.cpp,v 1.117 2007/08/24 05:55:51 cmusick Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" > @@ -244,11 +244,11 @@ > > // TODO: Alexis reference says these are 83, 84. The 67,68 comes from > Tamarin. > // Figure out which one is correct (possibly both are). > - register_tag_loader(SWF::DEFINESHAPE4_, fixme_loader); // 67 > + register_tag_loader(SWF::DEFINESHAPE4_, fixme_loader > /*define_shape_loader*/); // 67 > register_tag_loader(SWF::DEFINEMORPHSHAPE2_, fixme_loader); // 68 > > register_tag_loader(SWF::FILEATTRIBUTES, file_attributes_loader); // 69 > - register_tag_loader(SWF::PLACEOBJECT3, fixme_loader); // 70 > + register_tag_loader(SWF::PLACEOBJECT3, PlaceObject2Tag::loader); // 70 > register_tag_loader(SWF::IMPORTASSETS2, import_loader); // 71 > > register_tag_loader(SWF::DOABC, fixme_loader); // 72 -- AS3 codeblock. > @@ -260,7 +260,7 @@ > register_tag_loader(SWF::METADATA, metadata_loader); // 77 > register_tag_loader(SWF::DEFINESCALINGGRID, fixme_loader); // 78 > register_tag_loader(SWF::DOABCDEFINE, fixme_loader); // 79 -- AS3 > codeblock. > - register_tag_loader(SWF::DEFINESHAPE4, fixme_loader); // 83 > + register_tag_loader(SWF::DEFINESHAPE4, fixme_loader > /*define_shape_loader*/); // 83 > register_tag_loader(SWF::DEFINEMORPHSHAPE2, fixme_loader); // 84 > > register_tag_loader(SWF::DEFINEFONTNAME, define_font_name_loader); // > 88 > > Index: server/swf/PlaceObject2Tag.cpp > =================================================================== > RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.cpp,v > retrieving revision 1.17 > retrieving revision 1.18 > diff -u -b -r1.17 -r1.18 > --- server/swf/PlaceObject2Tag.cpp 9 Aug 2007 12:18:07 -0000 1.17 > +++ server/swf/PlaceObject2Tag.cpp 24 Aug 2007 05:55:52 -0000 1.18 > @@ -17,7 +17,7 @@ > // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > // > > -/* $Id: PlaceObject2Tag.cpp,v 1.17 2007/08/09 12:18:07 zoulunkai Exp $ */ > +/* $Id: PlaceObject2Tag.cpp,v 1.18 2007/08/24 05:55:52 cmusick Exp $ */ > > #ifdef HAVE_CONFIG_H > #include "config.h" > @@ -29,6 +29,7 @@ > #include "swf_event.h" > #include "log.h" > #include "stream.h" > +#include "filters.h" > > namespace gnash { > namespace SWF { > @@ -210,10 +211,16 @@ > > // read SWF::PLACEOBJECT2 > void > -PlaceObject2Tag::readPlaceObject2(stream* in, int movie_version) > +PlaceObject2Tag::readPlaceObject2(stream* in, int movie_version, bool > place_2) > { > in->align(); > > + uint8_t blend_mode = 0; > + uint8_t bitmask = 0; > + bool has_bitmap_caching = false; > + bool has_blend_mode = false; > + bool has_filters = false; > + > bool has_actions = in->read_uint(1) ? true : false; > bool has_clip_bracket = in->read_uint(1) ? true : false; > bool has_name = in->read_uint(1) ? true : false; > @@ -223,6 +230,14 @@ > bool has_char = in->read_uint(1) ? true : false; > bool flag_move = in->read_uint(1) ? true : false; > > + if (!place_2 && movie_version >= 8) > + { > + static_cast<void> (in->read_uint(5)); // Ignore on purpose. > + has_bitmap_caching = in->read_uint(1) ? true : false; > + has_blend_mode = in->read_uint(1) ? true : false; > + has_filters = in->read_uint(1) ? true : false; > + } > + > m_depth = in->read_u16()+character::staticDepthOffset; > > if (has_char) m_character_id = in->read_u16(); > @@ -251,12 +266,29 @@ > else > m_clip_depth = character::noClipDepthValue; > > + if (has_filters) > + { > + effect_filters::effect_filters_vec v; // TODO: Something should > be done with the filters... > + effect_filters::filter_factory::read(in, movie_version, true, > &v); > + } > + > + if (has_blend_mode) > + { > + blend_mode = in->read_u8(); > + } > + > + if (has_bitmap_caching) > + { > + // It is not certain that this actually exists, so if this reader > + // is broken, it is probably here! > + bitmask = in->read_u8(); > + } > + > if (has_actions) > { > readPlaceActions(in, movie_version); > } > > - > if (has_char == true && flag_move == true) > { > // Remove whatever's at m_depth, and put m_character there. > @@ -272,6 +304,10 @@ > // Put m_character at m_depth. > m_place_type = PLACE; > } > + else if (has_char == false && flag_move == false) > + { > + m_place_type = REMOVE; > + } > > IF_VERBOSE_PARSE ( > log_parse(_(" PLACEOBJECT2: depth = %d (%d)"), m_depth, > m_depth-character::staticDepthOffset); > @@ -307,7 +343,7 @@ > } > else > { > - readPlaceObject2(in, movie_version); > + readPlaceObject2(in, movie_version, tag == SWF::PLACEOBJECT3 > ? false : true); > } > } > > @@ -349,6 +385,9 @@ > m_ratio, > m_clip_depth); > break; > + > + case REMOVE: > + m->remove_display_object(m_depth, 0); // 0 since it is unused. > } > } > > @@ -366,7 +405,7 @@ > void > PlaceObject2Tag::loader(stream* in, tag_type tag, movie_definition* m) > { > - assert(tag == SWF::PLACEOBJECT || tag == SWF::PLACEOBJECT2); > + assert(tag == SWF::PLACEOBJECT || tag == SWF::PLACEOBJECT2 || tag == > SWF::PLACEOBJECT3); > > IF_VERBOSE_PARSE > ( > > Index: server/swf/PlaceObject2Tag.h > =================================================================== > RCS file: /sources/gnash/gnash/server/swf/PlaceObject2Tag.h,v > retrieving revision 1.12 > retrieving revision 1.13 > diff -u -b -r1.12 -r1.13 > --- server/swf/PlaceObject2Tag.h 1 Jul 2007 10:54:35 -0000 1.12 > +++ server/swf/PlaceObject2Tag.h 24 Aug 2007 05:55:52 -0000 1.13 > @@ -19,7 +19,7 @@ > // > // > > -/* $Id: PlaceObject2Tag.h,v 1.12 2007/07/01 10:54:35 bjacques Exp $ */ > +/* $Id: PlaceObject2Tag.h,v 1.13 2007/08/24 05:55:52 cmusick Exp $ */ > > #ifndef GNASH_SWF_PLACEOBJECT2TAG_H > #define GNASH_SWF_PLACEOBJECT2TAG_H > @@ -97,6 +97,10 @@ > /// Return true if this tag transforms a character > bool isMove() const { return m_place_type == MOVE; } > > + /// Return true if this tag removes a character. > + // This is set by having no char and no place in the place tag. > + bool isRemove() const { return m_place_type == REMOVE; } > + > static void loader(stream* in, tag_type tag, movie_definition* m); > > int getRatio() const { return m_ratio;} > @@ -118,7 +122,8 @@ > { > PLACE, > MOVE, > - REPLACE > + REPLACE, > + REMOVE > } m_place_type; > > const movie_definition& _movie_def; > @@ -131,8 +136,8 @@ > // read placeObject2 actions > void readPlaceActions(stream* in, int movie_version); > > - // read SWF::PLACEOBJECT2 > - void readPlaceObject2(stream* in, int movie_version); > + // read SWF::PLACEOBJECT2 or SWF::PLACEOBJECT3 > + void readPlaceObject2(stream* in, int movie_version, bool place_2); > > }; > > > > _______________________________________________ > Gnash-commit mailing list > Gnash-commit@gnu.org > http://lists.gnu.org/mailman/listinfo/gnash-commit > _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit