-
-
Notifications
You must be signed in to change notification settings - Fork 832
Project Layout
-
core
: Core emulator code, shared among all platforms-
swf-rs
: Crate to handle SWF and AS parsing
-
-
desktop
: Desktop frontend and backend code -
web
: Web frontend and backend code-
demo
: The web demo page (served at https://ruffle.rs/demo)
-
The core
directory contains the Flash Player emulation code. This is used on all platforms to parse and execute the SWF file. The Player
struct is the main entry point of the core code.
The SWF and ActionScript parsing code is separated into the swf-rs
crate.
There are several different types of backends to handle platform-specific behavior. There is a trait defining the interface for each type of backend. In addition, a "null" backend is provided for "no-op" behavior during development (for example, NullAudioBackend
does not play any audio).
An instance of each backend type is passed into Player
when it is created. Player
uses trait objects to reference the backends, allowing for the backends to be dynamically chosen at runtime.
The rendering backend handles drawing vector art, bitmaps, and text in whatever way suits the platform. The interface is defined by the RenderBackend
trait.
Current rendering backends:
NullRenderBackend
-
GliumRenderBackend
(desktop, usinglyon
for vector art tessellation andglium
for rendering) -
CanvasRenderBackend
(web, using HTML5 CanvasRenderingContext2d)
Potential future changes:
- Desktop
- Drop
glium
in favor ofgfx-hal
- Add Pathfinder backend
- Add software rendering backend?
- Drop
- Web
- Use
gfx-hal
and WebGL over canvas by default
- Use
The audio backend controls the playback, mixing, and dynamic control of audio from the SWF file. The interface is defined by the AudioBackend
trait.
Current audio backends:
NullAudioBackend
-
RodioAudioBackend
(desktop, usingrodio
) -
WebAudioBackend
(web, using Web Audio API).
Potential future changes:
- Desktop
- Drop
rodio
and use onlycpal
, doing all the mixing ourselves.
- Drop
- Web
- Decode audio on the fly and playback using
ScriptProcessorNode
. (possibly as an option). - Use
AudioWorklet
as they become standardized.
- Decode audio on the fly and playback using
Not yet implemented. This backend will handle things such as changing mouse pointer state.
Not yet implemented. This backend will handle things such as loading external content, HTTP calls, or browsing to different pages.
© 2023 Ruffle Wiki Contributors. View license.