CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 08/01/07 11:44:10
Modified files: . : ChangeLog server : sprite_instance.cpp Log message: allow MovieClip.setMask to be called on any character, not just sprites. Fixes swfdec's image/mask-textfield-6.swf test (not automated). CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.5327&r2=1.5328 http://cvs.savannah.gnu.org/viewcvs/gnash/server/sprite_instance.cpp?cvsroot=gnash&r1=1.427&r2=1.428 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.5327 retrieving revision 1.5328 diff -u -b -r1.5327 -r1.5328 --- ChangeLog 7 Jan 2008 11:37:39 -0000 1.5327 +++ ChangeLog 7 Jan 2008 11:44:10 -0000 1.5328 @@ -1,3 +1,9 @@ +2008-01-07 Sandro Santilli <[EMAIL PROTECTED]> + + * server/sprite_instance.cpp (sprite_setMask): allow MovieClip.setMask + to be called on any character, not just sprites. Fixes + swfdec's image/mask-textfield-6.swf test (not automated). + 2008-01-07 Benjamin Wolsey <[EMAIL PROTECTED]> * gui/gtk.cpp: move fullscreen to View menu and give it a pretty icon, Index: server/sprite_instance.cpp =================================================================== RCS file: /sources/gnash/gnash/server/sprite_instance.cpp,v retrieving revision 1.427 retrieving revision 1.428 diff -u -b -r1.427 -r1.428 --- server/sprite_instance.cpp 4 Jan 2008 13:10:45 -0000 1.427 +++ server/sprite_instance.cpp 7 Jan 2008 11:44:10 -0000 1.428 @@ -1076,12 +1076,15 @@ static as_value sprite_setMask(const fn_call& fn) { - boost::intrusive_ptr<sprite_instance> sprite = ensureType<sprite_instance>(fn.this_ptr); + // swfdec/test/image/mask-textfield-6.swf shows that setMask should also + // work against TextFields, we have no tests for other character types so + // we generalize it for any character. + boost::intrusive_ptr<character> maskee = ensureType<character>(fn.this_ptr); if ( ! fn.nargs ) { IF_VERBOSE_ASCODING_ERRORS( - log_aserror(_("%s.setMask() : needs an argument"), sprite->getTarget().c_str()); + log_aserror(_("%s.setMask() : needs an argument"), maskee->getTarget().c_str()); ); return as_value(); } @@ -1090,24 +1093,24 @@ if ( arg.is_null() || arg.is_undefined() ) { // disable mask - sprite->setMask(NULL); + maskee->setMask(NULL); } else { boost::intrusive_ptr<as_object> obj ( arg.to_object() ); - character* ch = dynamic_cast<character*>(obj.get()); - if ( ! ch ) + character* mask = dynamic_cast<character*>(obj.get()); + if ( ! mask ) { IF_VERBOSE_ASCODING_ERRORS( log_aserror(_("%s.setMask(%s) : first argument is not a character"), - sprite->getTarget().c_str(), arg.to_debug_string().c_str()); + maskee->getTarget().c_str(), arg.to_debug_string().c_str()); ); return as_value(); } // ch is possibly NULL, which is intended - sprite->setMask(ch); + maskee->setMask(mask); } //log_debug("MovieClip.setMask() TESTING"); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit