Commit Graph

5543 Commits

Author SHA1 Message Date
Nathan Adams c9d0a08863 core: Move debug children list's button into header 2023-06-03 09:11:06 +02:00
Nathan Adams 9f384df27b core: Don't have dynamic_root in UpdateContext unless egui feature is enabled 2023-06-03 09:11:06 +02:00
Nathan Adams a641c564de core: Show debug rect on hovering stuff 2023-06-03 09:11:06 +02:00
Nathan Adams 16ce9aa437 core: Add debug rects to debugger 2023-06-03 09:11:06 +02:00
Nathan Adams a6b8883acd core: Add mask/masker/clip info to debug UI 2023-06-03 09:11:06 +02:00
Nathan Adams 59eceb8b7a core: Add AVM1 path to debug UI 2023-06-03 09:11:06 +02:00
Nathan Adams 77bd1cd1c8 core: Add depth and color transform to debug ui 2023-06-03 09:11:06 +02:00
Nathan Adams e12e2a2e54 core: Initial Debug UI 2023-06-03 09:11:06 +02:00
Nathan Adams eb70a4f361 core: Update gc_arena to 63dab12871321e0e5ada10ff1f1de8f4cf1764f9 2023-06-03 09:11:06 +02:00
Aaron Hill 2cd518013c
wgpu: Don't skip alpha/erase blend modes for BitmapData.draw (#11323)
We can skip these when we're drawing to a fresh buffer, but not when we're blending over an existing BitmapData texture.
2023-06-02 21:16:05 +00:00
relrelb e5da68c1df avm1: Migrate `ConvolutionFilter` to `NativeObject` 2023-06-02 23:39:02 +03:00
Aaron Hill 21429cc205 avm2: Add PixelBender bytecode parsing to ShaderData
We now parse PixelBender bytecode, and populate the parameters
from the bytecode on `ShaderData`. This is enough to progress
Steamlands, which needs to access dynamically set properties
on `ShaderData`

Bytecode execution is not implemented yet.
2023-06-02 15:23:32 -05:00
Aaron Hill 999e2f5b71 wgpu: Implement Context3D.setScissorRectangle 2023-06-02 14:56:14 -05:00
relrelb abb0e33431 chore: Use Rust's `OnceCell`/`OnceLock`
They were stabilized in Rust 1.70.0, which was released yesterday.
This removes the `once_cell` dependency.
2023-06-02 22:21:38 +03:00
Lord-McSweeney 5fdbfe2fd4 avm2: Partial implementation of Loader.unload 2023-05-31 21:03:18 -05:00
Aaron Hill 8b257ef6da avm2: Always run `construct_frame` in `initialize_for_allocator`
When we create a DisplayObject from ActionScript, we should always
run `construct_frame` on it, regardless of what frame phase we
are currently in.

This fixes a regression in Fancy Pants World 4 Part 1, where entering
the first door produced an error.
2023-05-31 17:33:25 -05:00
Crowdin Bot 6dc3743f4b chore: Update translations from Crowdin 2023-05-30 23:21:28 +02:00
relrelb c952106ee3 avm1: Correct `ActionCloneSprite` and `duplicateMovieClip()`
* `ActionCloneSprite` coerces `depth` before `target`.
* `duplicateMovieClip()` coerces `name` before `depth`.
* `duplicateMovieClip()` returns `undefined` on SWF<6.
2023-05-30 23:10:36 +03:00
Nathan Adams 0c10e2a7b7 desktop: Add advanced open dialog 2023-05-29 22:12:56 +02:00
TÖRÖK Attila b8fc64df6f core/avm1: Accept Value as smaller than 16 bytes on 32 bit platforms. 2023-05-29 07:58:53 -05:00
renovate[bot] 847dece735 chore(deps): lock file maintenance rust dependencies 2023-05-28 23:54:33 -05:00
Aaron Hill 0955ab40e6 avm2: Fix rounding behavior in BitmapData rectangle operations
Flash Player performs `x + width` and `y + height` as floating
point operations before `round_to_even`. This affects the extent
covered by a `Rectangle` in various BitmapData methods, as the sum
of two values might be large enough to be rounded up to a larger
value (when rounding `x` and `width` individually would have
produced a smaller overall extent).
2023-05-28 18:46:55 -05:00
Aaron Hill 2ae15b05e8 core: Store Color as an u32 instead of a i32
This is a packed ARGB value, so it doesn't make sense for it to be
signed.
2023-05-28 16:52:09 -05:00
Aaron Hill 3f93abffd5 avm2: Allow replacing and deleting XML attributes 2023-05-28 15:52:57 -05:00
Aaron Hill 14c6d1d959 avm2: Implement URLRequest.requestHeaders
These are directly set on the underlying navigator's HTTP
request type, and get printed out in our test navigator backend.

