David Wendt
7a09bbfaab
core: In AVM2, run removals before frame advance.
...
We still retain the queue system as events are fired at removal time, and those events can trigger more gotos. If such a goto happens, AS3 code will hit a clip still in the old state rather than an inconsistent one. I don't have test coverage for this exact scenario just yet.
2022-08-25 19:24:56 -06:00
David Wendt
d691543c4c
core: Child removals appear to resolve in reverse render order.
2022-08-25 19:24:56 -06:00
David Wendt
8feb3fc7b0
core: Fast-forward removals as the result of a goto happen before the frame number advances.
2022-08-25 19:24:56 -06:00
David Wendt
66c24ff188
core: Queue new object placement at loop time on the tag queue.
2022-08-25 19:24:56 -06:00
David Wendt
0353d176e4
core: Movie clip rewinds should not remove any children until after the new timeline position has been set.
2022-08-25 19:24:56 -06:00
David Wendt
99003643ac
core: Same-frame gotos should only proceed on AVM2.
2022-08-25 19:24:56 -06:00
David Wendt
cdfc6f5eae
core: Explicit gotos must run even if they are no-ops.
2022-08-25 19:24:56 -06:00
David Wendt
cb86340fb1
core: `frameConstructed` during a goto fires after the goto commands have fully completed.
2022-08-25 19:24:56 -06:00
David Wendt
51401ae660
core: Remove AVM2 compatibility hacks surrounding place frame.
...
They are no longer needed, frame advance happens at enterframe time.
2022-08-25 19:24:56 -06:00
David Wendt
1eef8a47c9
core: Movie clips run all their tags at `enter_frame`, and place/remove actions are queued until later.
...
This prevents repeated place/remove actions at the same depth from resulting in repeated event dispatches.
2022-08-25 19:24:56 -06:00
David Wendt
963144e59c
core: Centralize all the various calls to `enter_frame`/`construct_frame` into a single method, `catchup_display_object_to_frame`.
...
The rationale for the catch-up logic is as follows:
* We must always enter-frame and construct objects, even if those respective display events haven't happened yet.
* Display objects created in event handlers still need to run catchup phases, otherwise they will tag-stream desync
* Frame scripts are never triggered by catchup phases
* `exit_frame` is not a catchup phase as it is *only* an event broadcast currently
2022-08-25 19:24:56 -06:00
David Wendt
0400d4dee4
core: `Player` should start in the `Idle` phase
2022-08-25 19:24:56 -06:00
David Wendt
f0ef8adb42
core: Add a new frame phase to represent non-frame work such as input event handlers.
2022-08-25 19:24:56 -06:00
David Wendt
ae530b5d6b
core: Track what part of the frame processing loop we're in
2022-08-25 19:24:56 -06:00
David Wendt
ee2454e09f
core: Frame actions should start with `enterFrame`; not `exitFrame`.
2022-08-25 19:24:56 -06:00
David Wendt
1f0b8bdda4
core: In AVM2, movie clips process `RemoveObject` before any other frame actions are done.
2022-08-25 19:24:56 -06:00
David Wendt
318b018da8
core: `enter_frame` should be an event that all display objects get and can respond to
2022-08-25 19:24:56 -06:00
David Wendt
beb0545b11
tests: Add tests for gotos interacting with frame scripts.
2022-08-25 19:24:56 -06:00
David Wendt
6569edda88
tests: Add a goto-and-stop test that inspects the children after the goto.
2022-08-25 19:24:56 -06:00
David Wendt
c3add3db93
tests: Ignore the `as3_simplebutton_constr_childevents` test as it is broken by fixes I moved to another PR
2022-08-25 19:24:56 -06:00
David Wendt
38f28ce80c
tests: Add a second, more thorough `clickgoto2` test
2022-08-25 19:24:56 -06:00
David Wendt
f16b76866a
tests: Add timeline and stage manipulation tests at user event time.
2022-08-25 19:24:56 -06:00
David Wendt
81eb5ed8ac
tests: Add tests for symbol instantiation in `enterFrame`, `exitFrame`, and `frameConstructed`
2022-08-25 19:24:56 -06:00
David Wendt
27d509f169
tests: Extend the goto tests with more non-looping jumps
2022-08-25 19:24:56 -06:00
David Wendt
4d3788bfe1
tests: Add tests for AS3 gotos during `enterFrame`, `frameConstructed`, and/or `exitFrame`
2022-08-25 19:24:56 -06:00
David Wendt
c10417ddb8
tests: `as3_movieclip_displayevents_timeline` should log events on the root movie clip too
2022-08-25 19:24:56 -06:00
David Wendt
f1d203311f
tests: `as3_movieclip_displayevents_looping` should have a `RemoveObject` in it
2022-08-25 19:24:56 -06:00
David Wendt
ee1f39bba7
tests: `as3_movieclip_displayevents_xyzframeplay` tests should also list what children are on the timeline
2022-08-25 19:24:56 -06:00
David Wendt
b3793f9b4c
tests: Oops, forgot to recompile the exitframe play test.
2022-08-25 19:24:56 -06:00
David Wendt
10955c3a03
tests: Add tests for playing and pausing a movie clip in `enterFrame`, `frameConstructed`, and `exitFrame`
2022-08-25 19:24:56 -06:00
David Wendt
795dafa46a
tests: Fix the test output for `as3_movieclip_displayevents_dblhandler`.
...
The test output for this test is sensitive to where we cut off each frame, because it doesn't stop all of it's handlers at the end of the test. Flash Player will just print lines forever so the end of the test is entirely arbitrary.
2022-08-25 19:24:56 -06:00
David Wendt
1a4b977325
tests: `as3_movieclip_displayevents_timeline` now explicitly winds a clip back and forth to better demonstrate a bug I ran into with frame numbering
2022-08-25 19:24:56 -06:00
David Wendt
0c18e8e99a
tests: Log `this.currentFrame` on every event watcher we can.
2022-08-25 19:24:56 -06:00
David Wendt
72f878bb9d
tests: Add a test for the order of events surrounding `gotoAndStop`
2022-08-25 19:24:56 -06:00
relrelb
d152cc3e64
avm2: Port `Math` to ActionScript
2022-08-25 16:03:08 -07:00
relrelb
4e9cc919a1
avm2: Fix bindings of empty namespace
...
Previously native functions defined inside a `package {}` block
(without a package name) would cause a syntax error by two consecutive
`::`.
2022-08-25 16:03:08 -07:00
Aaron Hill
91247f5779
tests: Only require `ruffle_render_wgpu` dependency with 'imgtests'
...
This should speed up developer workflows when working on non-image
related changes. CI will still run all image tests.
2022-08-25 15:11:18 -07:00
=
211a64b402
webgl: Replace Box<dyn Error> with actual Error enum
2022-08-25 23:43:21 +02:00
=
620820be9e
core: Replaced tag_utils Error with an actual Error enum
2022-08-25 23:43:21 +02:00
=
67eb34fbc5
core: Remove Error from player.rs, it wasn't needed
2022-08-25 23:43:21 +02:00
=
b7dcd26c38
core: Use Cow<str> for FullscreenError in UI backend, as it can't ever be anything else
2022-08-25 23:43:21 +02:00
=
1c7bfd8c5f
core: Use real Error enums for video backend
2022-08-25 23:43:21 +02:00
=
17f261fc1f
wgpu: Descriptors::new is infallible, removed error path
2022-08-25 23:43:21 +02:00
=
b29b30de58
wgpu: Pipelines::new is infallible, removed error path
2022-08-25 23:43:21 +02:00
=
201ed60d67
canvas: Removed generic error, was never actually used - just an Option worked better
2022-08-25 23:43:21 +02:00
=
461c977be0
render: unregister_bitmap is infallible, removed error path
2022-08-25 23:43:21 +02:00
=
03eb769a33
render: Made render use a real Error enum and not generic box<error>
2022-08-25 23:43:21 +02:00
=
726217c6c2
desktop: Use anyhow to replace generic errors with more meaningful ones
2022-08-25 23:43:21 +02:00
=
30e7d23cc0
desktop: Use anyhow errors for desktop audio errors
2022-08-25 23:43:21 +02:00
=
0084991e58
web: Replaced generic error in audio with JsError, as it's the only one thrown
2022-08-25 23:43:21 +02:00