Commit Graph

17 Commits

Author SHA1 Message Date
relrelb 0fd1c05fd5 chore: Use into() in more places 2021-06-22 11:49:41 -07:00
Mike Welsh 83f842faf9 avm1: Implement MovieClip.beginBitmapFill 2021-06-13 20:03:53 -07:00
Mike Welsh 554aa7fd63 core: Add backend::render::BitmapSource trait
This interface handles returning a bitmap given an ID and is used
by the render backend to get the bitmap used for a bitmap fill.
This will allow for bitmap fills in the drawing API, as these will
manage their own list of bitmaps.
This also  removes the MovieLibrary dependency from render backends
and will allow for better decoupling in the future.
2021-06-13 20:03:53 -07:00
Mike Welsh 21c351fe5b swf: Change Twips::zero fn to Twips::ZERO const 2021-06-08 14:57:15 -07:00
Mike Welsh d23ea90459 swf: Change Matrix to use Fixed16 for a, b, c, d
Matrices in an SWF file store their scale/skew components in
in 16.16 format (fbits).

Split `ruffle_core::Matrix` and `swf::Matrix`. `swf::Matrix` now
stores its data as `Fixed16` instead of immediately converting to
`f32`.
2021-06-08 14:57:15 -07:00
David Wendt ff028de8de core: `Drawing` should accept a SWF movie to pull bitmaps from 2021-03-24 13:18:06 -07:00
David Wendt e3f2d0f213 avm2: Allow constructing new `Shape`s. 2021-03-24 13:18:06 -07:00
David Wendt e8b6d1a52a core: Migrate clip drawing commands to exposing the internal `Drawing` to mutation 2021-03-24 13:18:06 -07:00
Mike Welsh 9b6295f33a render: Pass library to RenderBackend::register_shape (fix #2037)
Pass the movie library to `register_shape` methods so that bitmap
charcter IDs can be resolved immediately on the proper SWF.

This fixes #2037, which cause incorrect bitmaps to be used when
multiple movies were loaded.
2020-12-31 13:10:21 -08:00
Mike Welsh d7a186b2cd avm1: Implement shape hit testing 2020-09-02 17:51:55 -07:00
David Wendt 2aa7d9770f Draw a border around text if requested. 2020-06-20 19:55:58 -04:00
Nathan Adams 3346accb9c core: More accurate shape_bounds/edge_bounds in drawing api 2020-05-21 20:34:48 +02:00
Nathan Adams 279c07d9b8 core: Update drawings on render instead of on tick 2020-05-21 18:38:10 +02:00
Nathan Adams 55215273e8 core: Stretch edge & shape bounds separately and avoid a clone, in rendering api 2020-05-21 18:38:10 +02:00
Nathan Adams 04690581ba core: Refactor common code in drawing api 2020-05-21 18:38:10 +02:00
Nathan Adams 1f8abc92fd core: Keep track of cursor position in drawings 2020-05-21 18:38:10 +02:00
Nathan Adams 99574cfa72 core: Move drawing api out from `movie_clip` into `drawing` 2020-05-21 18:38:10 +02:00