Here are some patches I made yesterday. They add three actions: duplicateClip, removeClip and With, one method Math.abs and bug fixes. All base off 'as' branch. Please have a look if you are going to apply them because I'm quite new in swfdec development. 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. gotoAndPlay _level0 global variable swapDepths method lineTo, lineStyle, moveTo ahh.. those movies created by duplicateClip do not get added as properties to _root. I saw blocky.swf trying to access movies via _root. some less important ones: System global variable Sound object -- Duy -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Wrong-comparison.patch Type: text/x-patch Size: 953 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0010.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-Stop-GCC-warning.patch Type: text/x-patch Size: 951 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0011.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-Implement-actions-duplicateClip-and-removeClip-0x24.patch Type: text/x-patch Size: 6138 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0012.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-Wrong-type-check.patch Type: text/x-patch Size: 1244 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0013.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0005-Zero-newly-created-listener-entries.patch Type: text/x-patch Size: 1184 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0014.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0006-Implement-action-With.patch Type: text/x-patch Size: 7768 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0015.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0007-Show-what-object-the-missing-method-was-called-on.patch Type: text/x-patch Size: 941 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0016.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0008-Add-Math.abs.patch Type: text/x-patch Size: 2081 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0017.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0009-Replace-opcode-number-with-named-constants.patch Type: text/x-patch Size: 1285 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0018.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: 0010-Wrong-variable-name.patch Type: text/x-patch Size: 1026 bytes Desc: not available Url : http://lists.freedesktop.org/archives/swfdec/attachments/20070603/b790ef76/attachment-0019.bin
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