Tom Schuster
499dfc8990
avm2: Partially implement FileReferenceList with a single FileReference
2024-01-25 19:10:56 +01:00
Aaron Hill
bb9e7c04f7
avm2: Fix handling of Loader.loadBytes for images
...
I've switched back to the original code for creating
the bitmap/bitmapdata, rather than relying on custom
initialization logic that we only used in loader.
To make sure that the Bitmap/BitmapData are only exposed
to ActionScript at the correct time, I've added a new flag
to control when 'LoaderInfo.content' becomes non-null
2024-01-25 10:35:28 -05:00
Lord-McSweeney
38d58552f2
nit: Fix some minor capitalization mistakes
2024-01-25 08:05:48 +01:00
Aaron Hill
820e7e828a
wgpu: Allow Stage3D texture upload where source is smaller than dest
...
Fancy Pants World 4 relies on this behavior.
2024-01-25 00:30:10 +01:00
Aaron Hill
1cb24b41b0
render: Support PixelBender ByteArray/Vector.<Number> input/output
...
When ActionScript uses a ByteArray/Vector.<Number> as a shader input
or target, we create a temporary Rgba32Float texture, and copy the
input float32 bytes to/from the texture.
Unfortunately, wgpu doesn't seem to support an Rgb32Float (3-channel)
texture. When the shader uses 3 channels, we use a Rgba32Float
(4-channel) texture, and manually insert/remove padding for the
alpha channels. This isn't very efficient, but it's the simplest
solution.
The temporary textures themselves aren't cached anywhere - if this
becomes a performance issue, we could look into using some of our
existing wgpu texture/buffer pooling code.
2024-01-24 08:31:52 -05:00
Moulins
5f83b45692
avm2: Add `Avm2Button::all_state_children` to centralize button child ordering
2024-01-23 22:43:13 +01:00
Moulins
e014d7c023
avm2: Use inner mutability instead of `GcCell` in `Avm2Button`
2024-01-23 22:43:13 +01:00
Moulins
d1cbe46e25
avm1: Use inner mutability instead of `GcCell` in `Avm1Button`
2024-01-23 22:43:13 +01:00
Tom Schuster
07afb04896
avm2: Fix FileFilter description getter
2024-01-23 18:43:36 +01:00
Tom Schuster
3ddf0aec28
avm2: Implement FileReference save
2024-01-23 18:43:36 +01:00
Tom Schuster
9101ab322e
avm2: Implement flash.net.FileReference size
2024-01-23 18:43:36 +01:00
Tom Schuster
c73be131f0
avm2: Implement flash.net.FileReference name
2024-01-23 18:43:36 +01:00
Tom Schuster
fff841a22e
avm2: Implement FileReference browse
2024-01-23 18:43:36 +01:00
Tom Schuster
e7b8b75d07
avm2: Basic FileReference object boilerplate
2024-01-23 18:43:36 +01:00
Aaron Hill
dbcefd060f
debug_ui: Add 'Show Domains' menu to view domains and classes
...
This opens a searchable list (similar to what we have for display
objects), which shows a tree of Domains and their associated classes.
Currently, clicking on the domain/class buttons doesn't do anything.
In a follow-up, I'm planning to add additional windows to display
information about a class.
2024-01-23 11:34:14 +01:00
Lv Yitian
bebadb450f
avm2: Make `flash.system.Capabilities#playerType` return "Desktop" within the AIR runtime
...
Unless the SWF is loaded by an HTML page.
2024-01-23 07:45:11 +00:00
Aaron Hill
c1fce1106f
swf: Parse string as Vec<u8> instead of String in SWF
...
Some obfuscated SWFs may have invalid strings in their constant
pool - trying to immediately parse them as a utf-8 String throws
away information. Instead, we now store a `Vec<u8>`, which we
then use to construct an `AvmString` (or with `String::from_utf8_lossy`
for debug printing).
2024-01-22 21:50:45 -05:00
Aaron Hill
8dbcfe26f9
core: Display image load when using Loader.loadBytes
...
The handling of images in Loader.loaderBytes is similar to
the handling of SWFs - some of the data is exposed immediately
following the 'Loader.loadBytes' call, but the DisplayObject isn't
loaded until later.
2024-01-22 19:35:08 -05:00
Tom Schuster
173efbb77a
avm2: Stub flash.desktop.Clipboard
2024-01-22 23:37:22 +01:00
sleepycatcoding
1804c23b93
avm2: Fix `Error.toString` regression
...
This was introduced by #14897 , and to make sure this won't happen again I added a test.
Fixes #14901 .
2024-01-22 19:34:12 +01:00
sleepycatcoding
2057417824
avm2: Implement `Error.prototype.toString`
...
And remove `ErrorObject::to_string` implementation. This fixes a few avmplus tests.
2024-01-22 15:09:55 +01:00
renovate[bot]
262dff83a4
fix(deps): update rust dependencies
2024-01-22 03:09:33 +01:00
cmdocmd
c6331113ed
avm2: Stub `flash.text.engine.TextLine.getAtomIndexAtCharIndex`
2024-01-21 22:09:39 +01:00
Tom Schuster
ab99eb3e09
avm2: Only lookup own properties in flash.net.getClassByAlias
2024-01-21 17:23:29 +01:00
cmdocmd
5cf9e00f9c
avm2: Stub XML::inScopeNamespaces
2024-01-20 14:27:27 -08:00
nosamu
379bed891f
core: Invalidate cached bitmap on state change in AVM2Button
2024-01-20 11:53:19 +01:00
nosamu
284489b721
avm2: Stub Stage colorCorrection and colorCorrectionSupport
2024-01-20 11:35:28 +01:00
Tom Schuster
c9c1326d13
avm2: Allow TLF to use embedded fonts when requested
2024-01-19 23:14:58 +01:00
Tom Schuster
0a6cf92a53
core: Implement DefineFont4
2024-01-19 23:14:58 +01:00
Tom Schuster
e0f5b8906d
desktop: Support device font with a non-zero index
2024-01-19 19:21:48 +01:00
Adrian Wielgosik
11fe70ab65
avm2: Fix possible overflow in address calculations
2024-01-18 23:35:03 +01:00
Tom Schuster
28b20322f0
avm2: Assume we have the default public namespace when matching XML names
2024-01-18 16:31:00 +01:00
TÖRÖK Attila
9aff953163
core: Make `Player::mutate_with_update_context` public
2024-01-18 09:00:40 +01:00
TÖRÖK Attila
d153290fd6
nits: Fix a whole bunch of typos all over the place
2024-01-17 23:59:19 +01:00
Daniel Jacobs
8f2292c2c7
core: Add error for loading invalid SWF files and display as appropriate
2024-01-17 17:38:47 -05:00
Daniel Jacobs
5765177ba7
web: Properly panic when loading invalid SWF files ( fix #14665 )
2024-01-17 17:38:47 -05:00
Aaron Hill
97f868b8d5
avm2: Don't hold GcCell read ref open for Loader.loadBytes
...
We were holding this open while dispatching an event,
leading to a panic if anything attempted to modify the
ByteArray.
2024-01-17 17:05:52 -05:00
Tom Schuster
b54a807b37
avm2: Handle explicitly imported/used namespace for XML lookup
...
Fixes #14792
2024-01-17 21:11:25 +01:00
Aaron Hill
6c420fa5d5
avm2: Run most of Loader.loadBytes immediately
...
This requires moving `set_root_movie` into `UpdateContext`.
Now, we preload the entire movieclip immediately - Flash Player
does this regardless of the size of the SWF.
The 'Loader::load_complete' is delayed to the end of the frame
(which is when the root class is constructed for the loaded clip).
2024-01-17 00:53:08 +01:00
Nathan Adams
f65060e8c9
desktop: Update winit to 0.29.10 and egui to 0.25.0
2024-01-16 21:10:36 +01:00
zhenghaoz
5169d9db3d
avm2: Fix multiply with overflow in `string_to_f64`
2024-01-15 23:44:14 -05:00
Lord-McSweeney
9637682216
avm1: Correctly access topmost `LoaderDisplay` or `Stage` instead of accessing the parent of `avm1_root`
...
This fixes a case where `lockRoot` is involved.
2024-01-15 17:15:36 -08:00
Tom Schuster
1b5eb2e8e2
avm2: Stub XML::namespaceDeclarations
...
Improves #14734
2024-01-15 19:50:09 -05:00
renovate[bot]
3c115238fd
fix(deps): update rust dependencies
2024-01-16 01:13:38 +01:00
sleepycatcoding
5b19ecec97
avm2: Implement XML.setLocalName
2024-01-15 23:53:17 +01:00
renovate[bot]
e0a22b56ce
fix(deps): update wasm-bindgen
2024-01-15 17:24:02 -05:00
Abiel Deneke
df3a033b77
avm2: Stub Accelerometer.isSupported
2024-01-15 22:10:58 +01:00
Kamil Jarosz
5bd643cd4f
core: Improve caret blinking behavior
...
Caret now blinks only when idle.
2024-01-15 08:20:22 +01:00
nosamu
a638715bd8
avm2: Throw null param error in navigateToURL
...
Fixes #14733
2024-01-14 20:17:31 +01:00
Aaron Hill
3cbfbdd4a6
avm2: Add weird parse-as-uint special case to Object keys
...
When handling dynamic properties, avmplus will always try to
parse the string key name as a uint. If it succeeds, then the
key will be stored internally as a integer (via Atom), which is
observable by property iteration. The intention appears to have
been to support `obj[25] = someVal`, but it causes `obj["25"]`
and `obj[25]` to map to the same key (though iterating over the
object's keys will always produce a `number`).
2024-01-13 19:47:58 -05:00
TÖRÖK Attila
55cdfab3d3
avm2: Add API versioning to DisplayObjectContainer
2024-01-13 19:35:54 +01:00
TÖRÖK Attila
4c1d59c4a3
avm2: Cleanup: Make `Domain::get_class` not return a `Result`
...
As it was always the `Ok` variant anyway.
2024-01-13 11:53:35 -05:00
Aaron Hill
195822885e
avm2: Stub all remaining TextField methods and properties
2024-01-12 20:42:18 -05:00
Aaron Hill
639d17d259
Apply 'xml["@myattr"]' logic when setting/deleting properties
...
We previously only applied this when getting properties.
2024-01-12 19:13:35 -05:00
sleepycatcoding
2775c917bf
avm2: Correctly handle `@*` in string_to_multiname
2024-01-13 00:27:28 +02:00
Tom Schuster
79c5112f45
core: Provide a better fallback for Ming typefaces
2024-01-12 21:59:20 +01:00
Kamil Jarosz
70486465e8
core: Support TextField.restrict when pasting
2024-01-11 23:22:49 +01:00
Kamil Jarosz
2ef63d3a61
avm2: Implement TextField.restrict
2024-01-11 23:22:49 +01:00
Kamil Jarosz
1c15cd55b9
avm1: Implement TextField.restrict
2024-01-11 23:22:49 +01:00
Kamil Jarosz
43d4c26b77
core: Implement restrict for EditText
...
EditTextRestrict models the `restrict` property, which is used
to specify which characters the user is allowed to type.
2024-01-11 23:22:49 +01:00
Kamil Jarosz
5ece6981ce
core: Fix caret and selection rendering
...
This commit fixes issues with caret and selection rendering:
1. They had the wrong height and were rendered lower than expected
for some fonts and sizes.
2. The caret was not being rendered at all when there was no text,
but only when the text was set earlier and then deleted.
3. The selection was rendered with translate_x=-1,
which caused overlap over some glyphs.
2024-01-11 23:04:02 +01:00
Nathan Adams
e993f5ce46
core: Support F13..F24 keys
2024-01-11 22:40:37 +01:00
Tom Schuster
7498ed51d8
core: Font kerning is in points not pixels
2024-01-11 21:39:17 +01:00
Tom Schuster
ae8c0148c2
core: Use sans instead of serif when missing a font
2024-01-11 10:35:47 +01:00
Kamil Jarosz
5feafb2ca3
avm1: Add support for onSetFocus & onKillFocus
...
Methods `onSetFocus` & `onKillFocus` are invoked when focus is changed
for `TextField`, `Button`, and `MovieClip`.
Multiple SWFs use these methods to listen to a focus change,
e.g. in order to implement placeholders for text fields.
2024-01-10 21:59:25 -05:00
Aaron Hill
c01ab53d2e
avm2: Stub flash.text.engine.GraphicElement
2024-01-10 21:29:33 -05:00
Aaron Hill
db623a90e8
avm2: Stub TextField.getCharBoundaries
2024-01-10 20:35:29 -05:00
sleepycatcoding
aeedec19fa
avm2: Implement XML.normalize
2024-01-11 01:30:47 +01:00
Tom Schuster
82ce40af82
avm2: Optimize op_get_property index access on array-like
2024-01-10 23:18:40 +01:00
Tom Schuster
532279b4e6
avm2: Inline Avm2::peek
2024-01-10 23:18:40 +01:00
Nathan Adams
d89e4536b3
core: Support Japanese font defaults
2024-01-10 23:15:26 +01:00
Aaron Hill
9a96941de9
avm2: Improve Graphics.drawGraphicsData stubs
...
We now produce stubs or clearer errors for unsupported argument
combinations, instead of unclear `RustError`s
2024-01-10 01:53:27 +01:00
Tom Schuster
ba3d1bbf66
core: Don't treat known aliases as default fonts before trying to load them as device fonts
2024-01-10 00:41:31 +01:00
Tom Schuster
b34d3c9ad2
core: Explicitly match and use default fonts, before loading device fonts
2024-01-08 23:00:18 +01:00
Nathan Adams
7e4ac986f2
core: Add FontFace struct, for loading a Font from a file binary
2024-01-08 23:00:18 +01:00
Aaron Hill
6c2e28a08f
Correctly handle zero-frame MovieClip
...
A MovieClip with zero frames can still have a child added
through ActionScript, which ticks normally.
2024-01-08 08:19:17 -05:00
renovate[bot]
a328deab11
fix(deps): update rust dependencies
2024-01-08 02:59:04 +01:00
Aaron Hill
47db84473a
avm2: Improve handling of Stage3D profile
...
We now validate the passed in profile, and return the selected profile
from 'Context3D.profile'. We don't yet alter the available
registers/textures based on the profile.
2024-01-07 22:34:33 +01:00
Aaron Hill
3156bf31ce
avm2: Throw correct errors in Graphics.[drawPath,drawGraphicsData]
...
This is pretty straightforward, except for the fact that Flash
completely ignores the provided commands when the 'data' vector
is empty (if 'data' has even a single entry, then Flash will validate
that all of the commands have the correct amount of data to run).
One SWF that I tested relies on this behavior.
2024-01-07 19:57:47 +01:00
Tom Schuster
e0abe72da4
avm2: Stub more TextField getLine methods
2024-01-07 12:29:26 -05:00
nosamu
95ad0f103f
avm2: Stub flash.globalization.DateTimeFormatter
...
Closes #14577
2024-01-06 23:41:53 -05:00
Aaron Hill
b96cfed6c7
avm2: Stub TextField.getCharIndexAtPoint
2024-01-06 23:11:43 -05:00
TÖRÖK Attila
f0ed5c7211
chore: Upgrade gc-arena to 0.5.0
2024-01-06 09:45:35 +01:00
Tom Schuster
7da3411fd0
avm2: Revert XML get_property_local to using has_explicit_namespace
...
This partly reverts #13966 . No new test failure, but makes the add test
for `xml["@attr"]` pass.
2024-01-06 09:16:04 +01:00
Tom Schuster
79e0e8b2ae
avm2: XML::name() needs to mark attributes as such
2024-01-06 09:16:04 +01:00
Kamil Jarosz
47deaf50a2
core: Fix non-ASCII characters input in EditText
...
Casting the character to u8 and back to char caused some non-ASCII
non-control characters to be treated as control characters.
For instance the letter "ą" (U+0105) after casting to u8 and back
became ENQ (U+0005) which is a control character.
Some other letters worked, for instance the letter "ł" (U+0142)
became "B" (U+0042) and was not classified as a control character.
The test edittext_input was added to verify this behavior.
2024-01-05 13:03:43 -08:00
TÖRÖK Attila
217585daa8
chore: Delegate `[lints]` in `Cargo.toml` of all packages to the workspace
2024-01-05 11:28:19 +01:00
Lord-McSweeney
89b7f7a6b8
avm2: Use correct null parameter error in `registerClassAlias`
2024-01-04 21:34:21 +01:00
Tom Schuster
dd53b4e06b
avm2: Reduce the size of Op on 64bit
2024-01-04 21:15:09 +01:00
Lord-McSweeney
a7716bb744
avm2: Implement FP's logic for parsing XML with multiple nodes
2024-01-03 15:14:11 +01:00
Tom Schuster
8b414c48c7
avm2: Optimize Avm2::push/pop slightly
2024-01-02 20:37:05 +01:00
Tom Schuster
c8901d43a4
avm2: Force inlining of do_next_opcode
2024-01-02 20:37:05 +01:00
renovate[bot]
c47962fc71
fix(deps): update rust crate syn to 2.0.44
2024-01-01 04:29:05 +01:00
renovate[bot]
6a0a35c370
fix(deps): update rust dependencies
2024-01-01 02:44:40 +01:00
renovate[bot]
91d0520a43
fix(deps): update rust dependencies
2024-01-01 02:03:54 +01:00
Lord-McSweeney
9f8c6bb703
avm1: Correctly handle a missing name when trying to lookup child of `ChildContainer` by that name
2023-12-31 07:06:08 +03:00
Daniel Jacobs
51254e16d1
web: Use unwrap_or_default for the PlayerRuntime instead or map_err
2023-12-30 17:58:36 -05:00
Daniel Jacobs
27849b5cdc
web: Add playerRuntime option to config for air or flashPlayer
2023-12-30 17:58:36 -05:00
Aaron Hill
583327ff62
avm2: Properly set LoaderInfo.contentType from sniffed type
2023-12-29 18:40:25 -05:00
sleepycatcoding
41fb30a6a9
avm2: Do not set dispatched flag if dispatcher does not have a listener
2023-12-29 07:31:53 +03:00
Tom Schuster
28a3c7178a
avm2: Check the text.engine.FontDescription properties before setting
2023-12-26 23:16:27 +01:00
Tom Schuster
973a81a40e
avm2: Support more ElementFormat font options in TextBlock
2023-12-26 19:19:58 +03:00
Tom Schuster
b44eed8350
avm2: Micro-optimize coerce_to_i32/u32
2023-12-26 18:50:08 +03:00
TÖRÖK Attila
2647c192d9
chore: Stop allowing, and fix lint `clippy::explicit_auto_deref`
2023-12-25 19:20:53 -05:00
TÖRÖK Attila
badac4176c
chore: Stop allowing previously buggy lint `clippy::extra_unused_type_parameters`
...
The corresponding Clippy issue was fixed long ago.
2023-12-25 19:20:53 -05:00
Aaron Hill
f60ba00240
avm2: Show FunctionObject name in Debug impl
2023-12-25 12:49:32 -05:00
renovate[bot]
216a8f3b14
fix(deps): update rust dependencies
2023-12-25 10:09:07 +01:00
Lord-McSweeney
a7145380ac
avm2/core: Implement basic SWF-local `LocalConnection`
...
Also implement `LocalConnection.isSupported` (namespace versioned to SWFv10+)
2023-12-23 15:46:03 -05:00
Crowdin Bot
9523022cdd
chore: Update translations from Crowdin
2023-12-23 13:26:37 +01:00
TÖRÖK Attila
1569ecfeae
chore: Fix a beta clippy lint in avm2: `clippy::ptr-arg`
2023-12-23 13:06:47 +01:00
Tom Schuster
704bd7502e
core: Do exact matching for device fonts first, because we might be able to load bold/italic variants
2023-12-22 13:47:48 +01:00
Tom Schuster
e3d8a279ad
core: load_device_font register function must be &mut
2023-12-22 13:47:48 +01:00
nosamu
4f62e7de47
avm1: Implement String.charCodeAt() SWFv5 behavior
2023-12-20 10:38:17 -08:00
nosamu
95851e6e9a
avm1: Implement undocumented SWFv5 string split behavior
2023-12-20 10:38:17 -08:00
nosamu
d443bd9def
avm1: Correctly handle undefined delimiter in String.split()
2023-12-20 10:38:17 -08:00
Aaron Hill
5c37533761
avm2: Avoid marking interface method definitions with VM_INTERNAL
...
Our asc.jar doesn't seem to apply a version suffix to namespaces for
interface method definitions. This was causing these methods to
get marked as VM_INTERNAL when we loaded playerglobals, preventing SWF
from invoking these methods through the interface (e.g. having a
variable of type `IEventDispatcher`, and calling `dispatchEvent` on it)
2023-12-18 21:50:34 +01:00
nosamu
98ebc339b4
core: Use i32 for font ascent and descent
2023-12-18 09:31:53 +01:00
renovate[bot]
0e5ef32654
fix(deps): update rust dependencies
2023-12-18 08:16:28 +01:00
Lord-McSweeney
ecfb3b1c4c
core/avm1: Improve some stubs
...
Add `Avm1Constructor` stub and use it in `NetConnection`; only log a stub warning in `run_inner_goto_frame` if movie is AVM2
2023-12-17 13:01:23 -08:00
zhenghaoz
e89f458df8
avm2: Add missing property objectEncoding to SharedObject
2023-12-17 13:23:06 +01:00
Aaron Hill
287ca8801a
avm2: Implement AIR playerglobal versioning
...
This builds on our existing playerglobal versioning support
to add in AIR versioning. We closely follow the avmplus implementation:
* When an SWF is loaded, we chose either a FlashPlayer or AIR
APIVersion for its SWF version, based on our configured player runtime.
* When loading playerglobals, we look at the player runtime. In AIR
mode, we map FlashPlayer-versioned definitions to the closest AIR
version. This ensures that all runtime APIVersions are in the
same series (either AIR or FlashPlayer). In FlashPlayer mode,
all AIR-versioned definitions get mapped to VM_INTERNAL, hiding
them from user code.
Part of our existing api versioning code was implemented incorrectly.
Within playerglobals, we need to treat all unmarked namespaces as
VM_INTERNAL - this allows things like playerglobal script
initializer "initproperty" opcodes to see any VM_INTERNAL AIR
definitions (when we run under FlashPlayer mode). Previously, we
were using AllVersions, which would result in those VM_INTERNAL
definitions being hidden from other playerglobal code, which is
not correct.
Using this support, I've added a stub for the AIR-only
'flash.net.DatagramSocket'. I've also extended the test framework
with a new 'player_options.runtime' config option, which can be
set to "AIR" or "FlashPlayer" to configure the test runtime mode.
I've also added two new tests:
* 'air_hidden_lookup' runs under the FlashPlayer runtime, and verifies
that a list of classes (currently just "DatagramSocket" are
inacessible).
* 'air_datagram_socket', which uses `player_options.runtime = "AIR"`
to construct an instance of `flash.net.DatagramSocket`. We can
extend this test once we implement more of `DatagramSocket`
With this commit, we have all of the needed infrastructure to start
implementing and testing AIR-only classes and methods.
2023-12-16 19:11:50 -05:00
Lord-McSweeney
375c99e601
core: More mixed AVM fixes, improve test
...
This commit breaks mixed AVM without #13889 .
2023-12-16 19:40:57 +01:00
Lord-McSweeney
7461c03049
core: More fixes for mixed AVM
2023-12-16 19:40:57 +01:00
Robin Allen
f427cd58bb
core: Fix mouse coords reported to ActionScript ( #14243 )
...
The order in which Flash Player concatenates matrices causes reported
mouse coords to often be rounded.
2023-12-15 23:37:52 +00:00
sleepycatcoding
d21be2091b
avm2: Remove ArrayObject `to_string` impl
...
This was causing the `Object.prototype.toString` to throw error 1050,
instead of returning `[object Array]`, which was causing quite a few avmplus test failures.
2023-12-15 23:36:33 +01:00
MrCheeze
0f6dae56b5
core: Improve spacing of device font letters ( close #14185 )
2023-12-15 20:14:08 +01:00
Tom Schuster
c43f76eb2b
avm2: Stub InteractiveObject needsSoftKeyboard and softKeyboardInputAreaOfInterest
2023-12-14 23:13:18 +01:00
TÖRÖK Attila
906433e049
core: Clean up Timers::remove, remove Timer::is_alive
...
Now that we have BinaryHeap::retain, stable since Rust 1.70.
2023-12-14 18:47:39 +01:00
TÖRÖK Attila
bf9cf92af8
render/wgpu: Update wgpu to 0.18.0, naga to 0.14.1, naga_oil to 0.11.0, egui to 0.24.1
2023-12-14 01:36:42 +01:00
michiel2005
f28270376f
avm1: Implement TextField.maxChars and fix pasting behavior
2023-12-12 14:06:14 -05:00
renovate[bot]
3a033f0f28
fix(deps): update rust dependencies
2023-12-11 15:51:12 +01:00
renovate[bot]
e196a544dd
fix(deps): update rust crate bitstream-io to v2
2023-12-11 11:25:12 +01:00
Matt Trescott
06646bc4b8
avm1: Support FLV date conversion
...
Fixes Riva Web Player crash (rivavx.de)
2023-12-10 22:30:39 -07:00
TÖRÖK Attila
512a03815d
core/avm1: Stub NetConnection
2023-12-10 15:56:54 -07:00
David Wendt
9c3d197e2f
core: FLV must always backseek after finding our target otherwise we miss the keyframe.
2023-12-09 12:19:10 -07:00
David Wendt
f1a1299707
core: Don't execute no-op seeks.
2023-12-09 12:19:10 -07:00
sleepycatcoding
742ccaf705
avm2: Correctly set the return type of AS defined native methods
...
Previously, the return type of ActionScript defined native methods was always incorrectly set to the any (`*`) type.
2023-12-09 18:32:31 +01:00
Lord-McSweeney
8096146a0d
avm1: Correctly mark unloaded movies as unloaded instead of relying on depth
2023-12-09 00:29:37 +01:00
Tom Schuster
8688d4da21
avm2: Stub flash.text.engine.FontDescription::isFontCompatible
2023-12-08 16:16:15 -05:00
Tom Schuster
06e33c104d
avm2: Implement TextLine::textWidth and TextLine::textHeight
2023-12-08 19:15:01 +01:00
renovate[bot]
40b92e69f7
fix(deps): update rust dependencies
2023-12-05 21:08:16 +01:00
renovate[bot]
a0c33382bf
fix(deps): update wasm-bindgen
2023-12-04 12:08:22 +01:00
TÖRÖK Attila
82d61faa2c
avm2: Use explicitly wrapping integer arithmetic operations
2023-12-03 16:34:27 +01:00
Aaron Hill
19c3df7cb6
avm2: Perform early allocation and exposing of SimpleButton object
...
The allocated-but-unconstructed object should be set on
the parent field before we construct the 'up state' object - this
is observable by ActionScript
2023-11-30 12:49:32 -08:00
MrCheeze
9f6ab2b7c6
core: Allow default fonts to use bold/italic fonts
2023-11-30 21:04:41 +01:00
Lord-McSweeney
1ce3ec636a
avm2: Prevent `AVM1Movie`s from being moved around in the DO hierarchy
2023-11-30 07:12:37 -08:00
Lord-McSweeney
889c13f7c6
core: Remove leftover `avm2_avm1movie`
2023-11-30 07:12:37 -08:00
Lord-McSweeney
24c9f9386f
core: Resolve review comments (no functional changes)
2023-11-30 07:12:37 -08:00
Lord-McSweeney
f458a391fc
avm2: Use caller movie when creating a `Bitmap`
2023-11-30 07:12:37 -08:00
Lord-McSweeney
7e145d7c7c
core: Don't run DoABC(2) tags when the root movie is AVM1
...
KOF vs DNF relies on this.
2023-11-30 07:12:37 -08:00
Lord-McSweeney
8e1f145aba
core: Use correct movie version for `Bitmap` DOs
2023-11-30 07:12:37 -08:00
Lord-McSweeney
5c04925ebc
core/avm1: Remove usage of `context.stage` in a few places
2023-11-30 07:12:37 -08:00
Lord-McSweeney
23f7291a52
core: Immediately post-instantiate an AVM1 MovieClip being loaded by AVM2
2023-11-30 07:12:37 -08:00
Lord-McSweeney
a71bfe777c
avm2: Fix building after rebase, fix `AVM1Movie`, use `Avm2Activation::caller_movie_or_root` where appropriate
2023-11-30 07:12:37 -08:00
Lord-McSweeney
fb8bde252f
core/avm2: Hook up AVM1Movie
2023-11-30 07:12:37 -08:00
Lord-McSweeney
7eb3c3be0c
core: Remove NotAvm2 AVM2 mouse pick enum option since it is equivalent to Miss
2023-11-30 07:12:37 -08:00
Lord-McSweeney
cdbb08b4ee
core: Remove context.is_action_script_3
2023-11-30 07:12:37 -08:00
Lord-McSweeney
58f33b6b94
core: Provide global domain for loading movies without avm2_data.
2023-11-30 07:12:37 -08:00
Lord-McSweeney
6eba8a6444
core: Use current movie instead of root movie in Avm1Button.event_dispatch
2023-11-30 07:12:37 -08:00
Lord-McSweeney
2553b1acdb
core: Set movie of Stage's ChildContainer when Stage's movie is set
2023-11-30 07:12:37 -08:00
Lord-McSweeney
45f6dfdbd4
core: Remove some uses of context.swf
2023-11-30 07:12:37 -08:00
Lord-McSweeney
fd538915b3
core: Change some uses of Avm1Activation::from_stub to from_nothing
2023-11-30 07:12:37 -08:00
Lord-McSweeney
43fdd30fc1
core: Improve mouse picking for mixed AVM
2023-11-30 07:12:37 -08:00
Lord-McSweeney
9e2b49f857
core: Remove most uses of context.is_action_script_3()
2023-11-30 07:12:37 -08:00
David Wendt
6d77fea750
avm1, avm2: Convert Object to AVM values as well
2023-11-28 18:53:01 -07:00
David Wendt
204bdbf74c
avm1: Implement strict array conversion for AVM1, too.
2023-11-28 18:53:01 -07:00
Lord-McSweeney
0a4d1449fc
avm2: Implement StrictArray conversion for FLV script data
2023-11-28 18:53:01 -07:00
David Wendt
ab02e89b3b
core: FLV's Strict Array type holds values, not key/value pairs.
...
*draws a zero on the 'days since last misdocumented feature' sign*
2023-11-28 18:53:01 -07:00
renovate[bot]
6da223a875
fix(deps): update rust dependencies
2023-11-27 09:44:47 +01:00
Aaron Hill
24aa9b8fe4
avm2: Copy data for async loadCompressedTextureFromByteArray
...
The caller might modify the ByteArray immediately after the call,
so we need to copy the ByteArray.
2023-11-25 19:11:54 -08:00
TÖRÖK Attila
941f87ca8e
core/audio: Remove the now unused clip_frame parameter of start_stream
2023-11-26 03:51:28 +01:00
TÖRÖK Attila
8ce95d76fe
core/audio: Remove the now unused stream_handle parameter of start_stream
2023-11-26 03:51:28 +01:00
TÖRÖK Attila
23960883f8
core/audio: Remove the now dummy is_loading_complete
2023-11-26 03:51:28 +01:00
TÖRÖK Attila
ca8de7b791
core/avm2: Add sampledataevent to globals
2023-11-26 03:51:28 +01:00
Aaron Hill
993d8d9f9b
core: Add PlayerRuntime::{FlashPlayer, AIR} for Adobe AIR support
...
We've now had two different bug reports involving Adobe AIR
SWFs, so I'm going to go ahead and start adding a framework
for AIR support.
This commit just adds a command-line option
`--player-runtime <flash-player|air>` (defaulting to `flash-player`),
and passes it along to the `Player`. The actual value is currently
unused - in a follow-up PR, I'm going to implement namespace versioning
for AIR.
2023-11-25 19:05:51 -05:00
Aaron Hill
e0998642f6
core: Divide by 255 in blend_over calculation
...
This prevents the value from being changed when blending a
source pixel of 0x0 over a destination pixel (with alpha).
2023-11-25 22:29:30 +01:00
Lord-McSweeney
f41059a60a
avm2: Version-gate `JSON` to SWFv13 and above
2023-11-25 13:15:42 -08:00
Aaron Hill
f12f457f5d
avm2: Fix handling of public indices with nested iteration
...
This more closely aligns our code with the corresponding avmplus code.
A user-supplied index of '0' is special-cased, and we correctly
resume iteration when a public index mismatch is detected.
2023-11-25 21:34:48 +01:00
Tom Schuster
a2021cd3e2
avm2: Remove dead init_display_object fn
2023-11-25 11:38:08 -05:00
MrCheeze
5920a6426e
core: Allow Regular/Bold/Italic device fonts to be registered separately
2023-11-24 17:08:35 +01:00
Tom Schuster
96059a8e25
avm2: Implement flash.system.Security pageDomain
2023-11-23 19:55:32 +01:00
Lord-McSweeney
d3489ef1f3
avm2: Implement URLLoader for VARIABLES data format
2023-11-23 19:40:28 +01:00
sleepycatcoding
7be2eae4b8
avm2: Implement QName enumeration
2023-11-23 19:25:08 +01:00
Aaron Hill
c920ceba51
avm2: Set RUNNING_CONSTRUCT_FRAME flag inside DisplayObject ctor
...
This ensures that this flag is set regardless of whether the
object is constructed by the timeline or from ActionScript
(it was previously only set when constructed by the timeline).
2023-11-23 10:36:37 -05:00
Robin Allen
cad162121b
core: Fix MorphShape inaccuracy on complex paths ( #14089 )
...
* core: Fix MorphShape inaccuracy on complex paths
It's inaccurate to interpolate the moveTo/lineTo deltas individually
because on complex paths they're often small integers, which won't
interpolate smoothly.
Instead, interpolate absolute positions.
2023-11-21 12:41:45 +00:00
MrCheeze
d23d16cb11
avm2: Report ProgressEvent when a sound is loaded ( close #8932 )
2023-11-20 16:14:03 -08:00
Robin Allen
1ce772befa
core: fix lerp_twips sometimes being off-by-one due to FP error
2023-11-20 13:21:32 +01:00
renovate[bot]
7757d060ff
fix(deps): update rust dependencies to v2
2023-11-20 09:03:08 +01:00
Aaron Hill
92a50d37f0
avm2: Mark MovieClip as initialized in 'on_construction_complete'
...
This ensures that a re-entrant 'construct_frame' call (e.g. due
to a goto or AVM2 button) does not end up marking a MovieClip as
initialized too early.
This issue was causing us to run 'fire_init_and_complete_events' too
early, firing Loader events before we had actually finished (and
before the SWF had registered the relevant listeners).
2023-11-19 20:52:23 -05:00
Lord-McSweeney
23a65c50f2
avm2: Add `Activation::caller_movie_or_root` to default to root movie and use it
2023-11-19 11:50:50 -08:00
Lord-McSweeney
5be2eb499a
avm1: Copy `Activation`'s local register set when running a `catch`
2023-11-19 10:15:36 -08:00
sleepycatcoding
a78a67ee24
avm2: Implement [[HasProperty]] for XMLList
2023-11-16 16:09:37 -05:00
Daniel Jacobs
117a4ea0bf
avm2: Add ContextMenu clipboard related properties
2023-11-16 15:53:10 -05:00
Daniel Jacobs
75923e5568
avm2: Make MouseEvent isRelatedPropertyInaccessible a getter/setter
2023-11-16 18:33:26 +01:00
Nathan Adams
d6f16b0be5
tests: Make tests use a virtual filesystem, which currently maps to the regular physical FS rooted in a test directory
2023-11-13 22:28:10 +01:00
Tom Schuster
1e5e80aa2c
avm2: GroupElement TLF improvements
2023-11-13 21:59:29 +01:00
Nathan Adams
f2b02acf44
chore: Appease clippy-beta
2023-11-13 20:26:50 +01:00
renovate[bot]
32c65e6460
fix(deps): update rust dependencies
2023-11-13 09:10:26 +01:00
TÖRÖK Attila
11c5a68452
avm2: nit: Fix typo: explict_namespace -> explicit_namespace
...
Spotted by @Lord-McSweeney.
2023-11-12 14:58:32 -08:00
TÖRÖK Attila
660cdd9477
core: nit: Fixed a typo and a double space in comments.
2023-11-12 14:58:32 -08:00
Aaron Hill
1501a858f6
avm2: Improve E4XNode::matches_name
...
Avmplus constructs a full `QName`, and uses the normal
Multiname matching logic. This would be a large refactor,
so I've just modified the existing method to properly
handle multiple namespaces.
I've also included a closely related fix - we should only treat
a multiname with the literal local name "@foo" as an attribute
when the namespace is the empty public namespace. We were incorrectly
reparsing multinames that contained multiple namespaces.
2023-11-12 17:38:56 -05:00
Tom Schuster
451e4bad10
amv2: Simplify XmlObject get_enumerant_name
2023-11-12 22:03:52 +01:00
Lord-McSweeney
576c7e1b14
avm2: Add `AccessibilityImplementation.accDoDefaultAction`
2023-11-12 06:52:51 -08:00
Aaron Hill
de4d58630a
avm2: Add stub for Graphics uvt parameter
2023-11-12 15:19:47 +01:00
Aaron Hill
c360d45729
avm2: Use 'has_own_property' to check for prop in 'resolve_definition'
...
If Actionscript explicitly sets the property to 'undefined', we
should still succeed.
2023-11-12 00:38:35 +01:00
Lord-McSweeney
3cc9915076
avm2: TLF EditTexts should not be selectable
2023-11-11 06:53:18 -08:00
Lord-McSweeney
fdb2a06ad8
avm2: Fix TLF text getting cut off vertically
2023-11-11 06:53:18 -08:00
Lord-McSweeney
1bb2422595
avm2: Correctness fixes to AMF serialization ( #13537 )
...
Fixes some cases where `amf::serialize_value` returns `None`
---------
Co-authored-by: Lord-McSweeney <Lord-McSweeney@github.com>
2023-11-10 17:59:26 -08:00
Lord-McSweeney
172b76d01f
avm2: `DataEvent` fixes
...
- `DataEvent.data` should delegate to the superclass's `TextEvent.text`
- `DataEvent.clone` implementation was wrong
2023-11-10 15:09:28 -08:00
Aaron Hill
b056e12f4b
avm2: Re-use same AMFValue for the same Object ptr
...
This preserves object identity across a serialization
round-trip. Unfortunately, we don't currently implement this
correctly in flash_lso, so I've added a stub message.
Once flash_lso is fixed, this code will start working. For now,
it just allows us to detect (via the stub) if this is actually
used by an SWF.
2023-11-10 17:52:47 -05:00
sleepycatcoding
e8ccbf4e2c
avm2: Support enumeration for XML objects
...
Previously, iterating the XML object would iterate the prototype. This broke filtering expressions on XML objects, which should work.
2023-11-10 22:50:19 +01:00
Nathan Adams
f03b6307a8
core: Don't invalidate when setting filters to the same value
2023-11-10 22:24:45 +01:00
Nathan Adams
bce0608e1f
tests: Move all wgpu code out of test framework, make it abstract over any/no renderer, and make wgpu option if imgtests isn't enabled
2023-11-10 22:02:18 +01:00
Lord-McSweeney
2f5166790c
chore: Update flash-lso
2023-11-10 18:26:02 +01:00
Lord-McSweeney
d51cfff03d
chore: Remove leftover `println!`
2023-11-09 22:38:09 -05:00
Aaron Hill
c821d0564e
avm2: Use class aliases to serialize Vector type
...
This allows us to round-trip `Vector.<CustomType>` when
`CustomType` has an alias registered.
2023-11-09 22:01:59 -05:00
Aaron Hill
7110be920c
Suport uploading ATFTextureData::CompressedRawAlpha
...
Fortunately, this is very simple - we can just take
the DXT5 data and upload it directly to the wgpu texture.
2023-11-10 02:00:40 +01:00
Aaron Hill
2cb1efca8c
avm2: Improve AVM2 button construction handling
...
An Avm2 button appears to run a 'nested frame' during construction -
the same type of 'nested frame' performed by a goto. This will
run framescripts for all objects in the display hierarchy (including
orphans), resulting in an unusual child->parent framescript execution
order that DeathVsMonstars_decrypted.swf depends on.
2023-11-10 01:33:07 +01:00
Mike Welsh
5232854f00
avm1: Implement `MovieClip.scale9Grid`
2023-11-09 21:38:53 +01:00
Mike Welsh
aacc67b096
avm2: Implement `DisplayObject.scale9Grid`
2023-11-09 21:38:53 +01:00
Mike Welsh
cc6320a2dc
core: Add `DisplayObject::scaling_grid`
2023-11-09 21:38:53 +01:00
Richy McGregor
10ebc60a7d
core: Always redraw text in relayout
2023-11-09 21:20:10 +01:00
Richy McGregor
924e5ef632
core: Store EditText requested height and width ( close #13026 )
...
remove now unused EditTextStatic bounds
2023-11-09 21:20:10 +01:00
Richy McGregor
4c819b5fca
core: Make set_width & set_height call relayout
...
this requires an UpdateContext to be passed into both methods
2023-11-09 21:20:10 +01:00
Richy McGregor
fcc0d14188
core: Derive Debug for AutoSizeMode
2023-11-09 21:20:10 +01:00
Richy McGregor
dd083dd502
chore: Fix typos
2023-11-09 21:20:10 +01:00
Nathan Adams
6061186c0f
core: Fix formatting texts when they start with any amount of <br>s
2023-11-09 20:52:16 +01:00
Nathan Adams
fe2ff4f242
chore: Update flash-lso
2023-11-09 20:01:52 +01:00
Aaron Hill
bab2a80d64
Fix vtable property amf serialization
2023-11-09 19:43:55 +01:00
Aaron Hill
10d6157755
avm2: Work on AMF3 custom object serialization
2023-11-09 19:43:55 +01:00
Aaron Hill
2982c12ed4
Use VM_INTERNAL api version in helper methods
...
This is a better default than using the lowest possible version,
as it allows things like AMF deserialization to see all properties
on the target object.
This only affects explicit Ruffle-side property setting - interpreted
code will continue to use the namespace version determined by the
SWF version.
2023-11-09 19:22:27 +01:00
Aaron Hill
fa05c66e2a
avm2: Implement namespace versioning
...
This allows us to hide things like `MovieClip.isPlaying` from older
SWFs, which may define an `isPlaying` method without marking it
as an override.
This has the largest impact on public namespaces. There is no longer
just one public namespace - we now have a public namespace per API
version. Most callsites should use `Avm2.find_public_namespace()`,
which determines the public namespace based on the root SWF API version.
This ensures that explicit property access in Ruffle (e.g. calling
"toString") are able to see things defined in the user SWF.
This requires several changes other:
* A new `ApiVersion` enum is introduced, storing all of the api versions
defined in avmplus
* NamespaceData::Namespace now holds an `ApiVersion`. When we read a
namespace from a user-defined ABC file, we use the `ApiVersion` from
the root movie clip. This matches Flash Player's behavior - when a
child SWF is loaded through `Loader`, its API version gets overwritten
with the parent's API version, which affects definition visibility and
'override' requirements in the child SWF. Note that 'behavior changes'
in methods like `gotoAndPlay` are unaffected.
* The `PartialEq` impl for `Namespace` has been removed - each call site must now choose
to compare namespaces either by an exact version match, or by
'compatible' versions (a `<=` check) with `Namespace::matches_ns`
* `PropertyMap` now uses `Namespace::matches_ns` to check for a
compatible version when looking up a definition.
* When compiling our playerglobal, we pass in the `-apiversioning` flag,
which causes asc.jar to convert `[API]` metadata into a special
Unicode 'version mark' suffix in namespace URLs. We parse this
when loading namespaces to determine the API version to use for
playerglobal definitions (unmarked definitions use the lowest possible
version).
Unfortunately, this makes ffdec unable to decompile our
playerglobal.swc
I've going to file an upstream issue
2023-11-09 15:27:33 +01:00
Lord-McSweeney
4d99459849
avm2: Add another FIXME to `create_text_line`
2023-11-09 13:38:48 +01:00
Lord-McSweeney
af878c69b2
avm2: Always return same TextLine passed to `recreateTextLine` in `recreateTextLine`
2023-11-09 13:38:48 +01:00
Lord-McSweeney
9be62bf561
chore: fmt
2023-11-09 13:38:48 +01:00
Lord-McSweeney
8301ac16cf
avm2: Stub TextJustifier.lineJustification; add constructor handling code
2023-11-09 13:38:48 +01:00
Lord-McSweeney
1f62c29738
avm2: Proper handling of null text of content element
2023-11-09 13:38:48 +01:00
Lord-McSweeney
952955099d
avm2: Add a FIXME notice on TextBlock.recreateTextLine
2023-11-09 13:38:48 +01:00
Lord-McSweeney
ef847cdbc4
avm2: Implement ContentElement.rawText
2023-11-09 13:38:48 +01:00
Lord-McSweeney
dfdd8287fb
avm2: Add a FIXME notice about DO Container methods being called on a TextLine
2023-11-09 13:38:48 +01:00
Lord-McSweeney
f5a16ad46f
chore: appease clippy
2023-11-09 13:38:48 +01:00
Lord-McSweeney
141b50d999
avm2: Implement TextLine.previousLine
2023-11-09 13:38:48 +01:00
Lord-McSweeney
2afb96c41b
avm2: Stub InteractiveObject.accessibilityImplementation
2023-11-09 13:38:48 +01:00
Lord-McSweeney
2f524463d8
avm2: Stub TextBlock.recreateTextLine
2023-11-09 13:38:48 +01:00
Lord-McSweeney
986295394b
avm2: TLF improvements (GroupElement support); TextLines' height depends on their content
2023-11-09 13:38:48 +01:00
Lord-McSweeney
a8294ff39a
avm2: Add some TODO notices
2023-11-09 13:38:48 +01:00
Lord-McSweeney
d48d2b7d4e
avm2: GroupElement stubs
2023-11-09 13:38:48 +01:00
Lord-McSweeney
597e4e8b9b
avm2: Basic TLF rendering support
2023-11-09 13:38:48 +01:00
Nathan Adams
fa7e7cc8c1
tests: Add tests for NetConnection with Flash Remoting, and fix implementation to match
2023-11-09 12:39:22 +01:00
Nathan Adams
e6b5ac9a2b
tests: Allow tests to request http://example.org/foo/bar by loading ./example.org/foo/bar
2023-11-09 12:39:22 +01:00
Nathan Adams
e6c46d22f2
avm2: Implement NetConnection.send and NetConnection.addHeader
2023-11-09 12:39:22 +01:00
Nathan Adams
508a4139ad
avm2: Implement Responder by making a ResponderObject to hold the callbacks
2023-11-09 12:39:22 +01:00
Nathan Adams
6d901a7463
avm2: Implement many NetConnection properties
2023-11-09 12:39:22 +01:00
Nathan Adams
08c707caa6
avm2: Implement NetConnection.close()
2023-11-09 12:39:22 +01:00
Nathan Adams
641a90b0d4
avm2: Implement connecting a NetConnection to flash remoting url
2023-11-09 12:39:22 +01:00
Nathan Adams
c691b32886
core: Introduce a NetConnection struct, backing AVM1/AVM2 NetConnection objects
2023-11-09 12:39:22 +01:00
sleepycatcoding
f334963b47
avm2: Handle single element XMLLists in XML.insertChildBefore/After
2023-11-07 23:23:53 +01:00
sleepycatcoding
cea636da30
avm2: Include CData nodes in XMLList.text output
2023-11-07 23:23:53 +01:00
sleepycatcoding
d5df3e27a2
avm2: Fix pretty printing of CData nodes
2023-11-07 23:23:53 +01:00
sleepycatcoding
fb34aaea40
avm2: Call toXMLString directly in EscXElem op
...
The previous method, which used `coerce_to_string`, calls `toString` on the object,
which has special handling for simple content, which is not used here.
2023-11-07 23:23:53 +01:00
Tom Schuster
e99eaafcd0
avm2: Fix two bugs in XML/XMLList set_property_local
2023-11-07 18:12:59 +01:00
renovate[bot]
acadb2b2d3
fix(deps): update wasm-bindgen
2023-11-07 12:18:50 +01:00
Tom Schuster
fca17a0061
avm2: Add a E4XNode::is_text helper
2023-11-04 21:45:31 +01:00
Tom Schuster
28476d83be
avm2: Add a E4XNode::is_element helper
2023-11-04 21:45:31 +01:00
Tom Schuster
1953ab3cf0
avm2: Add a E4XNode::is_attribute helper
2023-11-04 21:45:31 +01:00
TÖRÖK Attila
2059492d77
avm2: Remove default width and height values from BitmapData ctor
2023-11-03 21:41:39 +01:00
CUB3D
b0d88645bc
avm1: Implement FileReference
2023-11-03 19:32:24 +01:00
Nathan Adams
dad39631cf
avm2: Don't add ClassDefinition to AMF0 objects
2023-11-03 02:17:40 +01:00
Tom Schuster
8138b68919
avm2: Implement XML.setChildren
2023-11-02 13:40:16 +01:00
Tom Schuster
3572367c8e
avm2: Allow assigning XML objects without a name (eg. text)
2023-11-01 18:44:36 +01:00
Aaron Hill
8d75f98214
core: Remove unused exports (fix nightly warnings)
2023-11-01 00:21:59 -04:00
Nathan Adams
432a63250b
core: Update our xmlns/xml namespace detection for new quick-xml 0.31.0
2023-11-01 00:45:43 +01:00
renovate[bot]
1377a5b07b
fix(deps): update rust dependencies
2023-11-01 00:45:43 +01:00
Nathan Adams
36eda35197
avm2: Implement Font.registerFont
2023-10-30 15:49:07 +01:00
Nathan Adams
9ecb7d221f
avm2: Implement Font.enumerateFonts
2023-10-30 15:49:07 +01:00
Nathan Adams
8be05d8673
avm2: Made a FontObject type and switch Font to use that instead of looking up per getter
2023-10-30 15:49:07 +01:00
Tom Schuster
780489903a
amv2: Implement flash.xml.XMLDocument createTextNode
2023-10-30 14:30:59 +01:00
Tom Schuster
72965b3689
amv2: Implement flash.xml.XMLNode removeNode
2023-10-30 14:30:59 +01:00
Tom Schuster
445643fedb
amv2: Implement flash.xml.XMLNode cloneNode
2023-10-30 14:30:59 +01:00
sleepycatcoding
fb3c4cd307
avm2: Fix E4X [[Replace]] implementation bug
...
We were incorrectly returning for XML attributes. Fixes #13780 .
2023-10-30 14:05:23 +01:00
sleepycatcoding
5bebebddbe
avm2: Add SWFv21 and above XML special case
2023-10-29 09:43:14 -07:00
nosamu
6f5eb48ec2
avm2: Fix return value of SharedObject.flush
2023-10-29 16:08:24 +01:00
Nathan Adams
878f1fc64e
swf: Removed ButtonAction::key_code and fixed writing button tags
2023-10-29 14:31:45 +01:00
Lord-McSweeney
911f1c29db
avm2: Correctly set `caller_movie` in `Activation::from_script`
2023-10-28 21:30:40 -04:00
Aaron Hill
cc49aaee58
avm2: Add UTF-16 BOM handling to ByteArray.toString
...
When a UTF-16 BOM is present, ByteArray.toString automatically
strips it out, and treats the remaining data as a UTF-16 string
with the specified endianness.
2023-10-29 01:13:05 +02:00
Tom Schuster
ef627babfd
avm2: Stub undocumented XML notification functions
2023-10-28 14:17:34 -07:00
Aaron Hill
84f788c2d2
avm2: Use RawTable to implement 'public index' iteration ( #12470 )
...
* avm2: Use RawTable to implement 'public index' iteration
This makes our implementation more closely aligned with avmplus.
In particular, it's now possible to delete keys from an object
while iterating without disturbing the iteration order (as long
as those keys were already produced by the iterator).
This is based on @Bale001's work on RawTable-based iteration
A few tests had their output changed (they depend on the exact
object iteration order, and don't neccessarily match Flash Player
exactly).
* Use Cell to store index fields
* Remove outdated comment
2023-10-28 20:44:01 +00:00
Tom Schuster
33dde1eccf
avm2: Ignore a missing [[TargetProperty]] when assigning an XMLList
2023-10-28 08:18:15 -07:00
Tom Schuster
08d6a7b648
avm2: Reimplement XML.appendChild in terms of [[Get]] and [[Put]]
2023-10-28 08:18:15 -07:00
TÖRÖK Attila
0c0b86c008
core,web: Replace `instant` with `web-time`
2023-10-28 03:01:45 +02:00
sleepycatcoding
ed6fa6b2fe
avm2: Support indices in XMLList.child
2023-10-27 22:53:16 +02:00
sleepycatcoding
d9dad1109a
avm2: Fix many uses of XmlListObject::new
2023-10-27 22:53:16 +02:00
sleepycatcoding
34b80a41b5
avm2: Take Mutation instead of Activation in append
...
There is no need for a full on activation in append.
2023-10-27 22:53:16 +02:00
sleepycatcoding
9d7f0a2bcc
avm2: Add target_dirty flag and use it to reevaluate target object
2023-10-27 22:53:16 +02:00
michiel2005
333009b79f
avm1: Implement key.isToggled()
2023-10-26 17:39:14 -04:00
Tom Schuster
444af0eaf4
avm2: Add AIR flash.system::ImageDecodingPolicy
2023-10-26 08:54:31 +02:00
Aaron Hill
d5da655f8f
avm2: Fix setting frontAndBack culling
...
The name uses camel case, not snake case.
2023-10-23 18:44:48 -04:00
Aaron Hill
3a75502a36
avm2: Implement DisplayObjectContainer.getObjectsUnderPoint
2023-10-23 18:01:08 -04:00
Aaron Hill
b5097445e6
render: Add support for Context3DTextureFormat.COMPRESSED_ALPHA
...
This is our first non-rgba texture format (it uses Bc3RgbaUnorm).
ATF files store these textures in a very convoluted way - fortunately,
the 'dds2atf' tool is open-source, which allowed me to figure out
how to decode the texture back to a DXT5/DXT1 texture.
2023-10-23 11:18:27 -04:00
sleepycatcoding
bb053df30b
avm2: Implement XMLList.parent
2023-10-23 15:46:47 +02:00
sleepycatcoding
2745efe2b1
avm2: Throw error 1010 when null/undefined is given to name_to_multiname
2023-10-23 15:26:37 +02:00
renovate[bot]
cd01bfe7d6
fix(deps): update rust dependencies
2023-10-23 02:55:11 +02:00
sleepycatcoding
10cf247315
avm2: Fix incorrect XMLList method signatures
2023-10-22 15:16:51 -04:00
Tom Schuster
172c1057bb
avm2: XML objects must support lookups like "@attr"
2023-10-22 14:28:22 -04:00
Lord-McSweeney
d23346271e
core/avm2: Implement TextEvent.TEXT_INPUT
2023-10-22 08:01:18 -07:00
sleepycatcoding
0745968c49
avm2: Fix ifstricteq and ifstrictne comparisons
...
Unlike strict_equals they were comparing with just `==`, which is not entirely correct,
since objects like XmlObjects need special cases.
2023-10-22 00:23:51 -04:00
Lord-McSweeney
5f217a6b9a
avm2: Improve quick_xml to AVM2 XML error conversion
2023-10-21 11:41:57 -07:00
Lord-McSweeney
18fb1cd6d1
avm2: Fix Vector call handler error
2023-10-21 11:41:57 -07:00
Lord-McSweeney
0c6a0e80af
avm2: Add class call handlers for Boolean, Number, and (u)int
2023-10-21 11:41:57 -07:00
Lord-McSweeney
043f7cdea7
chore: appease clippy
2023-10-21 11:41:57 -07:00
Lord-McSweeney
901d84b2cf
avm2: Fix defining const slots on global object
2023-10-21 11:41:57 -07:00
Lord-McSweeney
18c53694cb
avm2: Implement Error 1070
2023-10-21 11:41:57 -07:00
Lord-McSweeney
b1056311f0
avm2: Implement Error 1112
2023-10-21 11:41:57 -07:00
Lord-McSweeney
5d2d8e080a
avm2: Pass around Mutation instead of Activation in some places
2023-10-21 11:41:57 -07:00
Aaron Hill
5d4e851a6e
avm2: Throw ArgumentError when calling function with wrong arg count
...
Some SWFs rely on catching the error.
In order to reproduce Flash's error messages, we now store a `QName`
in `FunctionObject`, which is set when we make a bound method.
2023-10-21 00:18:50 -04:00
Crowdin Bot
94174b30fe
chore: Update translations from Crowdin
2023-10-20 21:10:35 +02:00
sleepycatcoding
c87ac6f5f5
avm2: Replace culling panic messages with stub messages
...
A stub message is good enough.
2023-10-20 20:45:45 +02:00
Nathan Adams
feacbdc118
core: <font> tag in text should reset the style to Regular
2023-10-20 12:41:15 +02:00
Nathan Adams
b2a43cb1f7
core: Add style to edittext debug UI
2023-10-20 12:41:15 +02:00
Nathan Adams
64385efe48
core: Use correct embedded font fallback order + tests
2023-10-20 12:41:15 +02:00
sleepycatcoding
8b5b135a2d
avm2: Do not panic in XMLList call handler
2023-10-19 20:52:33 +02:00
sleepycatcoding
8021efaabc
avm2: Do not panic in XML call handler
...
This panic occurred when the call handler was passed zero arguments.
2023-10-19 20:52:33 +02:00
sleepycatcoding
5da09c137e
avm2: Implement QName call handler
2023-10-19 11:46:31 +02:00
Aaron Hill
fd4d6921d8
avm2: Don't stop root movie clip, even if it doesn't extend `MovieClip`
...
Normally, Flash Player will ignores frames for a movie clip with
a symbol class that doesn't extend `MovieClip` (e.g. it extends
`Sprite`). However, the root movie appears to have frame run
unconditionally, even if it only extends `Sprite`. This can
be observed by adding a Graphics child in the second frame only -
the child will flicker in and out as the player switches between
frames, but only for the root movie clip.
Seedling relies on this behavior - it has `DoAbc2` tags in the second
frame, and has a main `Preloader` class that extends `Sprite`.
2023-10-18 09:28:50 -04:00
TÖRÖK Attila
627e8c8063
core: Switch dasp from a git revision to v0.11.0
2023-10-17 21:31:18 +02:00
Adrian Wielgosik
a8ea913bf6
avm1: Store childNodes on the node itself
2023-10-16 11:25:48 +02:00
renovate[bot]
b427940431
fix(deps): update rust dependencies
2023-10-16 09:51:22 +02:00
Nathan Adams
d2541a7ff0
core: Rename Library::load_device_font to Library::get_or_load_device_font
2023-10-15 14:09:21 +02:00
Nathan Adams
e768140a1f
core: Cache the result of Library::default_font
2023-10-15 14:09:21 +02:00
Nathan Adams
ec21ad8658
core: Add default_font feature which enables the fallback font
2023-10-15 14:09:21 +02:00
Nathan Adams
74a7ab5afe
core: Implement device font lookup, and multiple default device fonts
2023-10-15 14:09:21 +02:00
Nathan Adams
909d33e12e
core: Inline Player::load_device_font in Font tests, it's just testing one specific font
2023-10-15 14:09:21 +02:00
Lord-McSweeney
93aa3a493b
avm2: Add back log_warn
2023-10-13 20:22:00 +02:00
Lord-McSweeney
4561fd3631
avm2: Move top-level functions and __ruffle__ stub functions to ActionScript
2023-10-13 20:22:00 +02:00
David Wendt
cf3c594209
docs: Correct documentation of what `execute_seek` does
2023-10-10 18:49:09 -06:00
David Wendt
759aa1e469
core: Allow seeks to process on paused streams.
...
Our list of 'playing' streams is now a list of 'active' streams. This nomenclature change also indicates a rule change: streams are activated whenever there is work for them to do, and they are only ever deactivated by themselves when they're out of work to do. We no longer deactivate streams when they are paused as they may still have a queued seek to process.
2023-10-10 18:49:09 -06:00
David Wendt
e5b59438f7
core: Swap order of parameters on `NetStream.Seek.Notify` event
2023-10-10 18:49:09 -06:00
David Wendt
4420dc8d23
core: Let each VM flag if it wants to send seek events or not
2023-10-10 18:49:09 -06:00
David Wendt
c086a6da11
chore: Fix let statements holding unnecessary borrows, *grumble grumble*
2023-10-10 18:49:09 -06:00
David Wendt
78e41b5be5
avm1: Implement `NetStream.time`
2023-10-10 18:49:09 -06:00
David Wendt
c23f346665
chore: Ensure all `NetStream` code is working in milliseconds.
...
AVM `NetStream` reports and accepts values in seconds, so all the unit conversions went there now.
2023-10-10 18:49:09 -06:00
David Wendt
a0a762ccfc
core: `NetStream` seeks are queued.
...
They do not execute until the next stream tick.
We also implement a few new status events, including some AVM2 exclusive ones.
2023-10-10 18:49:09 -06:00
David Wendt
3f13087d39
chore: Use `get_f64` for `NetStream.seek`
2023-10-10 18:49:09 -06:00
David Wendt
99de1ae154
avm2: Implement `NetStream.time`
2023-10-10 18:49:09 -06:00
David Wendt
0d886dd860
core: Add `NetStream.Pause.Notify` event
2023-10-10 18:49:09 -06:00
David Wendt
3566d7f43a
core: Fire `NetStream.SeekStart.Notify` events
2023-10-10 18:49:09 -06:00
David Wendt
1f5947912d
core: Defensively program against `flv` being broken
2023-10-10 18:49:09 -06:00
David Wendt
3be9ce4ac0
avm2: Implement `NetStream.seek`
2023-10-10 18:49:09 -06:00
David Wendt
e440e175d9
avm1: Implement `seek` method
2023-10-10 18:49:09 -06:00
David Wendt
bc6291898c
core: Add a `seek` method
2023-10-10 18:49:09 -06:00
David Wendt
4867ff1210
core: Break type sniffing out into a separate fn.
2023-10-10 18:49:09 -06:00
renovate[bot]
18796a67fe
fix(deps): update rust dependencies
2023-10-10 02:15:59 +02:00
Lord-McSweeney
7254cdeef9
avm2: Throw ArgumentError when trying to construct `new Worker()`
2023-10-10 01:20:06 +02:00
TÖRÖK Attila
602154b1b7
core,desktop: Switch to egui v0.23.0
...
Since it's compatible with wgpu 0.17.x.
2023-10-09 18:51:01 -04:00
sleepycatcoding
21a1e1f670
avm2: Small set_property_local fixup
...
Fixes a borrow panic and logic error.
2023-10-10 00:24:39 +02:00
sleepycatcoding
0b2771c23d
avm2: Implement other XMLList set_property_local path
2023-10-10 00:24:39 +02:00
sleepycatcoding
917e70086b
avm2: Throw Error 1089, if base list length bigger than 1
...
This is not mentioned in the E4X specification, but this is what avmplus
seems to be doing.
2023-10-10 00:24:39 +02:00
sleepycatcoding
ca5ba4877c
avm2: Implement one XMLList set_property path
2023-10-10 00:24:39 +02:00
sleepycatcoding
709306be81
avm2: Implement resolveValue
2023-10-10 00:24:39 +02:00
sleepycatcoding
4285d998dc
avm2: Add target property to XMLListObject
2023-10-10 00:24:39 +02:00
Nathan Adams
a3b95d9534
avm2: Fix missing stub imports in TextRenderer.as
2023-10-09 23:54:58 +02:00
Lord-McSweeney
b877a39c47
avm2: Implement SharedObject.setProperty
2023-10-07 23:49:36 +02:00
Tom Schuster
278a6ddf53
avm2: Use the localName in XMLDocument::_convertXmlNode
2023-10-07 23:46:40 +02:00
sleepycatcoding
ce2862dd45
avm2: Fix KeyboardEvent clone
...
also adds missing commandKey property.
2023-10-07 08:57:34 +02:00
Aaron Hill
3a658f5dec
avm2: Implement BitmapData.copyPixelsToByteArray
...
This basically just re-uses the implementation of getPixels
2023-10-05 17:35:54 -04:00
sleepycatcoding
5992f6b3c7
avm2: Fix handling of XMLList when set as attribute value
...
Fixes test `e11_6_1` when combined #13255 .
2023-10-05 21:26:41 +02:00
sleepycatcoding
80ccc1d8a3
avm2: Implement some obscure SWFv9 XML behavior
...
This affects appendChild, prependChild, insertChildBefore, insertChildAfter.
2023-10-05 16:12:43 +02:00
Aaron Hill
a5b4b63edc
avm2: Stub Matrix3D.pointAt
...
Unfortunately, the OpenFL implementation has a TODO
noting that their implementation doesn't match Flash,
so getting this to work will require figuring out
how Flash does things.
2023-10-04 22:27:55 -04:00
Aaron Hill
ddefac322a
avm2: Run DoAbc/DoAbc2/SymbolClass as part of their frame
...
We previously ran these tags during preloading - however,
they are actually run as part of frame execution. This is observable
by ActionScript - a SWF can load in a class from a stop()'d MoveClip,
and then advance the clip to a frame with a SymbolClass referencing
the loaded class.
2023-10-04 22:00:22 -04:00
renovate[bot]
428e89af73
fix(deps): update rust dependencies
2023-10-04 19:19:51 -04:00
Tom Schuster
6d51bc3964
avm2: Namespace support for XML.name()
2023-10-01 19:26:07 +02:00
Tom Schuster
30614bdd2f
avm2: QName constructor improvements
2023-10-01 19:26:07 +02:00
Aaron Hill
4c8f8829cb
avm2: Implement Sound.loadCompressedDataFromByteArray
2023-09-30 21:03:37 -04:00
Lord-McSweeney
bdc0985276
avm2: Correctly fire `textureReady` event for asynchronous Texture uploads
2023-09-30 16:43:38 -04:00
Aaron Hill
c5abed07c4
Fix BitmapData.clone accidentally re-using GPU texture
...
This caused the clone to be linked to the original, instead of
being a completely independent BitmapData object.
2023-09-30 09:38:38 -04:00
sleepycatcoding
f140e7a14b
core: Place jpegxr texture support behind feature flag ( #13348 )
2023-09-29 18:46:54 -04:00
Aaron Hill
ec7a8ac645
avm2: Add support for Stage3D bytearray/compressed textures ( #13180 )
2023-09-28 03:03:30 +00:00
renovate[bot]
7e4e4d4c5b
fix(deps): update rust dependencies
2023-09-25 11:14:39 +02:00
Lord-McSweeney
9833a2d19d
avm2: Resolve review comments
2023-09-24 12:11:24 +02:00
Lord-McSweeney
1adde21a9b
avm2, tests: Improve String.substr; add a complex test
2023-09-24 12:11:24 +02:00
Lord-McSweeney
6a1d0e32de
avm2: Minor fix to string_wrapping_index
...
This improves the ecma3/String/substr test.
2023-09-24 12:11:24 +02:00
Aaron Hill
c20b7b37fe
Adjust behavior
2023-09-23 14:11:24 +02:00
Aaron Hill
bb4410e387
avm2: Skip nested 'goto' frame for SWF 9
...
This fixes 'who_killed_travolta', and unblocks DeathvsMonstars and
NeoPets Lost City Lanes once some additional button fixes are merged.
This isn't 100% correct (as shown by the disabled test), but it brings
us closer to what Flash Player does.
2023-09-23 14:11:24 +02:00
nosamu
e8bbb21554
avm1: tellTarget on an undefined object targets the base clip in SWF6-
2023-09-23 13:42:03 +02:00
Tom Schuster
dc53758488
avm2: Implement support for indexes in xml.child()
2023-09-22 21:28:20 +02:00
Tom Schuster
fe8390760a
avm2: Support node namespace in XML.namespace
2023-09-21 22:12:51 +02:00
Crowdin Bot
695c2ff9f5
chore: Update translations from Crowdin
2023-09-18 00:03:15 +02:00
renovate[bot]
37e2c06034
fix(deps): update rust dependencies
2023-09-18 00:00:45 +02:00
Lord-McSweeney
98cfa60832
avm2: Namespace improvements
2023-09-17 22:22:50 +02:00
Lord-McSweeney
6eddd3532e
avm2: Support Error 1089
2023-09-17 22:03:05 +02:00
Lord-McSweeney
613c21a5d2
avm2: Minor Video improvements
...
Throw RangeError when Video is initialized with negative height or width
Stub Video.clear
2023-09-16 22:55:03 +02:00
sleepycatcoding
6028505f8c
avm2: Small XML code cleanup
2023-09-15 20:20:12 +02:00
sleepycatcoding
ecbf325d41
avm2: Improve XML set_property_local implementation ( #13041 )
...
* avm2: Add error 1087
* avm2: Add deep_copy method to XmlObject
Changes existing AS3 copy method to use this instead
* avm2: Add a few utility methods to E4XNode
* avm2: Change XML.replace impl to use new utility methods
* avm2: allow setting XML/XMLList as a element
* avm2: Fix `xml_namespaced_property` test failure
* chore: fmt
* chore: Appease clippy
* avm2: Add test for XML/XMLList as element
2023-09-14 21:33:32 +00:00
Ikko Eltociear Ashimine
67f2d85e38
core: fix typo in movie_clip.rs
...
occured -> occurred
2023-09-13 23:03:14 +02:00
sleepycatcoding
b5fdd9142f
avm2: Coerce value in set slot opcode
...
This was causing a bunch of implicit conversion test failures.
2023-09-13 23:02:44 +02:00
Lord-McSweeney
53199a5116
avm2: Fix a stub message ( #13140 )
2023-09-11 17:51:55 -04:00
Nathan Adams
f092fa5809
core: Make a glyph shape handle Optional, for ie whitespace
2023-09-09 00:01:20 +02:00
Nathan Adams
bcf47622f0
core: Don't make Font/GlyphSource Clone, it's super wasteful if something did actually clone it
2023-09-09 00:01:20 +02:00
Nathan Adams
8d71ab3436
core: Make Font ascent and descent i16, as it can technically be negative
2023-09-09 00:01:20 +02:00
Nathan Adams
3758f27490
core: Move kerning info to GlyphSource
2023-09-09 00:01:20 +02:00
Nathan Adams
b8ce4e9249
core: Extract out GlyphSource from FontData
2023-09-09 00:01:20 +02:00
Nathan Adams
2cd10f614e
core: Split up Drawing's registration of the shape vs rendering of the shape
2023-09-09 00:01:20 +02:00
Nathan Adams
4d4e9b55a2
core: Refactor Glyph's internal Shape a bit, and make it not contain two duplicate shapes
2023-09-09 00:01:20 +02:00
Nathan Adams
e8e7e91584
core: Store advance separately in Glyph
2023-09-09 00:01:20 +02:00
Aaron Hill
981dedafd2
avm2: Fix avmplus.describeTypeJSON bugs and add test
2023-09-08 17:52:12 -04:00
Aaron Hill
34fb2e4f48
avm2: Fix some Object method signature definitions
...
This is exposed by avmplus.describeTypeJSON
2023-09-08 17:52:12 -04:00
nosamu
a4a9653ecd
avm2: Fix a RangeError message
2023-09-08 09:57:07 -04:00
Aaron Hill
a3e0a84a3d
core: Convert two unused doc comments to normal comments
...
This fixes Nightly warnings
2023-09-07 19:36:23 -04:00
Aaron Hill
1c0ae0b6d8
render: Bump wgpu to 0.17 and naga to 0.13
2023-09-07 18:49:59 -04:00
Lord-McSweeney
20db9f8326
avm2: Implement XML.setName ( #12979 )
...
* avm2/tests: Implement XML.setName; add a test
* avm2: Basic support for QNames in XML.setName (no namespace support yet)
* avm2: Reorder order of Attribute/Element/PI checks in XML.setName
* avm2: Throw error #1117 when the name passed to XML.setName is not a valid XML name
2023-09-07 21:47:02 +02:00
sleepycatcoding
9c7eb90d69
avm2: Implement XML.prependChild
2023-09-07 01:13:16 +02:00
Kornelius Rohrschneider
53ba75d587
Move logarithmic volume transformation to AudioMixer
...
Previously, the volume transformation to adapt the volume for
logarithmic hearing has been performed in the VolumeControls Rust struct
and TypeScript class each.
Since this calculation is the same on desktop and web and should be
implemented in the audio backend, it has been moved into the
AudioMixer::mix_audio method.
The VolumeControls struct and class now only calculate the linear volume
out of the checkbox and the slider.
Player::set_volume and Player::volume now don't take and return the
adapted volume, but use the linear volume (which gets saved internally).
2023-09-07 00:51:58 +02:00
Adrian Wielgosik
c6bad73cb2
avm2: Use ArrayObject::empty() instead of array.construct()
2023-09-06 23:53:22 +02:00
Aaron Hill
ee62044cad
avm2: Implement avmplus.describeTypeJSON and use it for describeType
...
Some SWFS (in particular, anything using Unity) call
avmplus.describeTypeJSON, and rely on the behavior of the various
flags.
This PR changes our internal implementation to implement
describeTypeJSON (producing an `Object` with dynamic fields).
We then convert this to XML in `describeType`, using an implementation
inspired by avmplus.
The existing describeType tests are passing - in a follow-up PR,
I'll add tests for describeTypeJSON
2023-09-06 23:53:22 +02:00
Lord-McSweeney
2ccd45a2af
avm2: Implement Array.insertAt
2023-09-06 23:03:57 +02:00
sleepycatcoding
db60964e2b
avm2: Bail early if character is smaller than range start
2023-09-06 23:01:34 +02:00
sleepycatcoding
936eb777e8
avm2: Implement isXMLName
2023-09-06 23:01:34 +02:00
Aaron Hill
62e9eb9d6f
avm2: Remove unnecessary '&mut self' from Object methods
2023-09-05 17:30:28 -04:00
renovate[bot]
dabc2d56b9
fix(deps): update rust dependencies
2023-09-04 10:25:24 +02:00
Lord-McSweeney
c454faf064
avm2: SharedObject::get_local should use URL of root movie
2023-08-31 19:58:53 -04:00
Lord-McSweeney
da402606e4
avm2: MovieClip::goto_frame should use the movie of the Abc method that called it
2023-08-31 19:58:53 -04:00
Lord-McSweeney
69cdb93d53
avm2: Store caller movie in Activation
2023-08-31 19:58:53 -04:00
Daniel Jacobs
d2c68350c9
avm2: Fix context parameter retrieval for Sound.load
2023-08-30 22:12:33 +02:00
Aaron Hill
24d46e7daa
avm2: Call Sound.load in constructor when passed a URLRequest
2023-08-30 21:02:41 +02:00
Abiel Deneke
0ed447b428
avm1: Set target clip to None if target is an undefined object
...
SetTarget currently sets the target clip to the base clip if the
target passed to tellTarget() is an undefined object. This causes
goto's to run on the base clip in Ruffle, when Adobe Flash Player
does not run the goto's at all.
Fixes #12389 and #12390
2023-08-29 01:23:52 +02:00
sleepycatcoding
4e6e28f78c
avm2: Correct comment
2023-08-29 00:48:48 +02:00
sleepycatcoding
430c20dd66
avm2: Small cleanup
2023-08-29 00:48:48 +02:00
sleepycatcoding
49e3546379
chore: Appease Clippy
2023-08-29 00:48:48 +02:00
sleepycatcoding
b60dd81d62
avm2: Remove parents from removed nodes
2023-08-29 00:48:48 +02:00
sleepycatcoding
80db9caf74
avm2: Implement XML.replace
2023-08-29 00:48:48 +02:00
sleepycatcoding
b3af4320e7
avm2: Add deep_copy method to XmlListObject
...
Also changes existing AS3 copy method to use that instead.
Moved as other code needs to do the same operation.
2023-08-29 00:48:48 +02:00
sleepycatcoding
fbaa02e295
avm2: Implement XML.insertChildAfter and XML.insertChildBefore
2023-08-29 00:48:48 +02:00
sleepycatcoding
aa28e51a94
avm2: Add error 1118
2023-08-29 00:48:48 +02:00
sleepycatcoding
4671122dee
avm2: Add a way to lookup E4XNode ancestors
2023-08-29 00:48:48 +02:00
renovate[bot]
4e75c3890a
fix(deps): update rust dependencies
2023-08-28 07:39:35 +02:00
Aaron Hill
2f6f00179b
avm2: Log an error when a symbol class lookup fails
...
This is almost guaranteed to cause problems, so it shouldn't
be a warning.
2023-08-27 21:15:34 -04:00
Aaron Hill
88acc96467
avm2: Fix XML/XMLDocument ignoreWhite handling for cdata
...
The ignoreWhite settings only affect text nodes, not cdata nodes.
Additionally, there should be no special case for empty text.
2023-08-27 20:28:20 -04:00
sleepycatcoding
33164d3f56
avm2: Preserve attribute flag when filling lazy multiname with QName
...
Fixes #12570
2023-08-27 19:40:00 -04:00
Aaron Hill
879dac347c
avm2: Handle child being removing from `Loader`
...
`Loader` override `removeChild` and `removeChildAt` to try to prevent
user code from removing the loaded content child. However, this can be
bypassed by calling `otherContainer.addChild(loader.content)`, which
actually removes the child from the loader. Stealth Hunter 2 relies
on this behavior.
To make this work, `Loader.content` needs to go through
`contentLoaderInfo`, instead of relying on a child being present.
2023-08-27 19:13:45 -04:00
Nathan Adams
19ad492eaa
avm2: Implement Graphics.cubicCurveTo and CUBIC_CURVE_TO
2023-08-27 20:17:43 +02:00
Nathan Adams
eb2afb19c4
render: Add DrawCommand::CubicCurveTo
2023-08-27 20:17:43 +02:00
Nathan Adams
076977cc75
render: Rename DrawCommand::CurveTo to DrawCommand::QuadraticCurveTo
2023-08-27 20:17:43 +02:00
Lord-McSweeney
04f93737c4
avm2: Make instance initialization functions variadic for int and uint
2023-08-26 13:38:33 +02:00
Lord-McSweeney
32599945bb
avm2: uint/int toPrecision/toFixed/toExponential should call Number's toPrecision/toFixed/toExponential methods. This deduplicates the methods across int and uint.
2023-08-26 13:38:33 +02:00
Lord-McSweeney
72c659fd0e
avm2: Add some static properties to Number
2023-08-26 13:38:33 +02:00
Lord-McSweeney
d366d19de6
avm2: Various (u)int/Number correctness fixes
2023-08-26 13:38:33 +02:00
SuchAFuriousDeath
40daa56f0b
avm2: partially implement Graphics.drawTriangles and drawGraphicsData ( #12559 )
2023-08-26 10:57:07 +00:00
nosamu
d25fda7cc8
avm2: Throw TypeError for null argument in TextField string property setters
2023-08-26 12:35:01 +02:00
Moulins
87437c1d6b
avm2: use `RefLock` instead of `GcCell` in avm2's scope chain
...
Also bumps gc-arena to be able to use `Write<Option<_>>::as_write`
2023-08-26 11:00:40 +02:00
Moulins
ecb5036d9e
avm1/2 use plain `RefCell` for `TextFormat` objects
...
`TextFormat` only contains static data and doesn't need write barriers
2023-08-26 11:00:40 +02:00
Moulins
c27728b7b2
avm1/2: use plain `Cell` in `Date` object
...
`Date` only contains static data, so write barrier management is
unnecessary.
2023-08-26 11:00:40 +02:00
Moulins
e2b73e80a5
avm2: use Lock instead of GcCell in BytecodeMethod
2023-08-26 11:00:40 +02:00
Moulins
9b915b7e4e
core: use GcLock instead of GcCell in FocusTracker
...
Slightly reorganizes `FocusTracker::set` to only trigger a write barrier
if the focus changed.
2023-08-26 11:00:40 +02:00
Moulins
88c7f69c57
avm1: use Lock instead of GcCell in MovieClipReference
2023-08-26 11:00:40 +02:00
sleepycatcoding
75566b92e0
avm2: XML/XMLList is converted to a string when set as attribute value
2023-08-25 11:20:51 +02:00
David Wendt
52d940b8de
core: Rename `init_buffer` to `reset_buffer`
2023-08-23 15:36:20 -06:00
David Wendt
51c8799b32
core: Rename `collect_sound_stream` to `cleanup_sound_stream`
2023-08-23 15:36:20 -06:00
David Wendt
6e3c468592
core: When reading part of a `Substream` slice for the tag reader, don't throw out the rest of it
2023-08-23 15:36:20 -06:00
David Wendt
046a1f0efc
core: When loading new data into a `NetStream` you must always clear the existing data out first.
...
`init_buffer` will remove all existing buffer state and prepare the `NetStream` to accept a new/different video.
2023-08-23 15:36:20 -06:00
David Wendt
3b90e75b17
core: AVM1 streams do not need to be attached to a movie clip in order to play audio
2023-08-23 15:36:20 -06:00
David Wendt
3fd31f1739
core: Fix #12502 .
...
This would ordinarily be a separate branch but the fix deadlocks without the new buffer type.
2023-08-23 15:36:20 -06:00
David Wendt
2d0815c013
tests: Add test cases for `SliceCursor`
2023-08-23 15:36:20 -06:00
David Wendt
4ee721e5c2
chore: Fix various cargo errors
2023-08-23 15:36:20 -06:00
David Wendt
304f04952d
core: `get_sound_duration` does not accept `SoundInstanceHandles` and I don't know why the compiler didn't flag this
2023-08-23 15:36:20 -06:00
David Wendt
a55ba16c29
core: When playing audio, queue all the tags first and then start the sound.
...
This prevents the sound from finishing before we can add a second slice to it.
2023-08-23 15:36:20 -06:00
David Wendt
8113b3a5f8
core: Allow the MP3 decoder to look ahead by up to 5 tags in the FLV to try and get rid of audio stuttering
...
Spolier alert: this doesn't work, I'm just committing this for archival purposes.
2023-08-23 15:36:20 -06:00
David Wendt
1b7eb646b6
core: Split all FLV audio, video, and script tag processing into separate functions.
2023-08-23 15:36:20 -06:00
David Wendt
257aabe4c0
core: `SubstreamChunksIter` must always advance on `next`!
2023-08-23 15:36:20 -06:00
David Wendt
782181557b
core: Fix `SubstreamTagReader`'s chunk resizing
2023-08-23 15:36:20 -06:00
David Wendt
cfe8b3c464
core: Add `LowerHex` and `UpperHex` representations of `Slice` and `SliceRef` for debugging.
2023-08-23 15:36:20 -06:00
David Wendt
7158039135
audio: Audio streamed from FLVs do not have the SWF MP3 header
2023-08-23 15:36:20 -06:00
David Wendt
dde4579a9e
core: `Substream` sounds must be started with at least one data block in them
2023-08-23 15:36:20 -06:00
David Wendt
438f53a936
core: Explicitly report a `TooManySounds` error instead of coercing all failure modes into returning `None` in `AudioManager`
2023-08-23 15:36:20 -06:00
David Wendt
be3787a489
core: Fix `SubstreamCursor` not accounting for consumed bytes properly
2023-08-23 15:36:20 -06:00
David Wendt
9b29791eeb
avm1: Implement `MovieClip.attachAudio`.
...
`NetStream`s in AVM1 do not play audio unless attached to a `MovieClip`. As far as I can tell there doesn't seem to be any equivalent API in AVM2.
2023-08-23 15:36:20 -06:00
David Wendt
dbee260d79
core: Stream audio data from FLVs into the audio backend
2023-08-23 15:36:20 -06:00
David Wendt
f5d6bf9fb9
audio: Add support for playing substream sounds through the audio manager
2023-08-23 15:36:20 -06:00
David Wendt
4b5398e122
audio: Implement `start_substream`.
...
This also removes `append_substream` since `Substream` now handles that internally.
This requires duplicating a huge chunk of the decoder code to work with `Buffer` types instead of `SwfMovie` types. Eventually we'll want to wipe out all the SWF-specific stuff and use `Buffer` exclusively.
2023-08-23 15:36:20 -06:00
David Wendt
21cedcee2e
core: `Substream` now holds a shared chunk list
2023-08-23 15:36:20 -06:00
David Wendt
e411dbeee5
core: Add a `Cursor` equivalent for `Slice`s
2023-08-23 15:36:20 -06:00
David Wendt
b46ef355fd
core: Add two new methods for managing streaming audio:
...
* `start_substream` plays audio data from a `Substream`, giving back a `SoundInstanceHandle` that can be manipulated the same way as the one from `start_stream`
* `append_substream` adds more data to an already playing `Substream` backed `SoundInstance`. In the event that a sound has finished playing, `append_substream` will fail, and you have to start a new sound stream.
This is ultimately intended to replace the current streaming audio setup, which is SWF-specific and has a number of unused parameters. It is also designed to support progressive download in the future.
We also include stub impls for `NullAudioBackend`.
2023-08-23 15:36:20 -06:00
David Wendt
c03aa31b21
core: Add a `Substream` type for referencing multiple slices of a `Buffer`.
...
A `Substream` can be read in one of two ways:
* Converting it to an iterator that yields individual chunks of the substream in `Slice` form.
* Converting it to a `SubstreamCursor`, which implements `Read` for bytewise read access.
Chunk-based reading is intended for code that needs to know about chunk boundaries. Self-terminating chunk formats should be read with the cursor type.
2023-08-23 15:36:20 -06:00
David Wendt
6f646f618b
core: Add a new `Buffer` type for shared ownership of data.
...
This is ultimately intended to replace `Vec<u8>` in both `SwfMovie` and `NetStream`, but for the time being we only apply this to streams. SWF-related types are deeply embedded elsewhere and the changes to slice dereferencing will be quite invasive.
We also remove some unnecessary reader drops in `NetStream.tick` at the same time.
2023-08-23 15:36:20 -06:00
nosamu
89d94ae098
avm2: getStackTrace() returns null when the stack trace is unavailable
...
Fixes #12572
2023-08-22 20:57:10 +02:00
nosamu
20b07ff147
avm1: Fix XML=>String coercion mangling non-ascii chars
...
Fixes #12859
2023-08-22 17:23:56 +02:00
nosamu
2f40f0093a
avm1: Unescape + to space
2023-08-22 16:38:24 +02:00
sleepycatcoding
991976e437
avm2: Implement XML pretty printing
2023-08-22 09:57:59 -04:00
sleepycatcoding
34295f25ff
chore: Appease beta Clippy
2023-08-22 15:29:01 +02:00
renovate[bot]
2f4c7d2fe3
fix(deps): update rust dependencies
2023-08-21 08:59:07 +02:00
Nathan Adams
89cc0eb31d
core: EditText::is_link_at doesn't need to evaluate fonts
2023-08-20 22:31:27 +02:00
Nathan Adams
385c2d7cb0
core: Fix links in TextEdits when scrolled down
2023-08-20 22:31:27 +02:00
Nathan Adams
f0d356589a
core: Implement avm2 event: links in texts
2023-08-20 22:31:27 +02:00
Nathan Adams
814a900b03
avm1: asfunction goes by the parent, not root
2023-08-20 22:31:27 +02:00
Nathan Adams
b8cda975f3
core: Allow clicking EditTexts if we're clicking links
2023-08-20 22:31:27 +02:00
Nathan Adams
658ac2dd9f
core: Implement url handling (+asfunction) in textedits
2023-08-20 22:31:27 +02:00
Nathan Adams
d32867d992
core: Fix getting correct text position by coordinates, in multiline text
2023-08-20 22:31:27 +02:00
Nathan Adams
506d1918dd
core: Add span list to debug window of EditTexts
2023-08-20 22:31:27 +02:00
Kornelius Rohrschneider
a50f5cd072
avm1: Remove delay to enter the unloaded state for non-root MovieClips
...
avm1_unload_movie has been adapted to only enter the unloaded state with
one frame delay if the MovieClip is a root MovieClip. The unloaded state
is now immediately entered for non-root MovieClips.
This fixes the regressions #12254 and #12265 which got introduced
because of this delay.
However, in Flash Player, even non-root MovieClips enter the unloaded
state one frame after the unloadMovie command has been read. Ruffle is
probably replacing a MovieClip differently to Flash, therefore
introducing these regressions when trying to emulate that delay.
Documentation explaining this all has been added to avm1_unload_movie.
Therefore, the test movieclip_library_state_values has been added. It
tests the default state and the unloaded state of a (non-root) child
MovieClip that's loaded from the library. It is marked as known_failure
because Ruffle currently doesn't implement the delay before entering the
unloaded state for non-root MovieClips.
2023-08-19 17:29:00 +02:00
Kornelius Rohrschneider
f582ea572c
core: Add is_root parameter to MovieClip::replace_with_movie
...
The method MovieClip::replace_with_movie accepts an
Option<Arc<SwfMovie>>. If no movie is given, an empty stub movie is
generated and used.
Previously, the IS_ROOT flag has been set for the new replaced SwfMovie,
depending on whether a movie was given to the method or not.
However, there are cases where an explicitely given movie should not be
set as a root movie (e.g. if a specific empty stub movie is given to the
method). Conversely, there are also cases where no movie is given, but
the stub movie should still be set as a root movie (e.g. in specific
MovieClip states).
Therefore, an is_root parameter has been added to the method. This
explicit parameter is now used to set the flag for the new replaced
SwfMovie.
All calls of replace_with_movie have been adapted to use the new
parameter correctly.
2023-08-19 17:29:00 +02:00
Kornelius Rohrschneider
0abe0b9386
avm1: Remove completed MovieUnloaders
...
Previously, a MovieUnloader has been kept in the LoadManager, even after
the movie has been unloaded.
This has been fixed. A remove_loader method has been added to the
LoadManager. It is now called in the avm1_unload_movie method; every
MovieUnloader will be removed after the unloaded state has been entered.
The documentation about loaders has been improved and fixed in multiple
places, clarifying how loaders are removed.
2023-08-19 17:29:00 +02:00
nosamu
050da0740a
avm1: Pass flashvars in loadMovie and MovieClipLoader
...
Fixes #11497
2023-08-19 16:45:01 +02:00
nosamu
bd82563bb6
avm2: More lenient SWF version check for invalid frame label behavior
...
Fixes #11987
2023-08-19 16:10:40 +02:00
Lord-McSweeney
89b9bc3827
core/avm2: Support accessing applicationDomain on a LoaderInfo before load starts/finishes; also improve Loader.unload stub.
2023-08-19 00:24:03 +02:00
renovate[bot]
1f4bfcf10d
fix(deps): update rust dependencies
2023-08-18 23:32:15 +02:00
Nathan Adams
a6aa72351f
avm2: Add a Function() call handler
2023-08-18 22:13:46 +02:00
Nathan Adams
7df861f212
avm2: Disallow 'new Function(args)'
2023-08-18 22:13:46 +02:00
Nathan Adams
f2233855c7
avm2: Throw proper error on 'x is SomethingThatIsntAClass'
2023-08-18 22:13:46 +02:00
Nathan Adams
46381d181a
avm2: Use correct error when trying to construct something invalid
2023-08-18 22:13:46 +02:00
Nathan Adams
8bbf8f4ea1
avm2: Use correct error in toString with invalid radix
2023-08-18 22:13:46 +02:00
Nathan Adams
c9c2e213bb
avm2: Use correct error in toPrecision
2023-08-18 22:13:46 +02:00
sleepycatcoding
2f98da44fb
avm2: String.indexOf returns -1 when passed in undefined
2023-08-18 20:41:41 +02:00
sleepycatcoding
cde49de1fb
avm2: Remove undefined specific behavior in String.split
2023-08-18 20:41:41 +02:00
sleepycatcoding
a44546ab1c
avm2: Do not ignore nulls in String.fromCharCode
2023-08-18 20:41:41 +02:00
sleepycatcoding
7316f51cb1
avm2: String.toString defaults to ""
2023-08-18 20:41:41 +02:00
sleepycatcoding
b835cc8091
avm2: Boolean.valueOf and Boolean.toString default to false
...
Makes tests `e15_6_3_1`, `e15_6_3_1_3`, `e15_6_4`, `e15_6_4__1` and `ecall_1` pass.
2023-08-18 16:07:15 +02:00
nosamu
f3feabb59a
avm2: nextScene() and prevScene() should fall back to current scene
...
Fixes #12797
2023-08-18 00:33:32 +02:00
Nathan Adams
f00671e9cc
core: Fix rendering masks + scrollRects when cacheAsBitmap
2023-08-16 16:34:24 +02:00
sleepycatcoding
f4d42ac75a
chore: fmt
2023-08-16 16:11:57 +02:00
sleepycatcoding
e1bc8ed269
core: Replace usages of MutationContext with Mutation
2023-08-16 16:11:57 +02:00
renovate[bot]
93f08d7738
chore(deps): lock file maintenance rust dependencies
2023-08-14 23:58:45 +02:00
Tom Schuster
d93c449199
avm2: Throw TypeError on unbound namespace prefix
2023-08-14 19:58:21 +02:00
Tom Schuster
7639d045ad
avm2: Limited XML namespace support
2023-08-14 19:58:21 +02:00
Nathan Adams
b274d53c6e
avm1: Hook up TextField.filters
2023-08-13 14:40:03 +02:00
Nathan Adams
b2c334b815
avm1: Hook up Button.cacheAsBitmap
2023-08-13 14:40:03 +02:00
Nathan Adams
5e1a30cf4a
core: Fix avm2 button bounding box when using scroll rects
2023-08-13 14:14:34 +02:00
Nathan Adams
3117469e20
core: simple_content_to_string and xml_to_string are now infallible
2023-08-12 20:15:21 +02:00
Nathan Adams
db7c6dec00
core: Implement XML.toString for comments and processing instructions
2023-08-12 20:15:21 +02:00
Nathan Adams
af1cb4ebd9
core: xml_to_xml_string is now infallible
2023-08-12 20:15:21 +02:00
Nathan Adams
5d9c73cbb1
core: to_xml_string is now infallible
2023-08-12 20:15:21 +02:00
Nathan Adams
135d8c08bf
avm2: to_xml_string_inner no longer needs to return a Result<(), Error>
2023-08-12 20:15:21 +02:00
Nathan Adams
bf7c17737b
avm2: Trim the start of processing instruction values
2023-08-12 20:15:21 +02:00
Nathan Adams
90b3fa4c63
avm2: Implement to_xml_string_inner for procesing instructions
2023-08-12 20:15:21 +02:00
Nathan Adams
247d61675c
avm2: Parse name and value out of XML Processing Instructions
2023-08-12 20:15:21 +02:00
Nathan Adams
8e23c7807e
avm2: Implement XMLList.processingInstructions()
2023-08-12 20:15:21 +02:00
Nathan Adams
80981e80e6
avm2: Implement XML.processingInstructions()
2023-08-12 20:15:21 +02:00
Nathan Adams
f4216aefc1
avm2: Implement XMLList.comments()
2023-08-12 20:15:21 +02:00
Nathan Adams
d4b4554553
avm2: Implement XML.comments()
2023-08-12 20:15:21 +02:00
Nathan Adams
2330a45348
avm2: Implement XMLList.toJSON()
2023-08-12 20:15:21 +02:00
Nathan Adams
c199316ad3
avm2: Implement XML.toJSON()
2023-08-12 20:15:21 +02:00
Nathan Adams
1f21f120d6
avm2: Implement XMLList.valueOf()
2023-08-12 20:15:21 +02:00
Nathan Adams
c133e50469
avm2: Implement XML.valueOf()
2023-08-12 20:15:21 +02:00
Nathan Adams
adda66723e
core: Use filters to calculate render sizes of objects
2023-08-12 13:00:27 +02:00
Nathan Adams
1a4a808c23
render: Make Filter::calculate_dest_rect work in Twips
2023-08-12 13:00:27 +02:00
Nathan Adams
da090f0bd7
render: Move filter size calculation from wgpu to render/swf
2023-08-12 13:00:27 +02:00
Nathan Adams
d35b2b8b84
core: Inform Bitmaps to invalidate, if their backing BitmapDatas change
2023-08-12 11:56:18 +02:00
Nathan Adams
f55147d7c3
core: Override render_bounds_with_transform in Avm2Button
2023-08-11 11:23:03 +02:00
Nathan Adams
f7bc92366b
core: Don't invalidate self when mask changes
2023-08-11 11:23:03 +02:00
Nathan Adams
a9c5bdfbab
core: Better handle scroll_rect and/or masks with cacheAsBitmap
2023-08-11 11:23:03 +02:00
nosamu
0b368f1223
core: Use root movie URL as base for relative NetStream URLs
2023-08-11 09:58:37 +02:00
Crowdin Bot
205ef09cc6
chore: Update translations from Crowdin
2023-08-08 23:49:31 +02:00