Commit Graph

9 Commits

Author SHA1 Message Date
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
Nathan Adams eda862c719 swf: Merged core::Matrix into swf::Matrix 2020-05-20 14:54:41 +02:00
Mike Welsh 223edb9bc1 core: Matrix translation is in twips 2020-02-26 12:47:47 -08:00
Will Brindle 06b0d42c8b core: Add matrix tests (#72)
* Add matrix tests. Requires the approx crate
2019-10-03 02:44:26 -07:00
Mike Welsh 9cbeacd7b2 core: Transform mouse coordinates from viewport to stage 2019-08-19 22:27:38 -07:00
Mike Welsh 5bba546a53 core: Add BoundingBox calculations
TODO: Add dirty flag and cache matrices.
2019-08-19 17:29:55 -07:00
Mike Welsh 3cefeeba6a Use twips for internal calculations
Switch from pixels to twips for internal calculations. swf crate
was updated to add a Twips wrapper-type. Ruffle will use this type
internally for transforms and shapes. This fixes some precision
errors in rendering (see heroes_of_cybertron.swf) and will match
what the Flash Player does internally more closely. (e.g.
DisplayObject x and y will be quantized to 1/20 pixel units). It
is up to the renderer to convert units from twip space to pixels
when rendering.
2019-05-17 13:40:56 -07:00
Mike Welsh 5e88f43280 Color transforms 2019-05-01 09:55:54 -07:00
Mike Welsh ee64cc77bc Reforactor 2019-04-27 23:08:59 -07:00