[Swfdec] Branch 'as' - 7 commits - libswfdec/swfdec_movie.c libswfdec/swfdec_player.c libswfdec/swfdec_sprite_movie.c libswfdec/swfdec_tag.c player/Makefile.am

Benjamin Otte company at kemper.freedesktop.org
Thu Jun 14 05:07:49 PDT 2007


 libswfdec/swfdec_movie.c        |   14 +++++++++++---
 libswfdec/swfdec_player.c       |    1 +
 libswfdec/swfdec_sprite_movie.c |    4 ++--
 libswfdec/swfdec_tag.c          |    3 +++
 player/Makefile.am              |    4 ++--
 5 files changed, 19 insertions(+), 7 deletions(-)

New commits:
diff-tree 228be8a9445d25e41ecd7a09102c85609ec81ad7 (from 361883eb263c60510a743ad9e419d263bc898ac8)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 14:07:07 2007 +0200

    mark a dragged movie as modified so its position doesn;t get reset all the time

diff --git a/libswfdec/swfdec_player.c b/libswfdec/swfdec_player.c
index 038b5d4..bcc3952 100644
--- a/libswfdec/swfdec_player.c
+++ b/libswfdec/swfdec_player.c
@@ -500,6 +500,7 @@ swfdec_player_set_drag_movie (SwfdecPlay
   /* FIXME: need a way to make sure we get updated */
   if (drag) {
     swfdec_movie_update (drag);
+    drag->modified = TRUE;
     swfdec_player_update_drag_movie (player);
   }
 }
