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
renovate[bot]
a4b179e1e0
chore(deps): lock file maintenance rust dependencies
2023-08-08 23:19:16 +02:00
MrCheeze
68f8cd6149
avm2: Remove focus from an EditText when it unloads ( close #12092 )
2023-08-07 23:16:06 +02:00
Daniel Jacobs
bb1f405a19
core: Reset preload_offset when loading new netstream
2023-08-07 14:31:33 -06:00
Daniel Jacobs
dbb5e381f2
core/desktop/web: Play unsupported videos with browser
2023-08-07 14:31:33 -06:00
SuchAFuriousDeath
37085767f6
avm2: implement BitmapData.merge ( #12593 )
2023-08-06 22:14:10 +00:00
Nathan Adams
0381116934
avm2: Don't make the descendants op call a function to get descendants, just get it directly
2023-08-06 10:51:25 +02:00
Nathan Adams
42b4812601
avm2: Throw error when using descendants op (..) on anything that isn't XML, even if it has descendants property
2023-08-06 10:51:25 +02:00
michiel2005
690ce110d8
avm1: reference displayObjects parents if parent is a button ( #12541 )
2023-08-05 20:32:03 +00:00
Lord-McSweeney
2c90b1631b
avm2: Implement context menu events
2023-08-05 22:06:10 +02:00
sleepycatcoding
b98b0e88aa
chore: fmt
2023-08-05 14:42:09 +02:00
sleepycatcoding
f6da7258c5
avm1,avm2: Rename some functions to make them consistent between Sockets
2023-08-05 14:42:09 +02:00
sleepycatcoding
2468c71d02
core: Implement suggestion from review
2023-08-05 14:42:09 +02:00
sleepycatcoding
aac1931569
avm1: Prevent panic when close is called in event handler
...
Also adds a test case for this.
2023-08-05 14:42:09 +02:00
sleepycatcoding
82c57a0d97
avm2: Clear tempBuf when closing connection
2023-08-05 14:42:09 +02:00
sleepycatcoding
d8ae2ce6b9
avm1: Fix only one message arriving when multiple are sent in the same packet
...
Test case has been improved to cover this.
2023-08-05 14:42:09 +02:00
sleepycatcoding
cec74242cf
core: Socket subsystem fixes
...
Clears the read and write buffer of Socket before returning to ActionScript, this could potentially be problematic
when a SWF reuses the same Socket to connect.
Also remove the handle from Arena when server closes the connection, this fixes
connected still returning true after server disconnection.
2023-08-05 14:42:09 +02:00
sleepycatcoding
d3e627fb5f
core: Clear the read buffer when the connection is closed
2023-08-05 14:42:09 +02:00
sleepycatcoding
358d3e8ede
chore: fmt
2023-08-05 14:42:09 +02:00
sleepycatcoding
8293a2db75
avm1: Write null byte when sending out a message
2023-08-05 14:42:09 +02:00
sleepycatcoding
e4b7cc2afd
avm1: Replace avm_warn! with tracing::warn!
2023-08-05 14:42:09 +02:00
sleepycatcoding
01801980f4
core: Rename some imports to make code more readable
2023-08-05 14:42:09 +02:00
sleepycatcoding
783527fbad
chore: Fix clippy warning
2023-08-05 14:42:09 +02:00
sleepycatcoding
87b7af4370
avm1: Use movie domain when null is passed as host
2023-08-05 14:42:09 +02:00
sleepycatcoding
25b1ed7e9c
avm1: Implement onData()
2023-08-05 14:42:09 +02:00
sleepycatcoding
2b18a5999b
chore: fmt
2023-08-05 14:42:09 +02:00
sleepycatcoding
705042c1ee
chore: Fix a warning
2023-08-05 14:42:09 +02:00
sleepycatcoding
dccf254281
avm1: Implement some event handlers
2023-08-05 14:42:09 +02:00
sleepycatcoding
78a68f95ea
avm1: Implement send()
2023-08-05 14:42:09 +02:00
sleepycatcoding
b64c45f797
avm1: Implement connect()
2023-08-05 14:42:09 +02:00
sleepycatcoding
931c355779
avm1: Use Gc instead of GcCell
2023-08-05 14:42:09 +02:00
sleepycatcoding
7237295364
chore: fmt
2023-08-05 14:42:09 +02:00
sleepycatcoding
cd92677b2a
core: Add SocketKind and use it to separate XMLSocket and Socket
2023-08-05 14:42:09 +02:00
sleepycatcoding
662c7f986d
avm1: Implement onData
2023-08-05 14:42:09 +02:00
sleepycatcoding
879750d3e1
avm1: Stub rest of XMLSocket methods
2023-08-05 14:42:09 +02:00
sleepycatcoding
13ce61a00a
avm1: Implement close()
2023-08-05 14:42:09 +02:00
sleepycatcoding
9c92cf0c98
avm1: Implement timeout
2023-08-05 14:42:09 +02:00
sleepycatcoding
773168fe10
avm1: Create simple XMLSocket stub
2023-08-05 14:42:09 +02:00
sleepycatcoding
c9c4efe574
avm2: Review remarks
2023-08-05 14:17:02 +02:00
sleepycatcoding
e8bc47a569
avm2: Return correct error if Event.clone() returns null
2023-08-05 14:17:02 +02:00
sleepycatcoding
925ed2e82b
avm2: Clone event if it has been dispatched before
2023-08-05 14:17:02 +02:00
Lord-McSweeney
76a7c69522
avm2: Use Error #2008 in some places in TextField
2023-08-05 13:42:16 +02:00
Lord-McSweeney
3fbde2076c
avm2: Use Error #2004 for flash.crypto::generateRandomBytes
2023-08-05 13:42:16 +02:00
Lord-McSweeney
fd04463476
avm2: Use make_error_2008 for set objectEncoding on ByteArray
2023-08-05 13:42:16 +02:00
Lord-McSweeney
f753d840b6
avm2: Add errors #2024 , #2150 , and #3738
2023-08-05 13:42:16 +02:00
Lord-McSweeney
855825b6ac
avm2: Create a make_error_1506 function and use it
2023-08-05 13:42:16 +02:00
Lord-McSweeney
c39d006a78
avm2: Use correct error #2025 in various places in DisplayObjectContainer
2023-08-05 13:42:16 +02:00
Adrian Wielgosik
f75b36a32a
core: Remove lots of uses of derive(Collect)
2023-08-04 21:43:18 +02:00
Nathan Adams
5f200dc2a9
avm2: Use correct error in write ops when reading past bounds
2023-08-03 16:28:25 +02:00
Nathan Adams
af46301020
avm2: Use correct error in Li ops when reading past bounds
2023-08-03 16:28:25 +02:00
Nathan Adams
3d76953574
avm2: Use correct error when accessing domain memory out of bounds
2023-08-03 16:28:25 +02:00
sleepycatcoding
f5f5680e3a
avm2: Fix an error message
2023-08-02 22:16:16 +02:00
sleepycatcoding
7d61f8f947
avm2: Wrap Socket instead of extending
2023-08-02 22:16:16 +02:00
sleepycatcoding
43ce490c0f
chore: fmt
2023-08-02 22:16:16 +02:00
sleepycatcoding
3fd53b8ca1
avm2: Implement connect() special-case
2023-08-02 22:16:16 +02:00
sleepycatcoding
85db727f17
avm2: Implement XMLSocket
2023-08-02 22:16:16 +02:00
Nathan Adams
ab27c8b4ee
render: Calculate correct bounds for shapes containing curves
2023-08-02 18:43:33 +02:00
Nathan Adams
020dc34b59
avm2: Throw errors in theoretically unreachable scenario in XmlDocument
2023-08-02 15:55:08 +02:00
Nathan Adams
3834462abf
avm2: Hook up XMLDocument.ignoreWhite
2023-08-02 15:55:08 +02:00
Nathan Adams
6f2420d983
avm2: Implement ignoreComments/ignoreProcessingInstructions/ignoreWhitespace
2023-08-02 15:55:08 +02:00
Nathan Adams
da7ee01730
avm2: Implement XML.settings/XML.setSettings/XML.defaultSettings, and add appropriate properties to XML class
2023-08-02 15:55:08 +02:00
Nathan Adams
10e59067d0
avm2: Rewrote XMLDocument/XMLNode to be more correct
2023-08-02 15:55:08 +02:00
Lord-McSweeney
84e4215ece
avm2+tests: Various Vector-related fixes; activate now-passing Vector tests
2023-08-02 15:26:53 +02:00
renovate[bot]
477ff400a7
chore(deps): lock file maintenance rust dependencies
2023-08-02 13:36:13 +02:00
TÖRÖK Attila
515df16a38
debug_ui: Indent non-expandable items in object- and display trees
2023-08-02 10:32:22 +02:00
relrelb
006393c581
chore: Appease nightly clippy
2023-08-01 22:44:00 +03:00
Aaron Hill
66eadc8f7c
avm2: Implement Loader.uncaughtErrorEvents
...
This can just delegate to LoaderInfo
2023-07-31 21:29:02 -04:00
Adrian Wielgosik
2621dd78ee
avm2: Vector doesn't support propertyIsEnumerable
2023-08-01 00:13:46 +02:00
Adrian Wielgosik
b61e92ee12
avm2: Fix property_is_enumerable on arrays
2023-08-01 00:13:46 +02:00
Aaron Hill
1107851d15
core: Fix debug_ui mouse search on HiDPI display
...
We need to scale the mouse position that egui gives us
by the scale factor, in order to get in the format
expected by our inverse view matrix
2023-07-31 17:38:20 -04:00
sleepycatcoding
2ba3b90754
core: Redesign socket data passing
...
This allows to make socket tests more reliable
2023-07-31 22:32:03 +02:00
Abiel Deneke
6552b4e132
avm2: Implement `Matrix3D.prependScale`
2023-07-31 17:00:44 +02:00
TÖRÖK Attila
a023ca605d
core: Don't divide by zero in BitmapData::perlinNoise() if baseX or baseY is 0.0
2023-07-31 16:41:01 +02:00
Tom Schuster
8fa6a0d249
avm2: Make XMLList set_property_local (aka [[put]]) less error happy
...
This doesn't really enable any new functionality, but prevents throwing
Errors for things that are allowed in Flash/ECMA-357.
2023-07-30 11:41:11 +02:00
Tom Schuster
f237aa1da2
avm2: Implement XMLNode.nodeValue
2023-07-30 11:14:00 +02:00
Aaron Hill
4406a70fc9
avm2: Enable Vector.<ObjectSubclass> serialization tests
...
This also fixes a minor bug (we should always deserialize
to a `Vector.<Object>`, not a `Vector.<*>`)
2023-07-29 15:30:24 -04:00
Adrian Wielgosik
86ba4fef9b
avm2: Add void type
2023-07-29 19:57:44 +02:00
Nathan Adams
f9be8be99e
avm2: Make 'new Math()' and 'Math(value)' throw errors
2023-07-29 15:24:30 +02:00
Lord-McSweeney
bcd96f5b40
avm2: Stub flash.text.engine:EastAsianJustifier
2023-07-29 10:48:30 +02:00
Lord-McSweeney
6a96a14098
avm2: Improve flash.text.engine stub
2023-07-29 10:48:30 +02:00
Adrian Wielgosik
b68ac23cbb
avm2: Remove redundant check for Vector<undefined>
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
30d4026227
avm2: Expand comments
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
2352c200e0
chore: clippy
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
22d7ffdefc
avm2: fix Vector null display
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
b8a5b9ede1
avm2: Refactor VectorStorage value_type to accurately reflect stored <T>.
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
733e84957d
avm2: Do not panic on Vector.<1>
2023-07-28 23:42:04 +02:00
Adrian Wielgosik
f504e9d0b4
avm2: Refactor Vector.<T> class creation
2023-07-28 23:42:04 +02:00
Nathan Adams
d1703610a9
avm2: Temporarily limit arrays to 1<<28
2023-07-28 22:22:47 +02:00
Marc Bornand
c8e4ec98f0
avm2: Add PressAndTapGestureEvent
2023-07-28 20:50:40 +02:00
Marc Bornand
f61c1f8713
avm2: Add TransfromGestureEvent
2023-07-28 20:50:40 +02:00
Lord-McSweeney
cf5c02ca1b
avm2+tests: Fully implement XML.appendChild, add a test
2023-07-28 15:21:38 +02:00
Lord-McSweeney
e542cedbb2
avm2: Special case Number.toString for Infinity and NaN
...
This avoids getting into an infinite loop.
2023-07-28 13:11:15 +02:00
sleepycatcoding
02d815e86b
avm2: Implement XML addition operations
2023-07-27 23:39:06 +02:00
Nathan Adams
70fb674d8b
avm2: Implement correct errors for write_bytes with offset+length > u32::MAX
2023-07-27 19:47:16 +02:00
Nathan Adams
3b6068bbe7
avm2: Change EofError to ByteArrayError
2023-07-27 19:47:16 +02:00
Nathan Adams
f6d2620605
avm2: Throw correct error when setting bytearray.endian to wrong value
2023-07-27 19:47:16 +02:00
Nathan Adams
1bbefbe472
avm2: Throw correct error when writing a too-large string to ByteArray
2023-07-27 19:47:16 +02:00
Jaroslav Bělák
08ab99f2ed
core: Implement ToXMLString for Attribute and Comment node kind
2023-07-27 15:04:24 +02:00
Nathan Adams
cb23067382
avm2: Implement UninitializedError
2023-07-27 09:49:47 +02:00
Nathan Adams
5fc37c7e13
avm2: Implement call handler for Error
2023-07-27 09:49:47 +02:00
Aaron Hill
583caa3389
avm2: Implement DisplayObject.blendShader ( #12238 )
2023-07-26 23:25:26 +00:00
Aaron Hill
99ed2c6d4a
avm2: Fix handling of default domain memory ( #12308 )
2023-07-26 18:26:26 +00:00
Nathan Adams
55906c22fa
desktop: Change 'socket mode' text to 'TCP Connections'
2023-07-26 19:44:39 +02:00
Nathan Adams
0f4edf9574
avm2: Implement fscommand()
2023-07-26 17:00:15 +02:00
Nathan Adams
1a0a82d898
core: Move fscommand execution outside of ExternalInterfaceProvider, so it can be implemented without causing ExternalInterface.available to become true
2023-07-26 17:00:15 +02:00
sleepycatcoding
c8b6a1cb4c
core: Send data directly to socket task
...
This improves socket latency. Sometimes the ping is better in Ruffle than
in Flash Player!
2023-07-26 14:01:03 +02:00
sleepycatcoding
f3917c8c62
core: Run async tasks until stalled
...
Previously it used run which tries to run until completion, but we can't do
that if we are testing socket behavior.
2023-07-26 14:01:03 +02:00
TÖRÖK Attila
365f6bee6e
avm2: Clamp filter quality to (0, 15) instead of (1, 15)
2023-07-26 13:03:11 +02:00
Aaron Hill
a91b0cf5cb
avm2: Don't error in DisplayObject.removeChildren when `to` is max
...
Our previous special-case wasn't broad enough
2023-07-25 21:44:23 -04:00
Aaron Hill
3c64e8e249
avm2: Implement AMF Vector serialization/deserialization
...
Some of the tests are currently disabled because (separate from this PR)
we can't actually run `toString()` on a Vector.<Object>, due to our
broken vector handling.
2023-07-25 09:35:50 -04:00
Lord-McSweeney
38b4357f59
avm1: Implement Button.filters
2023-07-25 14:20:36 +02:00
CUB3D
7346f9f6cb
avm1: Differentiate between clips with no name set and empty string names
2023-07-25 08:25:37 +02:00
renovate[bot]
3e63a88c34
chore(deps): lock file maintenance rust dependencies
2023-07-25 08:23:28 +03:00
TÖRÖK Attila
cee19c5735
core: Fix dirty region set by bitmap::set_pixel
2023-07-25 00:38:08 -04:00
sleepycatcoding
f2c9237ea1
avm2: Allow setting prototype to undefined ( #12282 )
...
* avm2+tests: Allow setting prototype to undefined
This is used internally by Adobe Flex in many places. Also add test.
* avm2: Set prototype when constructing a Function with null prototype
* tests: Expand prototype_set_null test
* chore: fmt
2023-07-24 20:41:38 +00:00
Aaron Hill
7a5c729d63
core: Use a slightly better DefineFont4 stub
...
This makes a Character available for a SymbolClass to link with
2023-07-24 14:58:01 -04:00
Nathan Adams
92e3e44453
avm1: Reverse iteration when applying filters - fixes #12272
2023-07-24 13:44:02 +02:00
Aaron Hill
8941a0bb79
avm2: Clamp ByteArray.position when ByteArray.length is set
...
Note that ByteArray.position can manually be set out-of-range
afterwards.
2023-07-23 14:51:30 -04:00
Aaron Hill
005fdffd05
avm2: Correctly set fields on ShaderInput and ShaderParameter
...
The special meta key `defaultValue` should be used to set
the default `value` field. Also, `index` is the position
within *just* the image or texture params, not within
all of the params.
2023-07-23 13:52:26 -04:00
sleepycatcoding
6c4f707e36
chore: fmt
2023-07-23 09:13:01 +02:00
sleepycatcoding
48fcc5ffe9
avm2: Check is_connected in flush() and close()
2023-07-23 09:13:01 +02:00
sleepycatcoding
5218bbf32f
chore: fmt
2023-07-23 09:13:01 +02:00
sleepycatcoding
adeb50a3d7
avm2: Check if socket is open before trying to read or write
2023-07-23 09:13:01 +02:00
sleepycatcoding
74b66fdd73
core+desktop: Rename SocketBehavior to SocketMode
...
Also change command line flag from --socket to --socket-mode
2023-07-23 09:13:01 +02:00
sleepycatcoding
2c79d22578
avm2: Do not panic when SocketHandle does not exist
2023-07-23 09:13:01 +02:00
sleepycatcoding
68fd0ce73c
core: Differentiate between TimedOut and Failed connection
2023-07-23 09:13:01 +02:00
sleepycatcoding
ac1badc64f
core: remove Option for connection timeout
2023-07-23 09:13:01 +02:00
sleepycatcoding
5144162e68
avm2: Set timeout in AS3 constructor
2023-07-23 09:13:01 +02:00
sleepycatcoding
568d8dfe11
core: Fix panic when socket is closed before connecting
2023-07-23 09:13:01 +02:00
sleepycatcoding
6e6205d20d
core: Use timeout in Navigator::connect_socket
2023-07-23 09:13:01 +02:00
sleepycatcoding
f54e0e9097
avm2: Make get/setTimeout native
2023-07-23 09:13:01 +02:00
sleepycatcoding
a3a49335eb
chore: Fmt
2023-07-23 09:13:01 +02:00
sleepycatcoding
6c3b6e5109
avm2: Implement read/writeObject()
2023-07-23 09:13:01 +02:00
sleepycatcoding
ea3d6e2a5c
avm2: Implement set/getobjectEncoding()
2023-07-23 09:13:01 +02:00
sleepycatcoding
9de2912765
avm2: Implement read/writeMultiByte()
2023-07-23 09:13:01 +02:00
sleepycatcoding
5ed9dbc16b
avm2: Implement read/writeUTF
2023-07-23 09:13:01 +02:00
sleepycatcoding
6ca6bb1d78
avm2: Implement read/writeUTFBytes
2023-07-23 09:13:01 +02:00
sleepycatcoding
ad51041457
avm2: Implement readBytes()
2023-07-23 09:13:01 +02:00
sleepycatcoding
e1a82570fe
avm2: small cleanup
2023-07-23 09:13:01 +02:00
sleepycatcoding
22eb150756
desktop: add SocketBehavior and host whitelist
...
This adds a way to modify socket behavior to restrict, ask, or allow all
connections. Also adds a whitelist which can be used to allow specific hosts
without enabiling ask or allow all behaviors.
2023-07-23 09:13:01 +02:00
sleepycatcoding
4c540c9f17
avm2: Implement read/writeBoolean()
2023-07-23 09:13:01 +02:00
sleepycatcoding
45d3e141f8
avm2: Improve IOErrorEvent for Socket
...
IOErrorEvent now uses a error message and ID.
2023-07-23 09:13:01 +02:00
sleepycatcoding
0699c34881
chore: Fmt
2023-07-23 09:13:01 +02:00
sleepycatcoding
676516a99c
core: use get instead of get_mut
...
We did not need mutability for this.
2023-07-23 09:13:01 +02:00
sleepycatcoding
ea7264eab5
core: Dispatch IOErrorEvent when connection fails
2023-07-23 09:13:01 +02:00
sleepycatcoding
d1a17ebeb1
chore: Fix clippy lint
2023-07-23 09:13:01 +02:00
sleepycatcoding
5080c19d11
core: Make socket connection async
...
Changes socket system to use asynchronous means to not generate lagspikes
when connecting to servers.
2023-07-23 09:13:01 +02:00
sleepycatcoding
2da61bc57f
avm2: Some nits
...
Use ProgressEvent for socketData event instead of a bare event.
Remove unwraps and use correct errors/exceptions.
Correct name in make_error_2008 call.
Use expect() for getting ByteArray instead of an error.
Correct some get_*() calls
2023-07-23 09:13:01 +02:00
sleepycatcoding
fc06dcbed6
avm2: Add SecurityError to globals
2023-07-23 09:13:01 +02:00
sleepycatcoding
f64ca6aa85
avm2: Use ParametersExt
2023-07-23 09:13:01 +02:00
sleepycatcoding
6da0dbc287
avm2: Implement close()
2023-07-23 09:13:01 +02:00
sleepycatcoding
dea9797891
avm2: Implement many primitive write methods
2023-07-23 09:13:01 +02:00
sleepycatcoding
238bc6784c
avm2: Implement many primitive read methods
2023-07-23 09:13:01 +02:00
sleepycatcoding
bca70dd102
core: Add read bytes to read buffer
2023-07-23 09:13:01 +02:00
sleepycatcoding
2dcc3e7930
avm2: Add read_buffer and implement bytesAvailable
2023-07-23 09:13:01 +02:00
sleepycatcoding
487d881793
avm2: Implement flush()
2023-07-23 09:13:01 +02:00
sleepycatcoding
3dfb6e3bb1
avm2: Implement writeByte and writeBytes
2023-07-23 09:13:01 +02:00
sleepycatcoding
60de72fc3e
avm2: Implement endian() methods
2023-07-23 09:13:01 +02:00
sleepycatcoding
d6f6d432fa
avm2: Implement connect and connected
2023-07-23 09:13:01 +02:00
sleepycatcoding
c22f97445a
avm2: Add SocketObject
2023-07-23 09:13:01 +02:00
sleepycatcoding
ad72c56cb4
core: Implement socket backend
2023-07-23 09:13:01 +02:00
Nathan Adams
4219f39668
avm2: Throw proper error when setting name of timeline objects
2023-07-23 01:18:53 +02:00
Aaron Hill
5ee6218ab4
avm2: Fix `super_vtable` in `describeType`
...
This more closely matches what avmplus does.
2023-07-22 17:50:10 -04:00
Nathan Adams
586c3bebf6
core: Remove unsupported content warning
2023-07-22 23:08:42 +02:00
Abiel Deneke
8f6e9d8f63
avm2: Don't change the length of a fixed output Vector
2023-07-22 16:11:08 -04:00
Nathan Adams
d1cfb1b8d1
avm2: Implement delete_property_local for XMLList
2023-07-22 18:24:08 +02:00
nosamu
02476f70dd
avm2: Stub GameInputDevice, LocaleID, NumberFormatter, and NumberParseResult
2023-07-21 22:51:13 -04:00
Nathan Adams
4410d666ed
avm2: Implement Bitmap.pixelSnapping
2023-07-22 00:34:17 +02:00
Nathan Adams
289f73c85f
core: Add pixel snapping (default auto) to Bitmaps, and force it for cacheAsBitmap
2023-07-22 00:34:17 +02:00
Lord-McSweeney
68c5024f21
tests: Add test for LocalConnection.send
2023-07-22 00:00:24 +02:00
Lord-McSweeney
7b21815660
avm2: Improve LocalConnection.send stub
2023-07-22 00:00:24 +02:00
Nathan Adams
98ce792a5b
avm1: Implement BitmapData.applyFilter()
2023-07-21 21:43:54 +02:00
Aaron Hill
f328797d04
avm2: Fix bugs with describeType interfaces and methods
...
Interfaces should only be listed when calling describeType
with a class instance (not with a `Class` object).
Additionally, AS3 methods can actually be displayed under
some circumstances. This is due to weird legacy behavior
that avmplus implements. A full fix requirs us to implement
namespace versioning, but we can get closer by special-casing
playerglobals (which is special-cased by namespace versioning
anyway).
2023-07-21 15:23:56 -04:00
nosamu
2ee127ccb6
core: Fix cacheAsBitmap size limit & remove print statement
2023-07-21 09:22:12 +02:00
Nathan Adams
67c33ef9c3
core: Disable cacheAsBitmap for swfs that are too large (depending on swf version)
2023-07-20 23:19:20 +02:00
Nathan Adams
b201e19cc7
wgpu: Don't create an extra fresh texture for applying filters to a CAB
2023-07-20 23:19:20 +02:00
Nathan Adams
e66f2397b5
core: Avoid some work in render_base if we're not cacheAsBitmap
2023-07-20 23:19:20 +02:00
Nathan Adams
f030680084
core: Don't invalidate self on changing blend mode
2023-07-20 23:19:20 +02:00
Nathan Adams
b6a8e0a471
core: Don't invalidate self on changing visibility
2023-07-20 23:19:20 +02:00