No validation of the header names is performed - on web, this will be
enforced by the browser.
2023-05-28 12:07:37 -05:00
relrelb ee30646745 avm1: Migrate `DisplacementMapFilter` to `NativeObject` 2023-05-27 23:08:42 +03:00
Lord-McSweeney 420643b045 avm2: Stub Worker 2023-05-27 00:58:34 -05:00
Nathan Adams aeb089ac0f avm2: Move DisplayObject assignment into an initializer 2023-05-26 22:06:20 -05:00
Aaron Hill cf4ca543bd core: Use clone-on-write behavior for render list iteration
When we iterate over a render list (in order to call
`enter_frame`, `construct_frame, etc.) we need to be sure
that we iterate over all of the original `DisplayObjects`
in the list, even if the list is modified during iteration
(e.g. some ActionScript code calls `parent.addChildAt`).

Previously, `RenderIter` would repeatedly call `child_by_index`
on the original `DisplayObjectContainer`, up to the original
child count. If new DisplayObjects were inserted into the list
during iteration, we could miss some of the original DisplayObjects
in the list (as they are now at a greater position in the list).

To solve this, we now store the render list as an `Rc<Vec>`,
and use `Rc::make_mut` to modify it. See the comments
for more details.
2023-05-26 21:42:06 -05:00
Crowdin Bot e98230c988 chore: Update translations from Crowdin 2023-05-27 00:34:44 +02:00
Aaron Hill 9fad8ddd9d core: Fix nightly clippy lints 2023-05-26 17:06:28 -05:00
Aaron Hill e98ff6a6d7 avm2: Add legacy handling for configureBackBuffer with SWF version < 30
With SWF version < 30, Context3D.configureBackBuffer throws
an error with a less informative message when the width/height
are out of range. Additionally, it seems to special case
the case width=0, height=0, antiAlias=0. enableDepthAndStencil=false,
and does *not* throw an error. This is relied on by Sniper Team.
2023-05-24 18:15:30 -05:00
Adrian Wielgosik a1797a351d avm2: Avoid a function call on every push() 2023-05-24 23:33:09 +02:00
Aaron Hill 9a1a21ef3a avm2: Implement Stage3D.visible 2023-05-24 14:20:40 -05:00
MartySVK 3be933d7c2
avm2: Stub ContextMenu.builtInItems setter (#11187) 2023-05-24 01:50:03 +00:00
iwannabethedev 1e0714aaa1 core: Fix serialization of arrays with dynamic properties. 2023-05-23 19:46:24 -05:00
iwannabethedev 83520d0daf avm2: Minor refactoring of duplicated code. 2023-05-24 02:30:52 +02:00
Aaron Hill 358beabf5a avm2: Add Matrix3D.[recompose,decompose,copyColumnTo,invert,determinant]
The Flash Player 'Matrix3D.recompose' method throws exceptions under
certain circumstances with the "quaternion" orientation style.
I haven't yet figured this out yet, so I've marked that case as a stub.

All of the implementations are based on the OpenFL code, with some
tweaks to match Flash Player's behavior.
2023-05-23 18:51:46 -05:00
Aaron Hill c53a903d35 avm2: Suppress events for selectable was_static TextFields
TextFields have a very unusual behavior - if they are selectable
and have `was_static`, they *block* the dispatch of mouse events when
they're targeted (not even the Stage will receive the event).
This only occurs when the TextField is actually targeted
(which requires mouseEnabled=true). With mouseEnabled=false,
the event will be dispatched with an ancestor as the target,
following the usual logic.

Also, TextFields now properly propagate mouse picks to
their parent if mouseEnabled=false. Previously, setting
mouseEnabled=false for a TextField made all mouse picks
cause a miss on it. This was the cause of the Turbo Kids
regression.

Fixes #10245
2023-05-23 17:57:06 -05:00
Nathan Adams afa78ebdfe avm1: Correctly send onUnload events for movies unloaded with GetURL2 - fixes #2422 2023-05-22 23:41:41 +02:00
Aaron Hill ace87861ce avm2: Make ByteArray.readMultiByte cut string off at null byte
We already had this behavior in `readUTF` and `readUTFBytes`,
but we need it in `readMultiByte` as well.
2023-05-22 16:01:50 -05:00
Aaron Hill b94f9f3043 avm2: Coerce function return value to declared return type
This can actually affect runtime behavior - if the return type is
declared as 'int', then an instance of a custom class will get
coerced to 0 when returned by the function.
'Plants vs Zombies Demo' relies on this - it has a function which
incorrectly returns an object instead of an array index, but the
value gets silently coerced to 0 under Flash Player.
2023-05-22 13:47:32 -05:00
renovate[bot] 5d2477fe98 chore(deps): lock file maintenance rust dependencies 2023-05-22 19:12:08 +03:00
nosamu bb15c90d82 avm2: Implement XML.hasSimpleContent and hasComplexContent 2023-05-22 06:17:37 -05:00
Aaron Hill 6ac4e5256d avm2: Check parent domain in export_class
The `export_class` function mirrors `export_definition`, and needs
to avoid exporting something already defined in a parent domain.
2023-05-21 17:37:54 -05:00
relrelb c230dcf0f8 avm1: Migrate `BitmapData` to `NativeObject` 2023-05-21 21:02:14 +03:00
nosamu 7dfc36c6fc web: Support pasting from clipboard 2023-05-21 15:26:42 +02:00
nosamu ee956927b7 core: Fix TextField.maxChars handling and address other reviews 2023-05-21 15:26:42 +02:00
nosamu 4e579b7e68 core: Move left/right arrow handling to `text_control_input` 2023-05-21 15:26:42 +02:00
nosamu 0dbb4c46e4 core: Move `Delete` and `Backspace` handling to `text_control_input()`
Co-authored-by: jmckiern <jmckiern@tcd.ie>
2023-05-21 15:26:42 +02:00