[Swfdec] some patches for swfdec

Benjamin Otte otte at gnome.org
Mon Jun 4 05:00:58 PDT 2007


On 6/4/07, Nguyen Thai Ngoc Duy <pclouds at gmail.com> wrote:
> Here are some patches I made yesterday.
>
Awesome, thanks. I applied the smaller ones. (I even added tests for
one! ;)) Here are some comments for the 2 others:

> 0003-Implement-actions-duplicateClip-and-removeClip-0x24.patch
>
It looks a lot like you just copied the code for duplicateMovieClip
and removeMovieclip from swfdec_sprite_movie_as.c. Besides copy/paste
being evil, it's also missing tests, which I'd love to have for these
pretty intrusive action opcodes. So I think I'll have a hard look at
them myself soon.
Also, I'd want to keep the name RemoveSprite and CloneSprite for the
actions. THis is because I'm trying to copy the official naming as
much as possible to avoid confusion. (see for example
http://www.flagstonesoftware.com/transform/datasheets/com/flagstone/transform/FSAction.html
)

> 0006-Implement-action-With.patch
>
This patch is definitely not what I intended it to be. I intended to
(kinda like the SpiderMonkey code does it) create a SwfdecAsWith
object, which is a subclass of SwfdecAsScope and replace
context->frame->scope.
It might also make sense to treat With as a function call and
construct a new frame when encountering it.
I haven't really looked into it. It again looks like it requires lots
of tests...

> BTW, how can I implement createEmptyMovieClip? I have no idea how to
> create an SwfdecMovie properly. I also need to add the following. If
> you have any idea, please tell me.
>
Currently a SwfdecSpriteMovie is always attached to a corresponding
SwfdecSprite. This needs to be changed to support lots of features,
like createEmptyMovieClip(), MovieClipLoader or loadMovie(). It'll
probably require gettig rid of the SwfdecRootSprite/SwfdecSprite and
the SwfdecRootMovie/SwfdecMovie distinctions. But I haven't come
around to doing this refactoring yet.

> gotoAndPlay
> swapDepths method
>
Those should all be implemented. in swfdec_sprite_movie_as.c

> _level0 global variable
>
_levelN might be broken now that you say it. I changed how child
movies get accessed and that might have broken _levelN. I'll write a
test for it.

> lineTo, lineStyle, moveTo
>
Just not implemented. Requires someone adding the functionality to
SwfdecSpriteMovie. Those functions should match pretty well to cairo.

> ahh.. those movies created by duplicateClip do not get added as
> properties to _root. I saw blocky.swf trying to access movies via
> _root.
>
They should be, as long as they are properly named and are really
children of the root movie. See swfdec_sprite_movie_get_variable() for
how they get accessed.

> System global variable
>
Is implemented in swfdec_movie_class_get_variable().

> Sound object
>
Is a TODO item, as it's not really important for functionality of the
Flash file and requires some changes to the audio handling.


Cheers,
Benjamin

PS: In case you do IRC, please join #swfdec on Freenode


More information about the Swfdec mailing list