[Swfdec] Branch 'vivi' - 2 commits - libswfdec/swfdec_movie.c test/trace

Benjamin Otte company at kemper.freedesktop.org
Tue Aug 21 23:50:27 PDT 2007


 libswfdec/swfdec_movie.c             |    2 +-
 test/trace/Makefile.am               |    9 +++++++++
 test/trace/remove-depths-5.swf       |binary
 test/trace/remove-depths-5.swf.trace |    1 +
 test/trace/remove-depths-6.swf       |binary
 test/trace/remove-depths-6.swf.trace |    3 +++
 test/trace/remove-depths-7.swf       |binary
 test/trace/remove-depths-7.swf.trace |    3 +++
 test/trace/remove-depths-8.swf       |binary
 test/trace/remove-depths-8.swf.trace |    3 +++
 test/trace/remove-depths.as          |   15 +++++++++++++++
 11 files changed, 35 insertions(+), 1 deletion(-)

New commits:
diff-tree f21416fa0be5658c7e88bc2e57d77eacd369ff85 (from 3bd9ef83c764e80467cb95163ad7f7a779100d45)
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Aug 22 08:50:12 2007 +0200

    add test for depth when removing

diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 6d0d774..aec7f1d 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -859,6 +859,15 @@ EXTRA_DIST = \
 	relational-6.swf.trace \
 	relational-7.swf \
 	relational-7.swf.trace \
+	remove-depths.as \
+	remove-depths-5.swf \
+	remove-depths-5.swf.trace \
+	remove-depths-6.swf \
+	remove-depths-6.swf.trace \
+	remove-depths-7.swf \
+	remove-depths-7.swf.trace \
+	remove-depths-8.swf \
+	remove-depths-8.swf.trace \
 	removesprite-depths.as \
 	removesprite-depths-5.swf \
 	removesprite-depths-5.swf.trace \
diff --git a/test/trace/remove-depths-5.swf b/test/trace/remove-depths-5.swf
new file mode 100644
index 0000000..d684bb9
Binary files /dev/null and b/test/trace/remove-depths-5.swf differ
diff --git a/test/trace/remove-depths-5.swf.trace b/test/trace/remove-depths-5.swf.trace
new file mode 100644
index 0000000..cdb6e9c
--- /dev/null
+++ b/test/trace/remove-depths-5.swf.trace
@@ -0,0 +1 @@
+Check how removing movieclips affects depth
diff --git a/test/trace/remove-depths-6.swf b/test/trace/remove-depths-6.swf
new file mode 100644
index 0000000..7545fbd
Binary files /dev/null and b/test/trace/remove-depths-6.swf differ
diff --git a/test/trace/remove-depths-6.swf.trace b/test/trace/remove-depths-6.swf.trace
new file mode 100644
index 0000000..e1b6d8b
--- /dev/null
+++ b/test/trace/remove-depths-6.swf.trace
@@ -0,0 +1,3 @@
+Check how removing movieclips affects depth
+0 => -32769
+1000 => -33769
diff --git a/test/trace/remove-depths-7.swf b/test/trace/remove-depths-7.swf
new file mode 100644
index 0000000..6bf4802
Binary files /dev/null and b/test/trace/remove-depths-7.swf differ
diff --git a/test/trace/remove-depths-7.swf.trace b/test/trace/remove-depths-7.swf.trace
new file mode 100644
index 0000000..e1b6d8b
--- /dev/null
+++ b/test/trace/remove-depths-7.swf.trace
@@ -0,0 +1,3 @@
+Check how removing movieclips affects depth
+0 => -32769
+1000 => -33769
diff --git a/test/trace/remove-depths-8.swf b/test/trace/remove-depths-8.swf
new file mode 100644
index 0000000..f0208da
Binary files /dev/null and b/test/trace/remove-depths-8.swf differ
diff --git a/test/trace/remove-depths-8.swf.trace b/test/trace/remove-depths-8.swf.trace
new file mode 100644
index 0000000..e1b6d8b
--- /dev/null
+++ b/test/trace/remove-depths-8.swf.trace
@@ -0,0 +1,3 @@
+Check how removing movieclips affects depth
+0 => -32769
+1000 => -33769
diff --git a/test/trace/remove-depths.as b/test/trace/remove-depths.as
new file mode 100644
index 0000000..562bdbf
--- /dev/null
+++ b/test/trace/remove-depths.as
@@ -0,0 +1,15 @@
+// makeswf -v 7 -s 200x150 -r 1 -o remove-depths.swf remove-depths.as
+
+depths = [ 0, -16384, -16385, 1000 ];
+for (i = 0; i < depths.length; i++) {
+  bla = createEmptyMovieClip ("foo" + i, depths[i]);
+  bla.depth = bla.getDepth ();
+  bla.onUnload = function () {
+    trace (this.depth + " => " + this.getDepth ());
+  };
+  bla.removeMovieClip ();
+}
+// We print that here so we know the onUnload gets triggered later
+trace ("Check how removing movieclips affects depth");
+
+loadMovie ("FSCommand:quit", "");
diff-tree 3bd9ef83c764e80467cb95163ad7f7a779100d45 (from cd4771d4b96dc96212d69810b22724d076d3a283)
Author: Benjamin Otte <otte at gnome.org>
Date:   Wed Aug 22 08:49:15 2007 +0200

    set the correct depth on remove

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 6a03bd1..0f3cb91 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -260,7 +260,7 @@ swfdec_movie_do_remove (SwfdecMovie *mov
   if (player->mouse_drag == movie)
     player->mouse_drag = NULL;
   swfdec_movie_invalidate (movie);
-  swfdec_movie_set_depth (movie, -16385 - movie->depth); /* don't ask me why... */
+  swfdec_movie_set_depth (movie, -32769 - movie->depth); /* don't ask me why... */
 
   if (SWFDEC_IS_SPRITE_MOVIE (movie))
     return !swfdec_movie_queue_script (movie, SWFDEC_EVENT_UNLOAD);


More information about the Swfdec mailing list