[Swfdec] some patches for swfdec
Nguyen Thai Ngoc Duy
pclouds at gmail.com
Mon Jun 4 06:08:18 PDT 2007
Comments below. One more thing about tests, how do you create *.swf?
Use mtasc or something?
On 6/4/07, Benjamin Otte <otte at gnome.org> wrote:
> > 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.
Yes I copied from them :) I was in hurry to see what was missing to
run blocky.swf. My bad. Anyway, about assertions, error handling.. do
you have any guideline to follow up? I was a little confused when
implementing actions/new methods. What should I do if something goes
wrong, such as not enough parameters, wrong type...
> 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
> )
Ok. I didn't know that. I saw all gnash, swfmill and flasm use
duplicateClip and removeClip so I thought they would be better names
(especially when you track actions using flasm or swfmill)
>
> > 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...
Well I thought about subclassing (wrongly) context for that. I
searched back the history but not found any implementation for
SwfdecAsWith. Will look into it again to see what I can improve.
> > 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.
Okay. I'll leave that for you ;) Those movie/sprite things seem
over-complicated to me.
>
> > 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.
Er.. _levelN isn't implemented at all or am I missing something? Maybe
it's just inaccessible from ActionScript?
>
> > lineTo, lineStyle, moveTo
> >
> Just not implemented. Requires someone adding the functionality to
> SwfdecSpriteMovie. Those functions should match pretty well to cairo.
These should wait for createEmptyMovieClip.
[snip]
>
> > 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.
Agree
>
>
> Cheers,
> Benjamin
>
> PS: In case you do IRC, please join #swfdec on Freenode
>
I no longer usually do IRC but will stop by when hacking swfdec.
--
Duy
More information about the Swfdec
mailing list