CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/09/17 23:33:18
Modified files: . : ChangeLog server/parser : movie_def_impl.cpp movie_def_impl.h movie_definition.h sprite_definition.h server/swf : DoActionTag.h testsuite/misc-swfc.all: movieclip_destruction_test1.sc Log message: * server/swf/DoActionTag.h (doInitActionLoader): pass 'cid' value to add_init_action(). * server/parser/movie_definition.h (add_init_action): add support for a 'cir' parameter, to ignore duplicated init actions for the same character id. * server/parser/sprite_definition.h: update add_init_action signature * server/parser/movie_def_impl.{cpp,h}: update add_init_action signature, use a std::set to keep note of character id for which init actions have been added already, discarding the rest. * testsuite/misc-swfc.all/movieclip_destruction_test1.sc: more successes. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4336&r2=1.4337 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.cpp?cvsroot=gnash&r1=1.81&r2=1.82 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_def_impl.h?cvsroot=gnash&r1=1.53&r2=1.54 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/movie_definition.h?cvsroot=gnash&r1=1.30&r2=1.31 http://cvs.savannah.gnu.org/viewcvs/gnash/server/parser/sprite_definition.h?cvsroot=gnash&r1=1.29&r2=1.30 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/DoActionTag.h?cvsroot=gnash&r1=1.4&r2=1.5 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-swfc.all/movieclip_destruction_test1.sc?cvsroot=gnash&r1=1.14&r2=1.15 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4336 retrieving revision 1.4337 diff -u -b -r1.4336 -r1.4337 --- ChangeLog 17 Sep 2007 22:54:50 -0000 1.4336 +++ ChangeLog 17 Sep 2007 23:33:18 -0000 1.4337 @@ -1,5 +1,19 @@ 2007-09-18 Sandro Santilli <[EMAIL PROTECTED]> + * server/swf/DoActionTag.h (doInitActionLoader): pass 'cid' value + to add_init_action(). + * server/parser/movie_definition.h (add_init_action): add support for + a 'cir' parameter, to ignore duplicated init actions for the same + character id. + * server/parser/sprite_definition.h: update add_init_action signature + * server/parser/movie_def_impl.{cpp,h}: update add_init_action + signature, use a std::set to keep note of character id for which + init actions have been added already, discarding the rest. + * testsuite/misc-swfc.all/movieclip_destruction_test1.sc: more + successes. + +2007-09-18 Sandro Santilli <[EMAIL PROTECTED]> + * testsuite/misc-swfc.all/movieclip_destruction_test1.sc: Add test to verify init actions have been executed in the correct order. Index: server/parser/movie_def_impl.cpp =================================================================== RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -b -r1.81 -r1.82 --- server/parser/movie_def_impl.cpp 17 Sep 2007 12:21:47 -0000 1.81 +++ server/parser/movie_def_impl.cpp 17 Sep 2007 23:33:18 -0000 1.82 @@ -1179,4 +1179,14 @@ } #endif // GNASH_USE_GC +void +movie_def_impl::add_init_action(execute_tag* e, int cid) +{ + assert(e); + if ( m_init_action_defined.insert(cid).second ) + { + m_init_action_list[_frames_loaded].push_back(e); + } +} + } // namespace gnash Index: server/parser/movie_def_impl.h =================================================================== RCS file: /sources/gnash/gnash/server/parser/movie_def_impl.h,v retrieving revision 1.53 retrieving revision 1.54 diff -u -b -r1.53 -r1.54 --- server/parser/movie_def_impl.h 17 Sep 2007 12:21:47 -0000 1.53 +++ server/parser/movie_def_impl.h 17 Sep 2007 23:33:18 -0000 1.54 @@ -216,6 +216,7 @@ /// Init actions for each frame. PlayListMap m_init_action_list; + std::set<int> m_init_action_defined; /// 0-based frame #'s typedef std::map<std::string, size_t> NamedFrameMap; @@ -484,11 +485,7 @@ /// Need to execute the given tag before entering the /// currently-loading frame for the first time. - void add_init_action(execute_tag* e) - { - assert(e); - m_init_action_list[_frames_loaded].push_back(e); - } + void add_init_action(execute_tag* e, int cid); // See dox in movie_definition.h void add_frame_name(const std::string& name); Index: server/parser/movie_definition.h =================================================================== RCS file: /sources/gnash/gnash/server/parser/movie_definition.h,v retrieving revision 1.30 retrieving revision 1.31 diff -u -b -r1.30 -r1.31 --- server/parser/movie_definition.h 17 Sep 2007 12:21:47 -0000 1.30 +++ server/parser/movie_definition.h 17 Sep 2007 23:33:18 -0000 1.31 @@ -353,11 +353,13 @@ { } + /// \brief /// Add an init action to the frame currently being loaded + /// and the specified character id // /// The default implementation is a no-op. /// - virtual void add_init_action(execute_tag* /*c*/) + virtual void add_init_action(execute_tag* /*c*/, int /*cid*/) { } Index: server/parser/sprite_definition.h =================================================================== RCS file: /sources/gnash/gnash/server/parser/sprite_definition.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- server/parser/sprite_definition.h 17 Sep 2007 12:21:47 -0000 1.29 +++ server/parser/sprite_definition.h 17 Sep 2007 23:33:18 -0000 1.30 @@ -303,7 +303,7 @@ /// Overridden just for complaining about malformed SWF // /// Sprite def's should not have do_init_action tags in them! (@@ correct?) - virtual void add_init_action(execute_tag* /*c*/) + virtual void add_init_action(execute_tag* /*c*/, int /*cid*/) { IF_VERBOSE_MALFORMED_SWF ( log_swferror(_("sprite_definition::add_init_action called! Ignored")); Index: server/swf/DoActionTag.h =================================================================== RCS file: /sources/gnash/gnash/server/swf/DoActionTag.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- server/swf/DoActionTag.h 4 Sep 2007 20:50:00 -0000 1.4 +++ server/swf/DoActionTag.h 17 Sep 2007 23:33:18 -0000 1.5 @@ -19,7 +19,7 @@ // // -/* $Id: DoActionTag.h,v 1.4 2007/09/04 20:50:00 strk Exp $ */ +/* $Id: DoActionTag.h,v 1.5 2007/09/17 23:33:18 strk Exp $ */ #ifndef GNASH_SWF_DOACTIONTAG_H #define GNASH_SWF_DOACTIONTAG_H @@ -99,7 +99,6 @@ { DoActionTag* da = new DoActionTag(true); int cid = in->read_u16(); - UNUSED(cid); da->read(in); IF_VERBOSE_PARSE ( @@ -107,7 +106,7 @@ log_parse(_(" -- init actions for sprite %d"), cid); ); - m->add_init_action(da); // ownership transferred + m->add_init_action(da, cid); // ownership transferred } private: Index: testsuite/misc-swfc.all/movieclip_destruction_test1.sc =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-swfc.all/movieclip_destruction_test1.sc,v retrieving revision 1.14 retrieving revision 1.15 diff -u -b -r1.14 -r1.15 --- testsuite/misc-swfc.all/movieclip_destruction_test1.sc 17 Sep 2007 22:54:51 -0000 1.14 +++ testsuite/misc-swfc.all/movieclip_destruction_test1.sc 17 Sep 2007 23:33:18 -0000 1.15 @@ -235,7 +235,7 @@ // This check should not be executed. // We should ignore the second init actions for the same sprite. // It is here just for detecting some bogus implementation - _root.xcheck_equals(x, 1); + _root.check_equals(x, 1); .end @@ -254,7 +254,7 @@ .end .action: - _root.xcheck_equals(initActionExecuted, "mc2, mc3, mc61, mc6, mc8"); + _root.check_equals(initActionExecuted, "mc2, mc3, mc61, mc6, mc8"); stop(); totals(); .end _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit