[Swfdec-commits] 7 commits - swfdec/swfdec_movie.c swfdec/swfdec_sprite_movie_as.c swfdec/swfdec_text_field.c test/trace
Pekka Lampila
medar at kemper.freedesktop.org
Fri May 2 12:17:16 PDT 2008
swfdec/swfdec_movie.c | 2
swfdec/swfdec_sprite_movie_as.c | 9 +-
swfdec/swfdec_text_field.c | 10 ++
test/trace/Makefile.am | 27 ++++++
test/trace/movieclip-hittest-5.swf |binary
test/trace/movieclip-hittest-5.swf.trace | 9 ++
test/trace/movieclip-hittest-6.swf |binary
test/trace/movieclip-hittest-6.swf.trace | 15 +++
test/trace/movieclip-hittest-7.swf |binary
test/trace/movieclip-hittest-7.swf.trace | 15 +++
test/trace/movieclip-hittest-8.swf |binary
test/trace/movieclip-hittest-8.swf.trace | 15 +++
test/trace/movieclip-hittest-parent-5.swf |binary
test/trace/movieclip-hittest-parent-5.swf.trace | 34 ++++++++
test/trace/movieclip-hittest-parent-6.swf |binary
test/trace/movieclip-hittest-parent-6.swf.trace | 34 ++++++++
test/trace/movieclip-hittest-parent-7.swf |binary
test/trace/movieclip-hittest-parent-7.swf.trace | 34 ++++++++
test/trace/movieclip-hittest-parent-8.swf |binary
test/trace/movieclip-hittest-parent-8.swf.trace | 34 ++++++++
test/trace/movieclip-hittest-parent.as | 95 ++++++++++++++++++++++++
test/trace/movieclip-hittest-target-5.swf |binary
test/trace/movieclip-hittest-target-5.swf.trace | 3
test/trace/movieclip-hittest-target-6.swf |binary
test/trace/movieclip-hittest-target-6.swf.trace | 3
test/trace/movieclip-hittest-target-7.swf |binary
test/trace/movieclip-hittest-target-7.swf.trace | 3
test/trace/movieclip-hittest-target-8.swf |binary
test/trace/movieclip-hittest-target-8.swf.trace | 3
test/trace/movieclip-hittest-target.as | 24 ++++++
test/trace/movieclip-hittest.as | 54 +++++++++++++
31 files changed, 419 insertions(+), 4 deletions(-)
New commits:
commit fd6b0d51439700e18c8270ead0ff7427f2724cac
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 22:06:41 2008 +0300
Add a test for hitTest with child/parent movies
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index d4d761e..99ee381 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1765,6 +1765,15 @@ EXTRA_DIST = \
movieclip-hittest-7.swf.trace \
movieclip-hittest-8.swf \
movieclip-hittest-8.swf.trace \
+ movieclip-hittest-parent.as \
+ movieclip-hittest-parent-5.swf \
+ movieclip-hittest-parent-5.swf.trace \
+ movieclip-hittest-parent-6.swf \
+ movieclip-hittest-parent-6.swf.trace \
+ movieclip-hittest-parent-7.swf \
+ movieclip-hittest-parent-7.swf.trace \
+ movieclip-hittest-parent-8.swf \
+ movieclip-hittest-parent-8.swf.trace \
movieclip-hittest-target.as \
movieclip-hittest-target-5.swf \
movieclip-hittest-target-5.swf.trace \
diff --git a/test/trace/movieclip-hittest-parent-5.swf b/test/trace/movieclip-hittest-parent-5.swf
new file mode 100644
index 0000000..f5d75c0
Binary files /dev/null and b/test/trace/movieclip-hittest-parent-5.swf differ
diff --git a/test/trace/movieclip-hittest-parent-5.swf.trace b/test/trace/movieclip-hittest-parent-5.swf.trace
new file mode 100644
index 0000000..07ebf0a
--- /dev/null
+++ b/test/trace/movieclip-hittest-parent-5.swf.trace
@@ -0,0 +1,34 @@
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
diff --git a/test/trace/movieclip-hittest-parent-6.swf b/test/trace/movieclip-hittest-parent-6.swf
new file mode 100644
index 0000000..5468c71
Binary files /dev/null and b/test/trace/movieclip-hittest-parent-6.swf differ
diff --git a/test/trace/movieclip-hittest-parent-6.swf.trace b/test/trace/movieclip-hittest-parent-6.swf.trace
new file mode 100644
index 0000000..3a41405
--- /dev/null
+++ b/test/trace/movieclip-hittest-parent-6.swf.trace
@@ -0,0 +1,34 @@
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+false
+true
+true
+false
+true
diff --git a/test/trace/movieclip-hittest-parent-7.swf b/test/trace/movieclip-hittest-parent-7.swf
new file mode 100644
index 0000000..3e67461
Binary files /dev/null and b/test/trace/movieclip-hittest-parent-7.swf differ
diff --git a/test/trace/movieclip-hittest-parent-7.swf.trace b/test/trace/movieclip-hittest-parent-7.swf.trace
new file mode 100644
index 0000000..3a41405
--- /dev/null
+++ b/test/trace/movieclip-hittest-parent-7.swf.trace
@@ -0,0 +1,34 @@
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+false
+true
+true
+false
+true
diff --git a/test/trace/movieclip-hittest-parent-8.swf b/test/trace/movieclip-hittest-parent-8.swf
new file mode 100644
index 0000000..18b4175
Binary files /dev/null and b/test/trace/movieclip-hittest-parent-8.swf differ
diff --git a/test/trace/movieclip-hittest-parent-8.swf.trace b/test/trace/movieclip-hittest-parent-8.swf.trace
new file mode 100644
index 0000000..3a41405
--- /dev/null
+++ b/test/trace/movieclip-hittest-parent-8.swf.trace
@@ -0,0 +1,34 @@
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+false
+false
+true
+false
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+false
+true
+true
+false
+true
diff --git a/test/trace/movieclip-hittest-parent.as b/test/trace/movieclip-hittest-parent.as
new file mode 100644
index 0000000..6d58c38
--- /dev/null
+++ b/test/trace/movieclip-hittest-parent.as
@@ -0,0 +1,95 @@
+// makeswf -v 7 -s 200x150 -r 15 -o movieclip-hittest-parent-8.swf movieclip-hittest-parent-8.as
+
+this.createEmptyMovieClip ("a", 0);
+
+with (a) {
+ _x = 10;
+ _y = 10;
+ beginFill (0xFF0000);
+ moveTo (0, 0);
+ lineTo (25, 0);
+ lineTo (25, 25);
+ lineTo (0, 25);
+ lineTo (0, 0);
+ endFill ();
+}
+
+a.createEmptyMovieClip ("b", 0);
+with (a.b) {
+ _x = 20;
+ _y = 20;
+ beginFill (0x00FF00);
+ moveTo (0, 0);
+ lineTo (25, 0);
+ lineTo (25, 25);
+ lineTo (0, 25);
+ lineTo (0, 0);
+ endFill ();
+}
+
+a.b.createEmptyMovieClip ("c", 0);
+with (a.b.c) {
+ _x = 20;
+ _y = 20;
+ beginFill (0x0000FF);
+ moveTo (0, 0);
+ lineTo (25, 0);
+ lineTo (25, 25);
+ lineTo (0, 25);
+ lineTo (0, 0);
+ endFill ();
+}
+
+this.createEmptyMovieClip ("d", 1);
+
+with (d) {
+ _x = 10;
+ _y = 10;
+ beginFill (0xCCCCCC);
+ moveTo (10, 10);
+ lineTo (35, 10);
+ lineTo (35, 35);
+ lineTo (10, 35);
+ lineTo (10, 10);
+ endFill ();
+}
+
+trace (a.hitTest (5, 5, true));
+trace (a.hitTest (10, 10, true));
+trace (a.hitTest (15, 15, true));
+trace (a.hitTest (5, 5, false));
+trace (a.hitTest (10, 10, false));
+trace (a.hitTest (15, 15, false));
+
+trace (a.b.hitTest (25, 25, true));
+trace (a.b.hitTest (30, 30, true));
+trace (a.b.hitTest (35, 35, true));
+trace (a.b.hitTest (25, 25, false));
+trace (a.b.hitTest (30, 30, false));
+trace (a.b.hitTest (35, 35, false));
+
+trace (a.b.c.hitTest (45, 45, true));
+trace (a.b.c.hitTest (50, 50, true));
+trace (a.b.c.hitTest (55, 55, true));
+trace (a.b.c.hitTest (45, 45, false));
+trace (a.b.c.hitTest (50, 50, false));
+trace (a.b.c.hitTest (55, 55, false));
+
+trace (a.hitTest (a));
+trace (a.hitTest (a.b));
+trace (a.hitTest (a.b.c));
+trace (a.hitTest (d));
+trace (a.b.hitTest (a));
+trace (a.b.hitTest (a.b));
+trace (a.b.hitTest (a.b.c));
+trace (a.b.hitTest (d));
+trace (a.b.c.hitTest (a));
+trace (a.b.c.hitTest (a.b));
+trace (a.b.c.hitTest (a.b.c));
+trace (a.b.c.hitTest (d));
+trace (d.hitTest (a));
+trace (d.hitTest (a.b));
+trace (d.hitTest (a.b.c));
+trace (d.hitTest (d));
+
+getURL ("fscommand:quit", "");
commit 6d468441c836d683144ce6ca9ec376a3d096727f
Merge: f2356bc... 59c14f2...
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 21:47:18 2008 +0300
Merge commit '59c14f247851378067f1c7987b3438d3cbd932f2'
Conflicts:
swfdec/swfdec_sprite_movie_as.c
diff --cc swfdec/swfdec_sprite_movie_as.c
index 6d10e95,f24ee37..da8e367
--- a/swfdec/swfdec_sprite_movie_as.c
+++ b/swfdec/swfdec_sprite_movie_as.c
@@@ -545,12 -546,13 +546,14 @@@ swfdec_sprite_movie_hitTest (SwfdecAsCo
y = swfdec_as_value_to_number (cx, &argv[1]) * SWFDEC_TWIPS_SCALE_FACTOR;
shape = (argc >= 3 && swfdec_as_value_to_boolean (cx, &argv[2]));
- swfdec_movie_global_to_local (movie, &x, &y);
-
if (shape) {
+ if (movie->parent)
+ swfdec_movie_global_to_local (movie->parent, &x, &y);
ret = swfdec_movie_contains (movie, x, y);
} else {
+ if (movie->cache_state >= SWFDEC_MOVIE_INVALID_EXTENTS)
+ swfdec_movie_update (movie);
+ swfdec_movie_global_to_local (movie, &x, &y);
ret = swfdec_rect_contains (&movie->original_extents, x, y);
}
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, ret);
commit 59c14f247851378067f1c7987b3438d3cbd932f2
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 20:54:11 2008 +0300
Parse font_class from EditText tags. It's not actually used yet though
diff --git a/swfdec/swfdec_text_field.c b/swfdec/swfdec_text_field.c
index 19304ea..9d6285a 100644
--- a/swfdec/swfdec_text_field.c
+++ b/swfdec/swfdec_text_field.c
@@ -108,6 +108,7 @@ tag_func_define_edit_text (SwfdecSwfDecoder * s, guint tag)
guint id;
int reserved;
gboolean has_font, has_color, has_max_length, has_layout, has_text;
+ gboolean has_font_class;
SwfdecBits *b = &s->b;
id = swfdec_bits_get_u16 (b);
@@ -130,7 +131,7 @@ tag_func_define_edit_text (SwfdecSwfDecoder * s, guint tag)
has_color = swfdec_bits_getbit (b);
has_max_length = swfdec_bits_getbit (b);
has_font = swfdec_bits_getbit (b);
- reserved = swfdec_bits_getbit (b);
+ has_font_class = swfdec_bits_getbit (b);
text->auto_size =
(swfdec_bits_getbit (b) ? SWFDEC_AUTO_SIZE_LEFT : SWFDEC_AUTO_SIZE_NONE);
has_layout = swfdec_bits_getbit (b);
@@ -157,6 +158,13 @@ tag_func_define_edit_text (SwfdecSwfDecoder * s, guint tag)
SWFDEC_LOG (" size = %u", text->size);
}
+ if (has_font_class) {
+ SWFDEC_FIXME ("Implement font_class for EditText");
+ if (has_font)
+ SWFDEC_FIXME ("What to do if both font and font class are defined?");
+ swfdec_bits_get_string (b, s->version);
+ }
+
if (has_color) {
text->color = swfdec_bits_get_rgba (b);
SWFDEC_LOG (" color = %u", text->color);
commit de74381956a0f7893e74c4639052ce913cab3821
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 20:52:54 2008 +0300
Add a test for MovieClip's hitTest method
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index a29bc60..d4d761e 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1756,6 +1756,15 @@ EXTRA_DIST = \
movieclip-get-instance-at-depth-7.swf.trace \
movieclip-get-instance-at-depth-8.swf \
movieclip-get-instance-at-depth-8.swf.trace \
+ movieclip-hittest.as \
+ movieclip-hittest-5.swf \
+ movieclip-hittest-5.swf.trace \
+ movieclip-hittest-6.swf \
+ movieclip-hittest-6.swf.trace \
+ movieclip-hittest-7.swf \
+ movieclip-hittest-7.swf.trace \
+ movieclip-hittest-8.swf \
+ movieclip-hittest-8.swf.trace \
movieclip-hittest-target.as \
movieclip-hittest-target-5.swf \
movieclip-hittest-target-5.swf.trace \
diff --git a/test/trace/movieclip-hittest-5.swf b/test/trace/movieclip-hittest-5.swf
new file mode 100644
index 0000000..21203da
Binary files /dev/null and b/test/trace/movieclip-hittest-5.swf differ
diff --git a/test/trace/movieclip-hittest-5.swf.trace b/test/trace/movieclip-hittest-5.swf.trace
new file mode 100644
index 0000000..ae2b9fe
--- /dev/null
+++ b/test/trace/movieclip-hittest-5.swf.trace
@@ -0,0 +1,9 @@
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
+undefined
diff --git a/test/trace/movieclip-hittest-6.swf b/test/trace/movieclip-hittest-6.swf
new file mode 100644
index 0000000..0a5f6e6
Binary files /dev/null and b/test/trace/movieclip-hittest-6.swf differ
diff --git a/test/trace/movieclip-hittest-6.swf.trace b/test/trace/movieclip-hittest-6.swf.trace
new file mode 100644
index 0000000..4474e60
--- /dev/null
+++ b/test/trace/movieclip-hittest-6.swf.trace
@@ -0,0 +1,15 @@
+false
+false
+true
+false
+true
+true
+true
+true
+false
+true
+true
+true
+false
+true
+true
diff --git a/test/trace/movieclip-hittest-7.swf b/test/trace/movieclip-hittest-7.swf
new file mode 100644
index 0000000..29b9d33
Binary files /dev/null and b/test/trace/movieclip-hittest-7.swf differ
diff --git a/test/trace/movieclip-hittest-7.swf.trace b/test/trace/movieclip-hittest-7.swf.trace
new file mode 100644
index 0000000..4474e60
--- /dev/null
+++ b/test/trace/movieclip-hittest-7.swf.trace
@@ -0,0 +1,15 @@
+false
+false
+true
+false
+true
+true
+true
+true
+false
+true
+true
+true
+false
+true
+true
diff --git a/test/trace/movieclip-hittest-8.swf b/test/trace/movieclip-hittest-8.swf
new file mode 100644
index 0000000..ad41554
Binary files /dev/null and b/test/trace/movieclip-hittest-8.swf differ
diff --git a/test/trace/movieclip-hittest-8.swf.trace b/test/trace/movieclip-hittest-8.swf.trace
new file mode 100644
index 0000000..4474e60
--- /dev/null
+++ b/test/trace/movieclip-hittest-8.swf.trace
@@ -0,0 +1,15 @@
+false
+false
+true
+false
+true
+true
+true
+true
+false
+true
+true
+true
+false
+true
+true
diff --git a/test/trace/movieclip-hittest.as b/test/trace/movieclip-hittest.as
new file mode 100644
index 0000000..2e31968
--- /dev/null
+++ b/test/trace/movieclip-hittest.as
@@ -0,0 +1,54 @@
+// makeswf -v 7 -s 200x150 -r 15 -o movieclip-hittest-8.swf movieclip-hittest-8.as
+
+this.createEmptyMovieClip ("a", 0);
+
+with (a) {
+ beginFill (0xFF0000);
+ moveTo (10, 10);
+ lineTo (50, 10);
+ lineTo (50, 50);
+ lineTo (10, 50);
+ lineTo (10, 10);
+ endFill ();
+
+ trace (hitTest (5, 5, true));
+ trace (hitTest (10, 10, true));
+ trace (hitTest (15, 15, true));
+ trace (hitTest (5, 5, false));
+ trace (hitTest (10, 10, false));
+ trace (hitTest (15, 15, false));
+}
+
+this.createEmptyMovieClip ("b", 1);
+with (b) {
+ beginFill (0x00FF00);
+ moveTo (30, 30);
+ lineTo (70, 30);
+ lineTo (70, 70);
+ lineTo (30, 70);
+ lineTo (30, 30);
+ endFill ();
+}
+
+this.createEmptyMovieClip ("c", 2);
+with (c) {
+ beginFill (0x0000FF);
+ moveTo (60, 60);
+ lineTo (100, 60);
+ lineTo (100, 100);
+ lineTo (60, 100);
+ lineTo (60, 60);
+ endFill ();
+}
+
+trace (a.hitTest (a));
+trace (a.hitTest (b));
+trace (a.hitTest (c));
+trace (b.hitTest (a));
+trace (b.hitTest (b));
+trace (b.hitTest (c));
+trace (c.hitTest (a));
+trace (c.hitTest (b));
+trace (c.hitTest (c));
+
+getURL ("fscommand:quit", "");
commit 8333c90e537b4a5c1b1d3fc8d8d427af6ef56822
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 20:49:53 2008 +0300
Add a test to see how the target parameter in hitTest is handled
diff --git a/test/trace/Makefile.am b/test/trace/Makefile.am
index 36b7c9e..a29bc60 100644
--- a/test/trace/Makefile.am
+++ b/test/trace/Makefile.am
@@ -1756,6 +1756,15 @@ EXTRA_DIST = \
movieclip-get-instance-at-depth-7.swf.trace \
movieclip-get-instance-at-depth-8.swf \
movieclip-get-instance-at-depth-8.swf.trace \
+ movieclip-hittest-target.as \
+ movieclip-hittest-target-5.swf \
+ movieclip-hittest-target-5.swf.trace \
+ movieclip-hittest-target-6.swf \
+ movieclip-hittest-target-6.swf.trace \
+ movieclip-hittest-target-7.swf \
+ movieclip-hittest-target-7.swf.trace \
+ movieclip-hittest-target-8.swf \
+ movieclip-hittest-target-8.swf.trace \
movieclip-lockroot.as \
movieclip-lockroot-5.swf \
movieclip-lockroot-5.swf.trace \
diff --git a/test/trace/movieclip-hittest-target-5.swf b/test/trace/movieclip-hittest-target-5.swf
new file mode 100644
index 0000000..1c1a70d
Binary files /dev/null and b/test/trace/movieclip-hittest-target-5.swf differ
diff --git a/test/trace/movieclip-hittest-target-5.swf.trace b/test/trace/movieclip-hittest-target-5.swf.trace
new file mode 100644
index 0000000..05a71fa
--- /dev/null
+++ b/test/trace/movieclip-hittest-target-5.swf.trace
@@ -0,0 +1,3 @@
+Test whether target parameter can be a string
+undefined
+undefined
diff --git a/test/trace/movieclip-hittest-target-6.swf b/test/trace/movieclip-hittest-target-6.swf
new file mode 100644
index 0000000..bc5e212
Binary files /dev/null and b/test/trace/movieclip-hittest-target-6.swf differ
diff --git a/test/trace/movieclip-hittest-target-6.swf.trace b/test/trace/movieclip-hittest-target-6.swf.trace
new file mode 100644
index 0000000..20363c7
--- /dev/null
+++ b/test/trace/movieclip-hittest-target-6.swf.trace
@@ -0,0 +1,3 @@
+Test whether target parameter can be a string
+true
+false
diff --git a/test/trace/movieclip-hittest-target-7.swf b/test/trace/movieclip-hittest-target-7.swf
new file mode 100644
index 0000000..657d0da
Binary files /dev/null and b/test/trace/movieclip-hittest-target-7.swf differ
diff --git a/test/trace/movieclip-hittest-target-7.swf.trace b/test/trace/movieclip-hittest-target-7.swf.trace
new file mode 100644
index 0000000..20363c7
--- /dev/null
+++ b/test/trace/movieclip-hittest-target-7.swf.trace
@@ -0,0 +1,3 @@
+Test whether target parameter can be a string
+true
+false
diff --git a/test/trace/movieclip-hittest-target-8.swf b/test/trace/movieclip-hittest-target-8.swf
new file mode 100644
index 0000000..65d4320
Binary files /dev/null and b/test/trace/movieclip-hittest-target-8.swf differ
diff --git a/test/trace/movieclip-hittest-target-8.swf.trace b/test/trace/movieclip-hittest-target-8.swf.trace
new file mode 100644
index 0000000..20363c7
--- /dev/null
+++ b/test/trace/movieclip-hittest-target-8.swf.trace
@@ -0,0 +1,3 @@
+Test whether target parameter can be a string
+true
+false
diff --git a/test/trace/movieclip-hittest-target.as b/test/trace/movieclip-hittest-target.as
new file mode 100644
index 0000000..4e586cd
--- /dev/null
+++ b/test/trace/movieclip-hittest-target.as
@@ -0,0 +1,24 @@
+// makeswf -v 7 -s 200x150 -r 15 -o movieclip-hittest-target-8.swf movieclip-hittest-target-8.as
+
+function fill (movie) {
+ with (movie) {
+ beginFill (0xFF0000);
+ moveTo (10, 10);
+ lineTo (50, 10);
+ lineTo (50, 50);
+ lineTo (10, 50);
+ lineTo (10, 10);
+ endFill ();
+ }
+}
+
+this.createEmptyMovieClip ("a", 0);
+fill (a);
+this.createEmptyMovieClip ("b", 1);
+fill (b);
+
+trace ("Test whether target parameter can be a string");
+trace (a.hitTest (b));
+trace (a.hitTest ("b"));
+
+getURL ("fscommand:quit", "");
commit ef01a5e76d9b4c90869404f479b7fc025fac1bee
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 20:45:44 2008 +0300
Don't use swfdec_player_get_movie_from_value in hitTest, just use the value
diff --git a/swfdec/swfdec_sprite_movie_as.c b/swfdec/swfdec_sprite_movie_as.c
index 76c86ad..f24ee37 100644
--- a/swfdec/swfdec_sprite_movie_as.c
+++ b/swfdec/swfdec_sprite_movie_as.c
@@ -517,17 +517,18 @@ swfdec_sprite_movie_hitTest (SwfdecAsContext *cx, SwfdecAsObject *object,
{
SwfdecMovie *movie;
- SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, (gpointer)&movie, "");
+ SWFDEC_AS_CHECK (SWFDEC_TYPE_MOVIE, &movie, "");
if (argc == 1) {
SwfdecMovie *other;
SwfdecRect movie_rect, other_rect;
- other = swfdec_player_get_movie_from_value (SWFDEC_PLAYER (cx), &argv[0]);
- if (other == NULL) {
+ if (!SWFDEC_AS_VALUE_IS_OBJECT (&argv[0]) ||
+ !SWFDEC_IS_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&argv[0]))) {
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, FALSE);
return;
}
+ other = SWFDEC_MOVIE (SWFDEC_AS_VALUE_GET_OBJECT (&argv[0]));
swfdec_movie_update (movie);
swfdec_movie_update (other);
movie_rect = movie->extents;
commit 46a8344ef2b0b22168ec413c73c800f8da85f09c
Author: Pekka Lampila <pekka.lampila at iki.fi>
Date: Fri May 2 20:23:07 2008 +0300
Add missing movie updates to hitTest and swfdec_movie_get_movie_at
diff --git a/swfdec/swfdec_movie.c b/swfdec/swfdec_movie.c
index acb971a..48eb40b 100644
--- a/swfdec/swfdec_movie.c
+++ b/swfdec/swfdec_movie.c
@@ -612,6 +612,8 @@ swfdec_movie_get_movie_at (SwfdecMovie *movie, double x, double y, gboolean even
g_return_val_if_fail (SWFDEC_IS_MOVIE (movie), NULL);
SWFDEC_LOG ("%s %p getting mouse at: %g %g", G_OBJECT_TYPE_NAME (movie), movie, x, y);
+ if (movie->cache_state >= SWFDEC_MOVIE_INVALID_EXTENTS)
+ swfdec_movie_update (movie);
if (!swfdec_rect_contains (&movie->extents, x, y)) {
return NULL;
}
diff --git a/swfdec/swfdec_sprite_movie_as.c b/swfdec/swfdec_sprite_movie_as.c
index 3644d51..76c86ad 100644
--- a/swfdec/swfdec_sprite_movie_as.c
+++ b/swfdec/swfdec_sprite_movie_as.c
@@ -550,6 +550,8 @@ swfdec_sprite_movie_hitTest (SwfdecAsContext *cx, SwfdecAsObject *object,
if (shape) {
ret = swfdec_movie_contains (movie, x, y);
} else {
+ if (movie->cache_state >= SWFDEC_MOVIE_INVALID_EXTENTS)
+ swfdec_movie_update (movie);
ret = swfdec_rect_contains (&movie->original_extents, x, y);
}
SWFDEC_AS_VALUE_SET_BOOLEAN (rval, ret);
More information about the Swfdec-commits
mailing list