CVSROOT: /sources/gnash Module name: gnash Changes by: Sandro Santilli <strk> 07/04/06 09:56:01
Modified files: . : ChangeLog testsuite/misc-ming.all: Makefile.am Added files: testsuite/misc-ming.all: displaylist_depths_test.c Log message: * testsuite/misc-ming.all/: Makefile.am, displaylist_depths_test.c: Add a new interesting (failing) test showing that static characters and dynamic characters use a completely different range of depths !! CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.2796&r2=1.2797 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/Makefile.am?cvsroot=gnash&r1=1.88&r2=1.89 http://cvs.savannah.gnu.org/viewcvs/gnash/testsuite/misc-ming.all/displaylist_depths_test.c?cvsroot=gnash&rev=1.1 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.2796 retrieving revision 1.2797 diff -u -b -r1.2796 -r1.2797 --- ChangeLog 6 Apr 2007 09:23:20 -0000 1.2796 +++ ChangeLog 6 Apr 2007 09:56:00 -0000 1.2797 @@ -1,5 +1,9 @@ 2007-04-06 Sandro Santilli <[EMAIL PROTECTED]> + * testsuite/misc-ming.all/: Makefile.am, displaylist_depths_test.c: + Add a new interesting (failing) test showing that static characters + and dynamic characters use a completely different range + of depths !! * server/sprite_instance.cpp (sprite_get_depth): only convert depths to negative values for static clips. * testsuite/actionscript.all/MovieClip.as: add a couple of Index: testsuite/misc-ming.all/Makefile.am =================================================================== RCS file: /sources/gnash/gnash/testsuite/misc-ming.all/Makefile.am,v retrieving revision 1.88 retrieving revision 1.89 diff -u -b -r1.88 -r1.89 --- testsuite/misc-ming.all/Makefile.am 5 Apr 2007 08:52:46 -0000 1.88 +++ testsuite/misc-ming.all/Makefile.am 6 Apr 2007 09:56:00 -0000 1.89 @@ -77,6 +77,7 @@ move_object_test \ place_and_remove_object_test \ place_and_remove_object_insane_test \ + displaylist_depths_test \ attachMovieTest \ attachMovieTestRunner \ attachMovieLoopingTest \ @@ -136,6 +137,7 @@ action_execution_order_test6runner \ reverse_execute_PlaceObject2_test1runner \ reverse_execute_PlaceObject2_test2runner \ + displaylist_depths_testrunner \ $(NULL) if MAKESWF_SUPPORTS_PREBUILT_CLIPS @@ -354,6 +356,20 @@ sh $< -r5 $(top_builddir) place_and_remove_object_insane_test.swf > $@ chmod 755 $@ +displaylist_depths_test_SOURCES = \ + displaylist_depths_test.c \ + ming_utils.h \ + ming_utils.c \ + $(NULL) +displaylist_depths_test_LDADD = $(MING_LIBS) + +displaylist_depths_test.swf: displaylist_depths_test + ./displaylist_depths_test $(top_srcdir)/testsuite/media + +displaylist_depths_testrunner: $(srcdir)/../generic-testrunner.sh displaylist_depths_test.swf + sh $< -r5 $(top_builddir) displaylist_depths_test.swf > $@ + chmod 755 $@ + attachMovieTest_SOURCES = \ attachMovieTest.c \ ming_utils.h \ @@ -859,6 +875,7 @@ action_execution_order_test6runner \ reverse_execute_PlaceObject2_test1runner \ reverse_execute_PlaceObject2_test2runner \ + displaylist_depths_testrunner \ $(NULL) if MAKESWF_SUPPORTS_PREBUILT_CLIPS Index: testsuite/misc-ming.all/displaylist_depths_test.c =================================================================== RCS file: testsuite/misc-ming.all/displaylist_depths_test.c diff -N testsuite/misc-ming.all/displaylist_depths_test.c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ testsuite/misc-ming.all/displaylist_depths_test.c 6 Apr 2007 09:56:00 -0000 1.1 @@ -0,0 +1,116 @@ +/* + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +/* + * Sandro Santilli, [EMAIL PROTECTED] + * + * Test if dynamic and static objects at the same depth can coexist + * + * run as ./displaylist_depths_test + */ + +#include "ming_utils.h" + +#include <stdlib.h> +#include <stdio.h> +#include <ming.h> + +#define OUTPUT_VERSION 6 +#define OUTPUT_FILENAME "displaylist_depths_test.swf" + +static SWFMovieClip get_static_mc(void); + +SWFMovieClip +get_static_mc() +{ + SWFShape sh; + SWFMovieClip mc; + + sh = make_fill_square (0, 300, 60, 60, 255, 0, 0, 255, 0, 0); + mc = newSWFMovieClip(); + SWFMovieClip_add(mc, (SWFBlock)sh); + SWFMovieClip_nextFrame(mc); + + return mc; +} + + +int +main(int argc, char** argv) +{ + SWFMovie mo; + SWFMovieClip dejagnuclip; + SWFMovieClip mc1; + SWFDisplayItem it; + + const char *srcdir="."; + if ( argc>1 ) + srcdir=argv[1]; + else + { + //fprintf(stderr, "Usage: %s <mediadir>\n", argv[0]); + //return 1; + } + + Ming_init(); + mo = newSWFMovieWithVersion(OUTPUT_VERSION); + SWFMovie_setDimension(mo, 800, 600); + SWFMovie_setRate (mo, 12); + + dejagnuclip = get_dejagnu_clip((SWFBlock)get_default_font(srcdir), 10, 0, 0, 800, 600); + SWFMovie_add(mo, (SWFBlock)dejagnuclip); + SWFMovie_nextFrame(mo); // end of frame 1 + + + // Add a static red square at depth 3 + mc1 = get_static_mc(); + it = SWFMovie_add(mo, (SWFBlock)mc1); + SWFDisplayItem_setDepth(it, 3); + SWFDisplayItem_setName(it, "staticmc"); + SWFMovie_nextFrame(mo); // end of frame 2 + + // Create an (dynamic) green movieclip at depth 3 + add_actions(mo, "createEmptyMovieClip('dynamicmc', 3);" + "with (dynamicmc) {" + " lineStyle(1, 0x000000, 100);" + " beginFill(0x00FF00, 100);" + " moveTo(20, 320);" + " lineTo(80, 320);" + " lineTo(80, 380);" + " lineTo(20, 380);" + " lineTo(20, 320);" + "}"); + SWFMovie_nextFrame(mo); // end of frame 3 + + // Check that both exist + check_equals(mo, "typeof(staticmc)", "'movieclip'"); + check_equals(mo, "typeof(dynamicmc)", "'movieclip'"); + + // Check that the static one had been moved at negative depth ! + check_equals(mo, "staticmc.getDepth()", "-16381"); + check_equals(mo, "dynamicmc.getDepth()", "3"); + + add_actions(mo, "_root.totals(); stop();"); + SWFMovie_nextFrame(mo); + + //Output movie + puts("Saving " OUTPUT_FILENAME ); + SWFMovie_save(mo, OUTPUT_FILENAME); + + return 0; +} _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit