Commit Graph

521 Commits

Author SHA1 Message Date
Nathan Adams 4c6c8ee1f2 web: Add trace_observer to web api, which lets you capture trace output from a specific movie 2020-09-13 13:51:39 -07:00
Nathan Adams de009c7673 core: Add Log backend, for capturing trace output specific to a movie 2020-09-13 13:51:39 -07:00
Mike Welsh a18e80baf2 chore: Fix clippy lints 2020-09-07 12:18:41 -07:00
Nathan Adams 91cb597a79 web: Expose ExternalInterface callbacks on the player object, not the canvas 2020-09-03 18:17:44 -07:00
Nathan Adams 5880db43cd web: Respect allowScriptAccess, which defaults to false for streaming or 'sameDomain' for objects 2020-09-03 18:17:44 -07:00
Nathan Adams b5531a48d0 web: Allow reentrant ExternalInterface callbacks 2020-09-03 18:17:44 -07:00
Nathan Adams a49e8d8587 web: Implement two-way communication with ExternalInterface 2020-09-03 18:17:44 -07:00
Nathan Adams 43f5506418 web: Implement LocaleBackend for web 2020-09-02 17:12:31 -07:00
Nathan Adams 86eb6f2e50 avm1: Implement Date - #249 2020-09-02 17:12:31 -07:00
Nathan Adams cb2461920b core: HTTP request values need to preserve order 2020-08-28 11:53:32 -07:00
Mike Welsh cab1634624 web: Ensure Key.getCode is set on keyUp
Fixes sticking keys in #1046.
2020-08-26 15:16:46 -07:00
Mike Welsh eaff74f364 web: Wire up mouse wheel events 2020-08-23 13:38:59 -07:00
Mike Welsh cbd448522a chore: Allow unknown clippy lints
same_item_push was added on nightly, but is currently throwing
a false negative. I added an allow for it, but this causes a
warning on stable for an unknown lints, so allow unknown lints for
now.
2020-08-12 23:51:12 -07:00
Mike Welsh 6c89869210 chore: Fix clippy lints 2020-08-12 19:04:14 -07:00
David Wendt c926da8888 Refactor URL relativization into two utility methods that backends can provide base URLs and paths to. 2020-07-23 23:02:54 -04:00
David Wendt 7433bfe28f Add a `NavigatorBackend` method to resolve relative URLs. 2020-07-23 23:02:53 -04:00
David Wendt 4813942fe7 The player should always change the audio backend's framerate itself. 2020-07-23 23:02:52 -04:00
David Wendt f56d16a68d Separate player creation from root movie setup, and allow users of Ruffle to load in movies synchronously or asynchronously.
During the small period of time when a player is created but has no root movie, a temporary empty movie is installed with an assumed stage size and framerate of 550x400@12fps. This is Flash default for new projects, so it seemed appropriate. User ActionScript cannot see these values, and I'm not even sure JavaScript can, either.
2020-07-23 23:02:51 -04:00
David Wendt 6998dafdb9 Store an origin URL on every movie that is loaded. 2020-07-23 23:02:50 -04:00
Mike Welsh 8e97fdfe0c web: Fix WebAudioBackend::stop_sounds_with_handle (fix #752)
This would incorrectly stop all audio nodes whenever a Stop sound
event was encountered.
2020-06-25 23:04:47 -07:00
CUB3D 166cb60d89 chore: Clean up useage of unwrap 2020-06-24 01:46:07 +01:00
CUB3D 2538d430ff chore: Format 2020-06-24 01:46:07 +01:00
CUB3D 0644168f12 web: Scope entries in localStorage to the current url (#379) 2020-06-24 01:46:07 +01:00
CUB3D 711b202a56 web: Add storage backend based on LocalStorage 2020-06-24 01:46:07 +01:00
CUB3D 4e286b43ae chore: Format 2020-06-24 01:46:06 +01:00
CUB3D 752ffc5cca chore: Fix clippy lints and tests 2020-06-24 01:44:07 +01:00
Nathan Adams 59ccd75518 core: Rename loader::LoaderError to loader::Error 2020-06-20 15:02:00 -07:00
Nathan Adams 0f1eef9022 core: Introduce LoaderError to all Loader methods 2020-06-20 15:02:00 -07:00
Nathan Adams 5662b2d4d9 core: Make Value::coerce_to_string return a Cow<str>` 2020-06-19 12:48:28 -07:00
Mike Welsh 33cbc1fe2f web: Avoid panics on unimplemented audio codecs 2020-06-17 12:14:08 -07:00
Mike Welsh 83feeefeeb audio: Don't panic on unimplemented codecs
Remove `unimplemented` calls when encountring unsupported codecs
such as Nellymoser. Instead, return an Error that can be
gracefully handled.
2020-06-17 12:14:08 -07:00
CUB3D 54701f775e web: Add dummy set_clipboard impl 2020-06-09 22:41:11 +01:00
Nathan Adams 91b0b28aa8 web: Fixed Key.isDown(13) (enter key) detection on web 2020-06-04 13:41:10 -07:00
Mike Welsh 3a8c705e95 chore: Fix clippy lints 2020-05-30 03:47:12 -07:00
Nathan Adams b8e63045b2 web: Moved source of core into core/src, to prep for tests 2020-05-19 11:42:54 +02:00
Nathan Adams b6523324ed web: Move each web package into a packages/ directory 2020-05-19 11:42:53 +02:00
Mike Welsh d15a4ed994 web: Fallback to canvas render backend in more cases (fix #545) 2020-05-14 22:36:19 -07:00
Nathan Adams 51d9f3ef36 core: Change Player::new to take in a SwfMovie, not &[u8] 2020-05-04 16:07:38 -07:00
Mike Welsh 936b314569 web: Add features for enabling webgl/canvas backend 2020-05-02 10:39:40 -07:00
Mike Welsh fa5c09b0cd web: Add WebGL render backend 2020-05-02 10:38:18 -07:00
Mike Welsh f09bd8c079 core: Clean up tick/render loop
Don't call `render` from `Player::tick`; instead, require the
frontends to explicitly call `render` when they wish to redraw.
The frontend can query `Player::needs_render` to see if the stage
is dirty and needs a redraw. Update desktop and web to use this
new method.

This fits better with the newer winit event loop model, which
requires explicitly calling `request_redraw`, and should avoid
spurious renders.
2020-05-02 04:25:21 -07:00
Mike Welsh 87bf0f44c4 render: Move canvas renderer to separate subcrate 2020-04-29 23:26:41 -07:00
Mike Welsh 0921f18417 web: Avoid out-of-bounds slice from zero sample SoundStreamBlock 2020-04-27 07:49:59 -07:00
Mike Welsh 8aa12d181f render: Remove RenderBackend::draw_pause_overlay 2020-04-27 04:45:53 -07:00
Mike Welsh c94df5243e web: Add nicer play button 2020-04-27 04:45:53 -07:00
Mike Welsh ddfd84ecdd web: Stop playing sounds when an instance is destroyed 2020-04-13 04:57:10 -07:00
Mike Welsh 0c0d3dfd41 core: Add Navigator::time_since_launch to use for getTimer
Change `ActionGetTime` (`getTimer`) to use a new backend method.
This allows it to return updated times if it is called multiple
times in a single frame. This fixes hangs caused by games that use
busy-loop "frame limiter" code.
2020-03-28 22:28:07 -07:00
Mike Welsh 5591cec0f7 web: Fix #412, incorrect bitmap rendering when cached 2020-03-24 23:08:15 -07:00
Mike Welsh 26914d7b62 web: Fix off-center gradient rendering
Regression caused by 223edb9. Write twips value to SVG matrix.
Addresses some incorrect rendering in #437.
2020-03-16 02:44:32 -07:00
Mike Welsh cd334bcd3f web: Fix bitmap fills not using twips 2020-03-02 18:31:49 -08:00
Mike Welsh 223edb9bc1 core: Matrix translation is in twips 2020-02-26 12:47:47 -08:00
Mike Welsh c4c02260fb core: Implement keyUp event 2020-02-26 03:48:07 -08:00
Mike Welsh acd5f2c74f web: Fix invisible cursor 2020-02-26 01:47:08 -08:00
Mike Welsh 86ec2c6cb8 input: Add InputBackend::set_mouse_cursor. Change cursor on buttons
It doesn't feel like Flash without having the hand cursor display
when hovering over buttons. First pass at implementing this;
core communicates which mouse cursor to use via
`InputBackend::set_mouse_cursor`.

TODO: Hand cursor only displayed for Button display objects
currently. Movie clips should also display this when they are in
"button mode" (when a button mouse event is set on them in AVM1,
or `buttonMode` property in AVM2).
2020-02-25 02:50:26 -08:00
David Wendt 33d26b9149 Shorten `Pin<Box<dyn Future<Output=Result<T,E>> + 'static>>` into `OwnedFuture<T,E>`.
This is technically stricter on `fetch` impls, but right now we can't support non-`'static` futures at all.
2020-02-22 00:02:45 -05:00
David Wendt c7539872f7 Add the ability to POST data from `fetch`, and allow methods that read AVM locals into form data to `GET` or `POST` them. 2020-02-21 23:58:00 -05:00
David Wendt f4e4171ebe Make spawned futures falliable, and report those errors. 2020-02-21 23:57:56 -05:00
David Wendt 55149b7b7e Reference count the Player and provide a weak reference in UpdateContext.
This allows the formation of `'static` futures that can still interact with a player. Async code will need to upgrade the weak reference in order to be able to interact with the player.
2020-02-21 23:44:06 -05:00
David Wendt 8d83bbb864 Impl fetch for web 2020-02-21 23:44:05 -05:00
David Wendt 491d94c947 Pinbox all Futures.
Due to some strangeness with the way Rust implemented unsafe-to-move behavior, boxed futures are implicitly `Unpin`. Which is useless to us.

The reason for this is a little counter-intuitive. Actually, the fact that Rust supports memory pinning at all is a little odd, because the core language explicitly requires all types be movable. To get around this, Pin requires that all !Unpin types be *born pinned*. This is because you can't re-pin an already unpinned value in memory.

Anyway, this necessitates this silly API change.
2020-02-21 23:44:05 -05:00
David Wendt 00d25a768c Extremely basic impl of fetch/spawn methods for getting data off the web 2020-02-21 23:44:05 -05:00
David Wendt 2137b9f1fd Migrate `set_frame_rate` into the core `AudioBackend` trait 2020-02-21 23:44:05 -05:00
Mike Welsh 6b7966f3fc chore: Update comments in canvas mask rendering 2020-01-31 20:27:24 -08:00
Mike Welsh 3ab0d4ef80
web: Merge #352, improved performance on canvas
Shape-drawing performance improvements on the canvas backend.
2020-01-30 15:16:09 -08:00
Mike Welsh 087f15f28c web: Clear audio decoding buffer before each decode (fix #357) 2020-01-29 12:29:54 -08:00
David Wendt abedb1262a Make sure `DrawImage` commands get the image filter. 2020-01-29 14:19:19 -05:00
David Wendt 30fc56649b Clamp u8 values to the [0, 255] range. 2020-01-29 14:19:19 -05:00
David Wendt a57d0e12b3 Do not apply a color filter at all unless rendering a bitmap or gradient.
This significantly improves render times, as browsers appear to apply filters in the most general, inefficient way possible.
2020-01-29 14:19:18 -05:00
David Wendt 746971e38a Avoid unnecessary calls to `set_attribute`/`set_filter`. 2020-01-29 14:19:18 -05:00
David Wendt 693537a294 Line widths and miter limits should be in pixels, not twips 2020-01-29 14:19:18 -05:00
David Wendt b611067bc5 First pass on a more-optimized render path that uses canvas draw commands directly rather than precompiling SVGs as images. 2020-01-29 14:19:18 -05:00
David Wendt 4ee60d9214 Make `swf_shape_to_svg` output the entire `ShapeData` list itself, and also it's not called that anymore. 2020-01-29 14:19:18 -05:00
David Wendt 70cdcb60a7 Break shape data up into a series of canvas commands, including direct fills and strokes. 2020-01-29 14:19:18 -05:00
Mike Welsh 1223de9e94 web: Draw masks with 100% alpha (fix #348) 2020-01-22 12:08:57 -08:00
Nathan Adams 4ad6ef8b83 core: Implemented Key.getCode() 2020-01-17 15:11:38 -08:00
Mike Welsh 881581eed5 web: Resize canvas when devicePixelRatio changes (fix #322) 2020-01-15 21:34:22 -08:00
Mike Welsh f983af3f65 web: Fix decoding of PCM sounds 2020-01-15 21:12:45 -08:00
Mike Welsh ad719ad586 web: Fix timing of sound envelopes
The endTime parameter of AudioParam.linearRampToValueAtTime is
on the global AudioContext's timeline, not local to the sound.
Adding the sound's start time to the parameter fixes sound
envelopes not playing back correctly.
2020-01-15 20:38:43 -08:00
Mike Welsh 12ee4c7432 web: Duplicate left channel when playing a mono sound with envelope (fix #323) 2020-01-15 20:36:05 -08:00
Mike Welsh b57c827e23 web: Use proper key code for Enter key 2020-01-14 16:18:42 -08:00
Mike Welsh 79745feef7 chore: Use percent-encoding 2.1.0 2020-01-13 11:07:30 -08:00
Mike Welsh f576a39760 web: Fix must_use warning on AudioContext::decode_audio_data
web-sys 0.3.34 added `must_use` to `Promise`. Add `let _ =` to
squlech this warning.
2020-01-06 13:01:39 -08:00
Mike Welsh 4bf29f677f avm1: Implement Sound.duration
Add AudioBackend::get_sound_duration.
2020-01-03 17:11:00 -08:00
Mike Welsh d0142f1d67 audio: Add AudioBackend::stop_sound 2020-01-03 17:11:00 -08:00
Mike Welsh 87158647d1 core: Implement keyPress button events 2019-12-24 03:06:03 -08:00
Mike Welsh 30983c5bab web: Use pointer events on web 2019-12-23 13:16:58 -08:00
Nathan Adams 9000451d58 core: Implemented Mouse.show() & Mouse.hide() 2019-12-22 14:33:46 -08:00
Mike Welsh c05b03dd06 web: Handle keydown/keyup and preventDefault if Ruffle has focus 2019-12-21 19:08:06 -08:00
David Wendt 69094b56b5 Add input support to the web backend. 2019-12-21 19:08:06 -08:00
Nathan Adams eedc4bbe24 core: Added Input backend, currently unimplemented, for polling user input 2019-12-21 19:08:06 -08:00
Mike Welsh 29754eace8 web: Avoid `copyToChannel` on Safari
`AudioBuffer.copyToChannel` does not work on Safari, so switch to
using `getChannelData` to fill the audio buffers.

Limitations in wasm-bindgen prevent us from actually modifying the
data returned by `getChannelData` on the Rust side, so import a JS
function to fill the audio buffer (js-src/ruffle-imports.js).
2019-12-03 23:05:42 -08:00
Nathan Adams 35d80a254b chore: Use new method of setting png color & depth 2019-11-25 10:39:01 +00:00
Mike Welsh e3d0d9031d core: Handle empty JPEGTables tags (fix #116) 2019-11-11 17:08:08 -05:00
Mike Welsh b343ba14a2 web: Implement event sound envelopes 2019-10-30 19:26:19 -07:00
Mike Welsh 158f2a6fa2 web: Use SeekSamples to account for MP3 encoder delay 2019-10-29 23:36:51 -07:00
Mike Welsh f9b23c6e0c web: Handle gaps between SoundStreamBlocks 2019-10-29 23:36:51 -07:00
Mike Welsh 1a7959b96d audio: Initial syncing of stream sound to MovieClip timeline 2019-10-29 23:36:51 -07:00
Mike Welsh f07dfb4eb6 web: Implement ADPCM stream sounds on web 2019-10-28 02:51:46 -07:00
Mike Welsh eaea6aaf20 audio: Fix audio for ADPCM stream sounds
When a stream sound uses ADPCM compression, the ADPCM header is
included in each SoundStreamBlock (as opposed to stream sounds
in the other formats). This header wasn't being parsed, resulting
in corrupted audio (see https://homestarrunner.com/main12.swf).
2019-10-28 02:51:46 -07:00
Mike Welsh 4aec120ffb core: Add Bitmap display object
Converts the Bitmap character to a proper display object. This can
be instantiated directly in a PlaceObject tag in SWFv9 movies,
compared to the previous versions which indirectly references
bitmaps from Shape tags.
2019-10-11 16:33:58 -07:00
Mike Welsh 0506b7c566 web: Calculate bounds for text glyphs when not present
The text bounds fields for a DefineFont2/3 tag can be a bogus empty
rectangle, per the SWF spec. We must properly the bounds ourselves
to render properly on web.
2019-10-07 23:23:45 -07:00
Mike Welsh c408f56e1a web: Fix looping sounds not ending 2019-10-03 16:30:33 -07:00
Mike Welsh c2ddb5a26f web: Clamp stroke width to 1 pixel minimum
Many SWFs use "hairline" strokes which are 1 twip wide, but Flash
renders strokes with a minimum width of 1 pixel (20 twips).
SVG has no minimum, resulting in faint lines for the "hairline"
strokes. Clamp the minimum stroke width to 1 pixel to more closely
match the Flash Player.
2019-10-03 03:15:10 -07:00
Mike Welsh c1f521cfba web: Fix color transforms not working when canvas is reused
On the web demo, if you played two different SWFs, color transforms
would stop working because the color matrix SVG filter would be
created twice with the same ID. Now we properly remove the previous
filter.
2019-09-27 16:20:25 -07:00
Mike Welsh fcfcf0407d core: Fix stop sound events 2019-09-27 13:50:03 -07:00
Mike Welsh 9fc18fdb6a web: Clean up web audio backend
Change naming to more closely match the desktop backend.
2019-09-27 13:50:03 -07:00
Mike Welsh af163d9183 core: Support start, stop, event sounds in audio backend
Event sounds on the timeline in Flash have a "sync" setting,
which allows them to stop other sounds or only play if the
sound is not already playing.
2019-09-27 13:50:03 -07:00
Mike Welsh 547da84c9c core: Add stop_all_sounds to audio backend
Implemented in web and desktop.
2019-09-19 00:47:05 -07:00
Mike Welsh 1f0e43c3bd web: Support event sound looping and start/end points 2019-09-19 00:47:05 -07:00
Mike Welsh e052a70a5a desktop: Support looping and start/end points for event sounds
Renamed `AudioBackend::play_sound` to `start_sound`, and this
also takes a `SoundInfo` parameter with the event sound settings
from the SWF file.

Desktop now obeys the loop and start/end point settings. Envelopes
are still TODO.
2019-09-19 00:47:05 -07:00
Mike Welsh 9c8721c127 core: Drop rodio and use only cpal for audio backend
Drop the rodio dependency and directly use cpal for the audio
backend. Use the sample crate for audio mixing and resampling.
2019-09-19 00:47:05 -07:00
Mike Welsh 82c1116c42 chore: cargo fmt 2019-09-16 20:37:11 -07:00
David Wendt 58ce10ea67 Support form submission from Flash. 2019-09-16 20:04:30 -07:00
David Wendt e952d20976 Open the window asked for, if specified 2019-09-16 20:04:30 -07:00
David Wendt 0f9db1744b Add a backend for controlling the enclosing web browser. 2019-09-16 20:04:30 -07:00
Mike Welsh dbbeccaacd web: More accurate radial gradients on canvas 2019-09-12 01:02:46 -07:00
Mike Welsh 8fcee704c0 chore: cargo fmt 2019-09-09 20:42:08 -05:00
Mike Welsh ce9a0a8ef6 web: Initial masking support
Also add web/src/utils.rs for some methods to ease management
of errors for wasm_bindgen.
2019-09-09 20:42:08 -05:00
Mike Welsh 28f0ce3c83 Mask work 2019-09-09 20:42:08 -05:00
Mike Welsh 6a5c5ab1df chore: Add rustfmt.toml and rustfmt pass 2019-08-26 16:38:48 -07: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 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 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 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 d021b02e90 web: Disable alpha on canvas 2019-08-19 23:33:12 -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 7005dd7621 web: Remove debug spew in web renderer 2019-08-19 17:29:08 -07:00
Mike Welsh d0413da381 web: Set preserveAspectRatio to none on SVGs
Firefox would fudge with the dimensions of the SVG when we tried
to draw a scaled SVG to the canvas. Disabling preserveAspectRatio
prevents that. Fixes part of #24.
2019-08-18 13:44:44 -07:00
Mike Welsh fecb981b13 web: Fix color transforms in Firefox
Firefox required the color matrix filter to be inside and <svg>
tag. Also, set color-interpolation-filters to sRGB to ensure
color transforms match Flash's output.
2019-08-18 13:18:22 -07:00
Mike Welsh 4666d211a7 core: Add dyn to fix Rust 1.37 warnings
Omitting dyn on trait objects now emits a warning, so add missing
dyn where necessary.
2019-08-15 13:54:20 -07:00
Mike Welsh 746b9d8518 core: Support for DefineBitsJPEG3/4
TODO: Pull out all JPEG decoding into core, remove jpeg-decoder
dependency from backend crates.
2019-08-12 16:44:49 -07:00
Mike Welsh a3998b657b core: Remove invalid JPEG data from DefineBitsJPEG
DefineBitsJPEG tags can have some extraneous bytes inside the
stream. Splice these out when decoding the JPEG.

TODO: Docs say this should only happen for SWF versions before 8?
2019-08-12 15:45:40 -07:00
Mike Welsh 23db688e6f core: Add DefineBitsLossless decoding function
Pulled out the code for decoding DefinieBitsLossless tags into
backend::render::define_bits_lossless_to_rgba. Switch to libflate
for zlib decoding.
2019-08-12 15:45:40 -07:00
Mike Welsh 1177388413 web: Dynamically resize and letterbox movie 2019-08-11 20:50:31 -07:00
Mike Welsh 2bfc8767d0 desktop: Add letterbox to viewport
Add getters to Player to allow access to the type Renderer.
Letter/pillarboxes added as window resized.
2019-08-11 18:07:02 -07:00
Mike Welsh 24fc403e06 core: Make player generic over backend 2019-08-09 22:34:15 -07:00
Mike Welsh 2accd5bdd4 core: Remove audio struct 2019-08-09 16:03:13 -07:00
Mike Welsh 3edc3c3d3e web: Disable auto-play, add click-to-play 2019-08-09 14:50:20 -07:00
Mike Welsh a2b95eb12a Fix color transforms on web
The color matrix filter was not being applied to the vector art.
2019-08-08 15:59:32 -07:00
Mike Welsh e64e306137 Rework audio to allow for streaming decoding 2019-08-08 15:59:32 -07:00
Mike Welsh 725cdae6c5 Begin AVM1 cleanup 2019-08-08 15:58:45 -07:00
Mike Welsh ce5faefe1f Work 2019-08-08 15:57:10 -07:00
Mike Welsh fd8f58c6c2 Work 2019-07-10 21:04:59 -07:00
Mike Welsh 3263255e60 Add color filter SVG as child of canvas element
Avoid adding to body, which can affect document layout.
2019-06-25 15:50:22 -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 023406aa2b web: Move requestAnimationFrame loop into Rust 2019-05-16 19:14:37 -07:00
Mike Welsh 4e3eecb016 core: Improve SVG strokes
Use stroke properties to apply stroke styles from the SWF.
2019-05-12 13:35:03 -04:00
Mike Welsh 79b3a7007d core: Initial morph shape implementation 2019-05-12 12:55:48 -04:00
Mike Welsh cc7ef196e9 web: Clean up Player interface
Use generational_arena indices for the JS-side Player handle.
2019-05-10 09:06:47 -07:00
Mike Welsh efe3270ce0 web: Decode streams completely on preload (for now) 2019-05-09 12:43:26 -07:00
Mike Welsh 62ae3b0c46 Rename project 2019-05-08 09:46:19 -07:00
Mike Welsh 67b96119e3 Fix padding on 8-bit PNGs 2019-05-07 09:51:06 -07:00
Mike Welsh 2f2f4b0c0b Quick palettized RGBA PNG support 2019-05-07 00:22:52 -07:00
Mike Welsh ebbcc828ff web: Skip SeekSamples in MP3 event sounds 2019-05-06 10:42:48 -07:00
Mike Welsh e0acb7cb30 Fix crash when drawing an empty shape in Firefox 2019-05-06 10:37:25 -07:00
Mike Welsh 61ec4b2436 web: Add player.destroy() method 2019-05-06 03:52:27 -07:00
Mike Welsh 8262db3991 ADPCM decoder 2019-05-06 02:34:45 -07:00
Mike Welsh e99b4a6fcf web: Add support for uncompressed event sounds 2019-05-05 22:13:22 -07:00
Mike Welsh cf2091477d Support uncompressed event sounds 2019-05-05 22:04:35 -07:00
Mike Welsh 4a824069af web: First pass of event sounds 2019-05-05 16:43:19 -07:00
Mike Welsh 1a4734896d Event sounds and text on web 2019-05-05 15:55:27 -07:00
Mike Welsh 2480469c2c First pass of static text 2019-05-04 11:45:11 -07:00
Mike Welsh 6e8082f01b Reorganized backend structure 2019-05-02 19:56:17 -07:00
Mike Welsh ae8df0486b Use a handle for the JS<->Rust Player object 2019-05-02 17:17:02 -07:00
Mike Welsh eb6c23d967 Work 2019-04-30 01:53:21 -07:00
Mike Welsh 663ad9f663 Work 2019-04-29 13:24:29 -07:00
Mike Welsh ee64cc77bc Reforactor 2019-04-27 23:08:59 -07:00
Mike Welsh b7ac6dc2ce Refactor 2019-04-27 18:15:43 -07:00