Skip to content

bottle2/swf2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

swf2c

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)

Usage

$ swf2c -c|-h

Example usage:

$ swf2c -c saw.swf > saw.c
$ swf2c -h saw.swf > saw.h

License

swf2c is free software released under GNU General Public License version 3 or any later version, see COPYING.

Contact

Get in touch preferably through Newgrounds: https://detergent1.newgrounds.com/

Backends

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.

Competitors

Rigged bones:

Versioning

Consider this tool as "live at head", things will change drastically as I see fit.

Development

The entire tool is one atrocious hideous Rust source code main.rs written following the XGH development methodology.

JPEXS FFDec has been tremendously useful.

Performance

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

Thesis

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.

Future directions

  • 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

References

The Gnash wiki is a goldmine, but unfortunately it is offline and can only be browsed through Internet Archive.

About

No description, website, or topics provided.

Resources

License

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors