Generate C code that plays Flash animations
Do you want prints? A video? Boring! Check out this LIVE and ONLINE demo of actual running code instead: https://www.newgrounds.com/projects/games/6419340/preview (pro tip: it is outdated)
$ swf2c -c|-h
Example usage:
$ swf2c -c saw.swf > saw.c
$ swf2c -h saw.swf > saw.h
swf2c is free software released under GNU General Public License version 3 or any later version, see COPYING.
Get in touch preferably through Newgrounds: https://detergent1.newgrounds.com/
Windowing libraries:
Vector graphics libraries:
I worked with these vector graphics libraries, but pressured to finish my thesis, I temporarily dropped support:
Other vector graphics libraries:
- Skia: generally available in package managers
- NanoVG: easy to build
- Impeller: I'll try package it myself then interface it
- Blend2D: it is C++, but has C API, we can give it a shot
- Direct2D: is it still relevant?
- Rive Renderer: their Web demos lag a lot
- OpenVG: what even is this?
- SDL_gfx: I used it for my first prototype, but it is neither "fast" nor featureful
Windowing libraries I don't care for now:
I also want to integrate physics engines:
And support for sound, but I haven't thought much about it yet.
Maybe a generic API will be provided too.
- Lottie: also take a look at this
- SVG (+ CSS or + JavaScript or + SMIL)
- Rive and its
.rivfile format - Scaleform GFx: discontinued
- GAF
- Live2D
- GameMaker
- Whatever this is: https://github.com/colin-i/actionswf
Rigged bones:
- Spine2D: runtimes
- Spriter: runtimes
- Dragonbones: runtimes
Consider this tool as "live at head", things will change drastically as I see fit.
The entire tool is one atrocious hideous Rust source code main.rs written following the XGH development methodology.
JPEXS FFDec has been tremendously useful.
Compilation time of the generated C code is a major burden right now. See https://gcc.gnu.org/pipermail/gcc-help/2025-February/143981.html
My bachelor thesis is defended and published: https://repositorio.ufsm.br/handle/1/37590
The files needed to build the PDF are... not committed yet. It is a mess, I need to organize it.
- Clipping
- Linear gradient fills
- Radial gradient fills
- Focal gradient fills
- Texture fills
- Stroke styles
- Forced frame interpolation
- Linear interpolation at first
- Guess interpolation analyzing how objects transform
- Shape morphing
- Text
- Non-seekable APIs (supposedly with a lower footprint)
- Write tool and API manual
The Gnash wiki is a goldmine, but unfortunately it is offline and can only be browsed through Internet Archive.
- https://web.archive.org/web/20090212212743/http://wiki.gnashdev.org/TimelineControl
- https://web.archive.org/web/20210310120920/https://www.adobe.com/content/dam/acom/en/devnet/pdf/swf-file-format-spec.pdf
- https://open-flash.github.io/mirrors/swf-spec-19.pdf
- https://web.archive.org/web/20080113212114/https://www.drizzle.com/~scottb/gdc/flash-paper.htm
- https://sembiance.com/fileFormatSamples/archive/swf/
- https://open-flash.github.io/
- https://www.loc.gov/preservation/digital/formats/fdd/fdd000629.shtml