Callum Thomson
046514eeb9
avm1: Enumerate should push Undefined if the target isn't an object
2022-08-26 14:01:42 -07:00
Aaron Hill
249648674c
Fix bounds computation
2022-08-26 13:04:01 -07:00
Aaron Hill
5fb95e6961
Use round-to-even for scrollRect
2022-08-26 13:04:01 -07:00
Aaron Hill
fa0c843a4d
avm2: Implement DisplayObject.scrollRect
...
This property causes a DisplayObject to be both translated
and cropped.
2022-08-26 13:04:01 -07:00
relrelb
72d8c152b9
core: Make `Player::load_device_font` infallible
...
It is always called with the same known data, which should parse
successfully.
2022-08-26 12:24:15 -07:00
relrelb
ad84c2bbcb
avm2: Rename `Avm2::load_abc` to `Avm2::do_abc`
...
This aligns with the name of `DoAbc` tags.
2022-08-26 11:37:04 -07:00
relrelb
ad91992cb5
swf: Simplify `DoAbc` tag handling
...
Extract `swf::Reader::read_do_abc()` which, as the name suggests,
reads a `DoAbc` tag, and use it before calling to `Avm2::load_abc`.
Finally, introduce `DoAbcFlag` using `bitflags`.
This greatly simplifies the ABC loading code.
2022-08-26 11:37:04 -07:00
EmperorBale
18bd7879e5
core: Add better error message when java could not be found
2022-08-26 10:11:35 +02:00
Aaron Hill
c4157fd0ce
Miscellaneous stubs
...
This gets Solarmax to the main level select screen
(once BitmapData.draw support is added)
2022-08-25 19:57:03 -07:00
Aaron Hill
61d0f73fdb
core: Use catchup_display_object_to_frame in Loader
2022-08-25 19:24:56 -06:00
David Wendt
2c93da9a70
docs: Add comments documenting subtle points of AS3 loop & tag queueing behavior
2022-08-25 19:24:56 -06:00
David Wendt
074f2ff76f
core: Replace `Vec` of queued tags with a more restrictive enum that enforces our queueing invariants
2022-08-25 19:24:56 -06:00
David Wendt
59623a8452
core: Fix a potential stack overflow caused by gotos triggering frame scripts on one another.
2022-08-25 19:24:56 -06:00
David Wendt
05caa0fceb
core: Explicit gotos drain the tag queue of any prior operations.
...
This is in keeping with the whole idea of a "recursive frame": gotos run the entire frame lifecycle on the target clip, including broadcasts for `frameConstructed` and `exitFrame`.
2022-08-25 19:24:56 -06:00
David Wendt
6f0de246ed
core: Clear queued tags if AS3 attempts a goto in the middle of a loop.
2022-08-25 19:24:56 -06:00
David Wendt
ed28578c12
core: Fast-forwarding gotos should run frame scripts on all removed children
2022-08-25 19:24:56 -06:00
David Wendt
bcb1030883
core: Only `Construct` and `Enter` phases want forced script frames on gotos
2022-08-25 19:24:56 -06:00
David Wendt
3677a0107b
core: Only force-queue frame scripts if the goto is not a no-op.
2022-08-25 19:24:56 -06:00
David Wendt
ac2b82f26e
core: Gotos *always* queue the target frame's scripts on the target clip, even if we already executed that script beforehand.
2022-08-25 19:24:56 -06:00
David Wendt
9bff6406d1
core: Allow queueing both a remove and a place tag at the same depth, in that order only.
2022-08-25 19:24:56 -06:00
David Wendt
2929681a93
core: No-op gotos should be treated as rewinding.
2022-08-25 19:24:56 -06:00
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
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
=
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
=
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
=
5b5ee7d448
core: Made audio backend use actual real error enums, and not box<error>
2022-08-25 23:43:21 +02:00
=
2d2869f44f
core: Font::from_swf_tag is currently infallible, remove error path
2022-08-25 23:43:21 +02:00
=
1df8de5bac
core: set_text and set_html_text are currently infallible, remove error path
2022-08-25 23:43:21 +02:00
Mike Welsh
78247a37ab
avm1: Load correct _root and _parent registers if base clip is removed
...
Normally a function closures also closes around its base clip.
If the base clip is removed, and then the function is executed, the
base clip then defaults to `this`.
However, Ruffle was incorrectly using the wrong base clip when
loading the `_root` and `_parent` registers in this case.
Fixes #5645 .
2022-08-25 00:01:02 -07:00