diff-tree 361883eb263c60510a743ad9e419d263bc898ac8 (from c80a83a1441bb9b02208a385813bd5ca2daee0e7)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 13:42:07 2007 +0200

    only copy x0 and y0 on unmodified movies

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 0a0056c..be3e877 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -138,7 +138,15 @@ swfdec_movie_update_matrix (SwfdecMovie 
 {
   double d, e;
 
-  movie->matrix = movie->original_transform;
+  /* we operate on x0 and y0 when setting movie._x and movie._y */
+  if (movie->modified) {
+    movie->matrix.xx = movie->original_transform.xx;
+    movie->matrix.yx = movie->original_transform.yx;
+    movie->matrix.xy = movie->original_transform.xy;
+    movie->matrix.yy = movie->original_transform.yy;
+  } else {
+    movie->matrix = movie->original_transform;
+  }
 
   d = movie->xscale / swfdec_matrix_get_xscale (&movie->original_transform);
   e = movie->yscale / swfdec_matrix_get_yscale (&movie->original_transform);
@@ -714,7 +722,7 @@ swfdec_movie_dispose (GObject *object)
 
   g_assert (movie->list == NULL);
 
-  SWFDEC_LOG ("disposing movie %s", movie->name);
+  SWFDEC_LOG ("disposing movie %s (depth %d)", movie->name, movie->depth);
   if (movie->swf) {
     g_object_unref (movie->swf);
     movie->swf = NULL;
diff-tree c80a83a1441bb9b02208a385813bd5ca2daee0e7 (from c9f2ca49fc68171b9c26bc320b368008b0a6cdfc)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 13:40:27 2007 +0200

    set the depth before using it, not after

diff --git a/libswfdec/swfdec_movie.c b/libswfdec/swfdec_movie.c
index 361f68d..0a0056c 100644
--- a/libswfdec/swfdec_movie.c
+++ b/libswfdec/swfdec_movie.c
@@ -896,6 +896,7 @@ swfdec_movie_new (SwfdecPlayer *player, 
     SWFDEC_AS_OBJECT (movie)->context = SWFDEC_AS_CONTEXT (player);
   }
   /* set essential properties */
+  movie->depth = depth;
   movie->parent = parent;
   if (parent) {
     movie->swf = g_object_ref (parent->swf);
@@ -905,7 +906,6 @@ swfdec_movie_new (SwfdecPlayer *player, 
   } else {
     player->roots = g_list_insert_sorted (player->roots, movie, swfdec_movie_compare_depths);
   }
-  movie->depth = depth;
   /* set its name */
   if (name) {
     movie->original_name = name;
diff-tree c9f2ca49fc68171b9c26bc320b368008b0a6cdfc (from 21a41f6fd163e5630112765f90af019cf2b55535)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 13:38:03 2007 +0200

    set the properties on the child not on ourselves (d'oh)

diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index da8dad4..3fc00f3 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -86,7 +86,7 @@ swfdec_sprite_movie_perform_one_action (
       child = swfdec_movie_find (mov, content->depth);
       if (child != NULL) {
 	/* FIXME: add ability to change characters - This needs lots of refactoring */
-	swfdec_movie_set_static_properties (movie, content->has_transform ? &content->transform : NULL,
+	swfdec_movie_set_static_properties (child, content->has_transform ? &content->transform : NULL,
 	    content->has_color_transform ? &content->color_transform : NULL, 
 	    content->ratio, content->clip_depth, content->events);
 	if (content->name && !g_str_equal (content->name, child->name)) {
diff-tree 21a41f6fd163e5630112765f90af019cf2b55535 (from 0ac0d3e2d6f09ece63ea5a736e80aec413b45ab8)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 13:35:36 2007 +0200

    only skip the movie if its original name is empty, not the parent's

diff --git a/libswfdec/swfdec_sprite_movie.c b/libswfdec/swfdec_sprite_movie.c
index 14a307c..da8dad4 100644
--- a/libswfdec/swfdec_sprite_movie.c
+++ b/libswfdec/swfdec_sprite_movie.c
@@ -369,7 +369,7 @@ swfdec_sprite_movie_get_by_name (SwfdecM
 
   for (walk = movie->list; walk; walk = walk->next) {
     SwfdecMovie *cur = walk->data;
-    if (movie->original_name == SWFDEC_AS_STR_EMPTY)
+    if (cur->original_name == SWFDEC_AS_STR_EMPTY)
       continue;
     if ((version >= 7 && cur->name == name) ||
 	swfdec_str_case_equal (cur->name, name))
diff-tree 0ac0d3e2d6f09ece63ea5a736e80aec413b45ab8 (from a0bfba2fc48da805449c64e28a551542eccdafe5)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 12:59:44 2007 +0200

    fix order of LDFLAGS, so libtool doesn't link against installed libs

diff --git a/player/Makefile.am b/player/Makefile.am
index f29a0e8..2f284f7 100644
--- a/player/Makefile.am
+++ b/player/Makefile.am
@@ -25,10 +25,10 @@ noinst_HEADERS = \
 	swfdec_slow_loader.h
 
 swfplay_CFLAGS = $(GLOBAL_CFLAGS) $(GTK_CFLAGS) $(SWFDEC_GTK_CFLAGS) $(GNOMEVFS_CFLAGS)
-swfplay_LDFLAGS = $(GTK_LIBS) $(SWFDEC_GTK_LIBS) $(GNOMEVFS_LIBS)
+swfplay_LDFLAGS = $(SWFDEC_GTK_LIBS) $(GTK_LIBS) $(GNOMEVFS_LIBS)
 
 swfdebug_CFLAGS = $(GLOBAL_CFLAGS) $(GTK_CFLAGS) $(SWFDEC_GTK_CFLAGS) -DXP_UNIX -I$(top_builddir)/libswfdec/js
-swfdebug_LDFLAGS = $(GTK_LIBS) $(SWFDEC_GTK_LIBS)
+swfdebug_LDFLAGS = $(SWFDEC_GTK_LIBS) $(GTK_LIBS)
 
 endif
 
diff-tree a0bfba2fc48da805449c64e28a551542eccdafe5 (from 0b73bfda7d0a1f59ecaa8f2f2e8e1519b4a2d668)
Author: Benjamin Otte <otte at gnome.org>
Date:   Thu Jun 14 10:31:00 2007 +0200

    set has_transform and has_color_transform for buttons

diff --git a/libswfdec/swfdec_tag.c b/libswfdec/swfdec_tag.c
index 1291ea0..5d6a336 100644
--- a/libswfdec/swfdec_tag.c
+++ b/libswfdec/swfdec_tag.c
@@ -401,11 +401,13 @@ tag_func_define_button_2 (SwfdecSwfDecod
     content = swfdec_content_new (depth);
 
     swfdec_bits_get_matrix (bits, &content->transform, NULL);
+    content->has_transform = TRUE;
     SWFDEC_LOG ("matrix: %g %g  %g %g   %g %g",
 	content->transform.xx, content->transform.yy, 
 	content->transform.xy, content->transform.yx,
 	content->transform.x0, content->transform.y0);
     swfdec_bits_get_color_transform (bits, &content->color_transform);
+    content->has_color_transform = TRUE;
 
     content->graphic = swfdec_swf_decoder_get_character (s, character);
     if (!SWFDEC_IS_GRAPHIC (content->graphic)) {
@@ -477,6 +479,7 @@ tag_func_define_button (SwfdecSwfDecoder
     content = swfdec_content_new (depth);
 
     swfdec_bits_get_matrix (bits, &content->transform, NULL);
+    content->has_transform = TRUE;
     SWFDEC_LOG ("matrix: %g %g  %g %g   %g %g",
 	content->transform.xx, content->transform.yy, 
 	content->transform.xy, content->transform.yx,


More information about the Swfdec mailing list