Commit Graph

981 Commits

Author SHA1 Message Date
dependabot-preview[bot] 353dc5c229 build(deps-dev): bump webpack from 4.41.4 to 4.41.5 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.4 to 4.41.5.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.4...v4.41.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 08:25:48 +00:00
dependabot-preview[bot] 1048170235 build(deps): bump syn from 1.0.11 to 1.0.12
Bumps [syn](https://github.com/dtolnay/syn) from 1.0.11 to 1.0.12.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/1.0.11...1.0.12)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-03 08:24:29 +00:00
dependabot-preview[bot] 861a4484a5 build(deps): bump structopt from 0.3.6 to 0.3.7
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.6...v0.3.7)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-29 23:10:17 +00:00
dependabot-preview[bot] 71ba4cb86e build(deps): bump lyon from 0.15.1 to 0.15.3
Bumps [lyon](https://github.com/nical/lyon) from 0.15.1 to 0.15.3.
- [Release notes](https://github.com/nical/lyon/releases)
- [Changelog](https://github.com/nical/lyon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/nical/lyon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-29 22:56:08 +00:00
Mike Welsh 7feddfcb03 desktop: Bump to lyon 0.15.2 (fix #196)
The new tessellator in lyon seems to fix many of the cases where
art would not tessellate correctly.
2019-12-27 17:21:48 -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
dependabot-preview[bot] db8e0bd997 build(deps): bump wasm-bindgen-test from 0.3.5 to 0.3.6
Bumps [wasm-bindgen-test](https://github.com/rustwasm/wasm-bindgen) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-23 19:39:55 +00:00
Mike Welsh 2f0963fa6c core: Fix button action with multiple conditions not firing (fix #195)
If a button event had both a keyPress condition and another
condition:

on(release, keyPress "A") { }

these actions would not fire on click, because it would still
check if the key was down (which doesn't apply to clicks!)

Fixes #195.
2019-12-22 15:55:03 -08:00
dependabot-preview[bot] 9211c7ac05 build(deps): bump structopt from 0.3.5 to 0.3.6
Bumps [structopt](https://github.com/TeXitoi/structopt) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/TeXitoi/structopt/releases)
- [Changelog](https://github.com/TeXitoi/structopt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TeXitoi/structopt/compare/v0.3.5...v0.3.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-22 22:54:14 +00:00
Nathan Adams 9000451d58 core: Implemented Mouse.show() & Mouse.hide() 2019-12-22 14:33:46 -08:00
Mike Welsh 4cdeec5b64 avm1: Fix number coercion in arithmetic ops
A lot of the arithmetic ops were still using SWFv4 style coercion
(`Value::into_number_v1`) even though they use full ECMA-262
coercion in SWF5+. This would cause `undefined` to turn into 0
isntead of NaN, for example.

Fixes disappearing player in Achievement Unlocked
(https://www.newgrounds.com/portal/view/474371)

It's possible even the older ops such as ActionAdd should do this,
too. Handcrafted bytecode will need to be used to test as you
cannot export these ops in newer SWF versions from the Flash IDE.
2019-12-22 03:01:58 -08:00
Mike Welsh c9e0bdeaf5 core: GC trace Button::object 2019-12-21 23:54:50 -08:00
Mike Welsh 1d8ae9154b tests: Add tests for AVM1 logical ops 2019-12-21 23:01:10 -08:00
Mike Welsh a4a307cf9a avm1: Use proper bool conversions for logical ops
ActionAnd, ActionOr, and ActionNot were incorrectly comparing
to 0. This only works for SWF<4. Now they all go through the
Value::as_bool method to handle version specific behavior.

Value::from_bool_v1 was also renamed to Value::from_bool.
2019-12-21 23:01:10 -08:00
Mike Welsh 00fdc74f1f tests: Add test for property updating in fast-forward gotos 2019-12-21 21:16:27 -08:00
Mike Welsh fd92bd5f78 core: Fix PlaceObject modifications in fast-forward gotos
When fast-forwarding with a goto, modifications were not taking
effect to objects that exist both in the starting and the final
frame.
2019-12-21 21:16:27 -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 3fd79a6982 chore: Rename GliumInputBackend -> WinitInputBackend 2019-12-21 19:08:06 -08:00
Nathan Adams 856a2f2910 desktop: Implemented glium based input handler for Key.isDown 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
Nathan Adams 6c484fe29d core: Changed KeyCode into an enum that maps out every Flash key code 2019-12-21 19:08:06 -08:00
Mike Welsh d7df15989f core: Clear drag if object is removed while dragging 2019-12-21 16:28:41 -08:00
Mike Welsh 531e4d640d avm1: Implement StartDrag/EndDrag 2019-12-21 16:28:41 -08:00
Mike Welsh 713e959ce4 core: Implement DisplayObject::object for Button 2019-12-21 16:28:41 -08:00
Mike Welsh 4bd54cc2ea core: Fix DisplayObject::global_to_local and local_to_global 2019-12-21 16:28:41 -08:00
Mike Welsh f2d31b222b core: Implement DefineButtonCxform SWF tag
(Although nothing uses this... it was only used in SWF version 2
and below!)
2019-12-20 19:20:25 -08:00
Mike Welsh bc872cbf9c swf: Clean up DefineButtonCxform tag 2019-12-20 19:20:25 -08:00
dependabot-preview[bot] e8e0b83d23 build(deps): bump smallvec from 1.0.0 to 1.1.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.0.0...v1.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-20 22:36:07 +00:00
dependabot-preview[bot] 4aebeab577 build(deps): bump web-sys from 0.3.32 to 0.3.33
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.32 to 0.3.33.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-20 18:36:15 +00:00
Mike Welsh 4821966898 ci: Bump to Rust 1.40 2019-12-20 01:09:23 -08:00
Mike Welsh 4026e22bbf core: Handle DefineButtonSound SWF tag
This plays sounds whenever a button is hovered/clicked. Fixes
gun sounds in Pico's School.
2019-12-20 01:08:28 -08:00
Mike Welsh cadf14f077 chore: Add .swd files to .gitignore (SWF debug symbols) 2019-12-19 17:33:27 -08:00
Mike Welsh d459bbe010 avm1: Functions store their base clip
Functions now store their base clip (the code that contains the
executing bytecode). This is because `GotoFrame` and other actions
will execute on the clip the bytecode exists on, not on `this`.

(Note that `this.gotoAndStop` uses `GetMember` actions, which
worked correctly).

`Activation` now stores `target_clip`, and `Avm1::target_clip` and
`target_clip_or_root` grab this from the current stack frame.

Renamed `start_clip` to `base_clip` to match Flash conventions.
Removed `active_clip` as this was superfluous. Now you can use
`Avm1::target_clip_or_root`.

`UpdateContext` no longer contains `target_clip` etc.
2019-12-19 17:30:50 -08:00
Mike Welsh c4b446ff78 tests: Add test for functions closing over base clip 2019-12-19 17:30:50 -08:00
Mike Welsh 13c43ed171 tests: Update movieclip_hittest to verify points are in root coordinates 2019-12-19 12:35:56 -08:00
Mike Welsh 540b03090a avm1: hitTest point is actually in root coordinates (fix #185) 2019-12-19 12:35:56 -08:00
Nathan Adams f6f358b4de avm1: Expose TextFields and allow setting their .text 2019-12-19 10:19:43 -08:00
dependabot-preview[bot] f84bfae010 build(deps-dev): bump webpack-dev-server in /web/selfhosted
Bumps [webpack-dev-server](https://github.com/webpack/webpack-dev-server) from 3.9.0 to 3.10.1.
- [Release notes](https://github.com/webpack/webpack-dev-server/releases)
- [Changelog](https://github.com/webpack/webpack-dev-server/blob/v3.10.1/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-dev-server/compare/v3.9.0...v3.10.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-19 09:29:07 -08:00
Mike Welsh c9a5d2dbb3 chore: Fix clippy lints in 1.40 2019-12-19 09:10:41 -08:00
dependabot-preview[bot] d1f258e71e build(deps-dev): bump webpack from 4.41.3 to 4.41.4 in /web/selfhosted
Bumps [webpack](https://github.com/webpack/webpack) from 4.41.3 to 4.41.4.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v4.41.3...v4.41.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-19 16:21:31 +00:00
Nathan Adams d3848f97ea avm1: Implemented MovieClip.hittest, without shape flag 2019-12-18 15:21:14 -08:00
Nathan Adams 5f6eea6f25 chore: Refactor system listeners into a reusable system 2019-12-18 15:15:56 -08:00
Mike Welsh 3a8256a993 avm1: Allow setting _name 2019-12-18 14:07:32 -08:00
Mike Welsh 9079b69991 avm1: Push Undefined when trying to construct invalid object 2019-12-18 13:47:01 -08:00
Mike Welsh bb6a4c119c avm1: Warn and clear operand stack if not empty after execution
Add a check and clear the stack if it isn't empty at the end of
`run_stack_till_empty`. This is probably a bug on our side
and we a good place for breakpoints.
2019-12-18 13:47:01 -08:00
Mike Welsh 8b9aedc4c8 avm1: Fix extra stack frame in event handlers
When running an clip event handler (e.g. onEnterFrame), a stack
frame is pushed to get the property value. However, this frame
was causing an extra Undefined to be pushed on the operand stack in
`Avm1::retire_stack_frame`, which would blow out the stack.

Now this stack frame is popped after the property is resolved and
before the function is executed. The function will push its own
stack frame when it executes.
2019-12-18 13:47:01 -08:00
Mike Welsh 3e003ed9dd avm1: Add missing stage.rs 2019-12-17 22:36:53 -08:00
Mike Welsh 3ebc1ed928 avm1: Stub out Stage properties
This is a very rough stub out of Stage.width and height to get
basic V-cams to start functioning.

TODO: Implement the different stage scaling modes. We will probably
want to add a "Stage" display object to handle this.
2019-12-17 22:28:44 -08:00