relrelb
a894ec5ca8
avm2: JSON serialization cannot fail
2022-09-26 19:51:38 +03:00
relrelb
a8f869329e
web: Fix config with `serde-wasm-bindgen`
...
Since `serde-wasm-bindgen` doesn't support `#[serde(default)]` (https://github.com/cloudflare/serde-wasm-bindgen/issues/20 ),
we no longer able to deserialize a partial `Config` object. As a solution,
take care to pass a full object from the TypeScript side.
2022-09-26 17:23:32 +03:00
relrelb
c9ca7e2095
avm2: Port `flash.ui.Mouse` to ActionScript
2022-09-25 16:50:03 +03:00
relrelb
e1d01b0a5e
swf: Extract `Rectangle` to a separate file
...
And make it generic, as a first step towards making it a general-purpose
data structure for the whole codebase. Some potential replacements are:
* `BoundingBox` in `render/src/bounding_box.rs`.
* `BoxBounds` in `core/src/html/dimensions.rs`.
* Parameters to a bunch of `BitmapData` methods in
`core/src/bitmap/bitmap_data.rs`.
2022-09-25 10:37:56 +03:00
relrelb
898ccfba5d
avm1: Migrate `ColorTransform` to `NativeObject`
2022-09-25 02:43:53 +03:00
golfinq
ceb877c55f
avm2: Implement error types for avm2
2022-09-25 02:27:59 +03:00
dowgird
e448f5e027
avm2: implemented flash.utils.unescapeMultiByte
2022-09-25 01:19:11 +03:00
relrelb
c532d70844
avm2: Port `flash.net.ObjectEncoding` to ActionScript
...
Along with the `flash.net.IDynamicPropertyOutput` and `flash.net.IDynamicPropertyWriter`
interfaces.
2022-09-25 00:36:31 +03:00
EmperorBale
98edcc4dc0
avm2: Add non-debug version of ErrorObject::display_full
2022-09-24 22:29:55 +02:00
Aaron Hill
66df5ea3de
avm2: Implement typed 'catch' blocks
...
Now that we have a custom `Error` enum, this is very straightforwawrd.
I've converted `getDefinitionByName` return an AVM error, since this
is commonly used by games to test for a class.
2022-09-24 13:03:29 -05:00
relrelb
b5084eef25
Revert "web: Bump `wasm-bindgen` to 0.2.83"
...
This reverts commit 1954f6162f
.
2022-09-24 09:52:25 +03:00
Aaron Hill
b571b43375
avm2: Fix some `avm_debug!` calls.
...
These were debug-printing `Gc<Multiname>` instead of `Multiname`
2022-09-24 09:16:35 +03:00
Aaron Hill
7b0bc0fb74
avm2: Implement undocumented 'Function.length' property
...
This returns the function's parameter count, and is used by the Starling
framework to implement a custom event dispatcher.
2022-09-23 18:36:23 -05:00
Aaron Hill
25f176995a
avm2: Stub flash.ui.Multitouch
...
This is needed by Starling
2022-09-23 16:04:30 -05:00
kmeisthax
d09ea7514e
chore: Oops, I meant to clamp to total frames.
...
Pointed out by @n0samu
2022-09-23 11:45:52 -06:00
David Wendt
aca1c0fb50
avm1: Clamp `WaitForFrame` ops to the total frame count of the movie clip being tested.
2022-09-23 11:45:52 -06:00
relrelb
1954f6162f
web: Bump `wasm-bindgen` to 0.2.83
...
This reverts commit cf721d45f9
and restores
commit 084b252030
, this time without updating
`web-sys`, due to being coupled to `wgpu`.
2022-09-23 17:23:35 +03:00
relrelb
4828a9c5cf
avm1: Remove `get_` prefix from `ColorTransformObject` getters
...
To match Rust naming conventions.
2022-09-23 11:10:12 +03:00
relrelb
e7643c731b
core: `ColorTransform` cleanup
...
Main changes:
* Merge `ColorTransformParams` into `ColorTransformObject`, as it's only relevant for AVM1.
* Make `BitmapData::color_transform` work with a generic `ColorTransform`, which uses fixed-point
arithmetic.
Note that Ruffle still calculates color transforms slightly different from Flash. This is probably
caused by inaccuracy of the current `ColorTransformObject` to `ColorTransform` conversion and/or the
`ColorTransform` application logic itself. Since this requires further research, it'll be fixed in a
future PR.
2022-09-23 11:10:12 +03:00
EmperorBale
a17352a01a
avm2: Switch XML & XMLList to actionscript
2022-09-22 15:18:23 -07:00
EmperorBale
1cc765d675
avm2: Implement checkfilter opcode
2022-09-22 15:18:23 -07:00
EmperorBale
6dea1fa264
avm2: Implement TypeError
2022-09-22 15:18:23 -07:00
relrelb
2c50a04e37
avm1: Remove `Value::to_primitive_num`
...
Use `Value::to_primitive` instead.
2022-09-22 22:40:07 +03:00
relrelb
d5209c4c43
core: Refactor `Percent` type
...
Unconditionally represet percentages as `f64` between `0.0` and `100.0`.
2022-09-22 04:17:44 +03:00
relrelb
9d4ab37ef6
core: Replace consecutive `push`es with `extend`
...
This should be slightly more efficient.
2022-09-22 03:00:02 +03:00
EmperorBale
fe951b4989
avm2: Implement ByteArray.writeObject
...
While doing this I also noticed that we were incorrectly producing AmfValue::Integer if our
target AMF version is AMF0. This is incorrect because AMF0 is based on AS2, which does not
recognise Integer as a valid type, and therefore must be represented with Number instead.
2022-09-21 13:39:58 -07:00
Daniel Jacobs
eefaca1e05
avm2: Add a few missed ActionScript enums
2022-09-21 20:54:36 +02:00
Aaron Hill
6ad72d0ef9
avm2: Assign 'prototype.name' through class object
...
This makes the files compile under mxmlc
2022-09-21 12:37:37 -05:00
Aaron Hill
e99c7fa4af
Add size assertions for Result<Value, Error> and Value
2022-09-21 12:37:37 -05:00
Aaron Hill
93b7de2fe6
avm2: Use custom Error instead of std::error::Error
2022-09-21 12:37:37 -05:00
Adrian Wielgosik
d1ffaad927
avm2: Support enumerating null/undefined
2022-09-21 00:03:44 +02:00
Aaron Hill
9b9c95bfe2
avm2: Add GameInput and GameInputEvent
2022-09-18 11:37:02 -05:00
EmperorBale
bfca30fed7
avm2: Implement IDataOutput
2022-09-17 12:31:43 -07:00
EmperorBale
b1aff49673
avm2: Implement IDataInput
2022-09-17 12:31:43 -07:00
EmperorBale
7aa821da4f
core: Use class index for `class_id`, instead of slot_id
2022-09-17 12:31:43 -07:00
EmperorBale
e1eaa9770a
avm2: Switch ByteArray to AS
...
avm2: Fix ByteArray
avm2: Implement ByteArray.defaultObjectEncoding
avm2: Rename ByteArray allocator
2022-09-17 12:31:43 -07:00
David Wendt
173b04cc5c
avm2: Allow access to `Stage.loaderInfo.url`
2022-09-17 12:32:15 -06:00
David Wendt
0925412110
avm2: `LoaderInfo` needs to specifically know if it's the stage's loader or not.
2022-09-17 12:32:15 -06:00
David Wendt
dbe6eb324c
avm2: Explicitly delay all frame construction until the first frame is loaded.
...
This prevents the root from being constructed until we know its `SymbolClass`, and is roughly equivalent to delaying the work until `ShowFrame`. (We don't actually run any work on `ShowFrame` in our current movieclip impl.)
2022-09-16 21:44:11 -06:00
David Wendt
247a28d7e9
avm2: Impl `Sprite.useHandCursor`
2022-09-16 19:25:46 -06:00
David Wendt
6f1509d4cd
avm2: Don't attempt to print registers that are out-of-bounds.
2022-09-16 15:46:36 -06:00
David Wendt
38c6369f6e
avm2: Fix `avm_debug` not printing debugging information
2022-09-16 15:46:36 -06:00
David Wendt
187352b1db
chore: Fix stubs to use the new `Error<'gc>` property
2022-09-15 20:25:21 -06:00
David Wendt
e7379a26e9
docs: Mark `z` as needing a version-gate once we have that set up
2022-09-15 20:25:21 -06:00
David Wendt
2b2089e9cb
docs: Bitmap subclasses tickle the "initialized by movie" code path because the DisplayObject code actually does its job here
2022-09-15 20:25:21 -06:00
David Wendt
bd8ff4f024
avm2: Add support for Bitmaps being associated to subclasses of `flash.display.Bitmap`
2022-09-15 20:25:21 -06:00
David Wendt
fc02715faa
avm2: Stub `z`, `scaleZ`, and all 3D rotation properties
2022-09-15 20:25:21 -06:00
David Wendt
3c0b9b9f62
avm1: Implement `ActionWaitForFrame` and `ActionWaitForFrame2`.
2022-09-15 19:14:41 -06:00
David Wendt
aa9e24fb9d
core: Limit gotos to the currently loaded frame count
2022-09-15 19:14:41 -06:00
David Wendt
c7e29e4173
chore: Various nitpicks and compilation fixes
2022-09-15 19:14:41 -06:00