Commit Graph

182 Commits

Author SHA1 Message Date
David Wendt fa5a3164ea should be executable on unixlikes 2019-08-30 22:27:48 -04:00
David Wendt c02b4c111b Overwrite navigator.plugins to defeat flash detects 2019-08-30 22:27:48 -04:00
David Wendt 101b1e5715 Fix not being able to handle multiple embeds.
This is caused by `HTMLCollection` being too smart for it's own good and
removing elements behind the loop's back.
2019-08-30 22:27:48 -04:00
David Wendt 6fbdc6f1f4 Respect the page's width and height settings in our custom elements 2019-08-30 22:27:47 -04:00
David Wendt 8060802465 Kill `bootstrap.js`, load the WASM ourselves.
Instead of forcing a chunk load on Webpack just so we can have Webpack prepare the WASM for us, we're now using the `no-modules` mode of `wasm-pack` manually and loading the resulting files ourselves.

I still have to force Ruffle to load outside of the extension sandbox though...
2019-08-30 22:27:47 -04:00
David Wendt 7c6ad57443 Let's completely force webpack to run outside of the extension sandbox.
This idea was stolen from @devsnek, whom I'm currently writing an explanation for.
2019-08-30 22:27:47 -04:00
David Wendt 7a6169275d Tell webpack about the extension resource URLs 2019-08-30 22:27:47 -04:00
David Wendt 385b9f807e Fix most (though not all) of our extension bugs.
I still can't figure out how to keep Webpack from making requests to the
injected site...
2019-08-30 22:27:47 -04:00
David Wendt de5a2c31c0 Add embed support. 2019-08-30 22:27:47 -04:00
David Wendt 9529893437 Add console error logging for failed SWF loads 2019-08-30 22:27:46 -04:00
David Wendt ee8b6d57ba Don't pull params until after we've been connected.
Otherwise, we don't have any params yet...
2019-08-30 22:27:46 -04:00
David Wendt 5655ad44a3 It turns out, we don't need to wait for DOMContentLoaded. 2019-08-30 22:27:46 -04:00
David Wendt c0e6866745 Fix the demo file upload option 2019-08-30 22:27:46 -04:00
David Wendt be21a0dbbb Configure the `<ruffle-object>` tag to style as a
block element, like `<object>`
2019-08-30 22:27:45 -04:00
David Wendt 2a2dbba21f Use a custom element to actually house the Ruffle
instance, even though we can't really upgrade `<object>` directly...
2019-08-30 22:27:45 -04:00
David Wendt 6f32fc022c Copy attributes from hijacked Flash objects 2019-08-30 22:27:45 -04:00
David Wendt 0414e24ce2 First start on extension packaging 2019-08-30 22:27:45 -04:00
David Wendt bac5ecfe8d Alter the demo a bit so that it latches onto an
already-existing object tag and replaces it with ruffle.
2019-08-30 22:27:45 -04:00
Mike Welsh 35652ae87e chore: Update dependencies
Run cargo update. Remove git dependency on jpeg-decoder (the latest
version was published to crates.io). Update swf-rs to latest to
disable smoothing in SWFv7 and lower (addresses #28).
2019-08-29 14:57:12 -07:00
Nathan Adams 87e6b766c2 Use named functions for builtins 2019-08-28 21:43:20 -05:00
Nathan Adams 2378ea3881 Shuffled around some avm1 builtins & types 2019-08-28 21:43:20 -05:00
Nathan Adams a74d1734af Initial work on avm1 method calling, local and global variables.
This contains just enough AS1 support for early trivial loading screens to not crash (ie badgers badgers badgers)
2019-08-28 21:43:20 -05:00
Mike Welsh f41470129d desktop: Skip path on tessellation error
lyon vomits a lot on various tessellations. Previously this would
bail out immediately for the entire shape, resulting in missing art.
Now we just skip that particular path, and the rest of the shape
should get tessellated as normal.
2019-08-26 18:06:10 -07:00
Mike Welsh 0b72ad1c00 core: Fix text position with multiple text blocks
The text x position would not be remembered between text blocks,
so the positioning of such text would be incorrect. Now the x position
is properly advanced.

Fixes #42.
2019-08-26 17:46:38 -07:00
Mike Welsh 6a5c5ab1df chore: Add rustfmt.toml and rustfmt pass 2019-08-26 16:38:48 -07:00
Nathan Adams 06d9f39c0e More verbose avm1 value conversion errors 2019-08-26 14:45:35 -05:00
Mike Welsh 3a795fff47 web: image-rendering: pixelated for nonsmoothed bitmaps
TODO: Firefox uses crisp-edges, Chrome uses pixelated. Clean this up
at some point.

Addresses #28.
2019-08-24 10:59:56 -05:00
Mike Welsh 6499df988f desktop: Respect bitmap smooth/repeat settings
Addresses #28.
2019-08-24 10:59:34 -05:00
Mike Welsh d9f70ddde8 core: GC trace through DisplayObject base 2019-08-22 23:28:51 -07:00
Mike Welsh 5998876271 core: Don't panic on missing characters in button 2019-08-22 21:54:00 -07:00
Mike Welsh 0214b3e447 core: Use matrix in DefineText (fix #34)
Text was not rendered in the correct position because it did not
use the matrix specified in the DefineText tag. I think this is an
extra Matrix used to adjust text alignment.

Fixes #34.
2019-08-22 18:40:47 -07:00
Mike Welsh 324a410cb1 render: Properly render premultiplied alpha bitmaps 2019-08-22 15:24:50 -07:00
Mike Welsh 022a0746ca web: Add hack for Firefox additive alpha cxforms
This hack removes additive alpha components from color transforms
on Firefox. See #38.
2019-08-22 14:13:37 -07:00
Mike Welsh c1b8978555 core: Add max frames-per-tick as sanity
Avoid running too many frames at once.
2019-08-22 13:31:24 -07:00
Mike Welsh 3933b00000 web: Use initial timestamp from requestAnimationFrame
Previously Performance.now() was used to grab the initial timestamp
for calculating dt in requestAnimationFrame. However, this doesn't
seem to be reliable and resulted in negative dt values in Chrome.

Now we just use an Option for the timestamp and initialize it to None.
The first animation callback will set the timestamp.
2019-08-22 13:28:06 -07:00
Mike Welsh 8117b0cfdc avm1: Remove some debug spew 2019-08-22 10:24:38 -07:00
Mike Welsh b49cce2a48 ci: Run core tests 2019-08-22 09:54:40 -07:00
Mike Welsh 7b6a3d525a core: Single frame movieclips should stop 2019-08-22 09:54:40 -07:00
Mike Welsh a220a98c5b tests: Add looping clip test 2019-08-22 09:54:40 -07:00
Mike Welsh b0eff353a9 tests: Add initial SWF tests 2019-08-22 09:54:40 -07:00
Mike Welsh 5fdc7168a7 web: Fix DefineBitsJPEG3 + alpha
DefineBitsJPEG3 tags also include a zlib-encoded alpha channel.
This wasn't working on web (it was trying to use the raw RBGA also
an image!) Now these are re-encoded to PNG.

Addresses #27.
2019-08-20 16:23:46 -07:00
Mike Welsh 6277a5450b
docs: Fix link in CI badge
CI link was pointing to Travis instead of Circle!
2019-08-20 12:48:28 -07:00
Mike Welsh d021b02e90 web: Disable alpha on canvas 2019-08-19 23:33:12 -07:00
Mike Welsh dd3748a520 core: GC collect_debt each frame 2019-08-19 22:34:49 -07:00
Mike Welsh 9cbeacd7b2 core: Transform mouse coordinates from viewport to stage 2019-08-19 22:27:38 -07:00
Mike Welsh 637588fae5 core: Store view matrix in player
Player is now in charge of scaling/cropping/translating the content
to fit the viewport size supplied by the frontend.

Added backend::render::Letterbox, which stores the margin sizes
for letter/pillarboxing.
2019-08-19 22:27:38 -07:00
Mike Welsh f3f4fa6179 web: Add mouse up/down/move handlers 2019-08-19 22:27:38 -07:00
Mike Welsh 8be9b9089b avm1: Stub out StartDrag/EndDrag 2019-08-19 22:27:38 -07:00
Mike Welsh ff74409d20 core: Tick audio backend each frame 2019-08-19 22:27:38 -07:00
Mike Welsh 7922aca921 core: Mouse pick in top-to-bottom order 2019-08-19 22:27:38 -07:00