David Wendt
dd4717e08e
avm2: Move `final`/`override` check enforcement to class construction time.
...
This is an O(n^2) algorithm, which sucks, but at least it only runs once per class rather than per *object allocation*.
2021-10-31 00:52:58 -07:00
David Wendt
8d40e41ee1
avm2: Make `Executable` zero-alloc
2021-10-31 00:52:58 -07:00
David Wendt
cea3997396
avm2: Remove `superclass_object` and related parameters from `TObject.call` and other downstream functions.
...
Turns out there's a *lot* of downstream functions.
2021-10-31 00:52:58 -07:00
David Wendt
272b1784b8
avm2: Don't skip method binding in `callproperty` if the method requires `arguments`, as it may access `callee`.
2021-10-31 00:52:58 -07:00
David Wendt
1b5869e15a
avm2: Preserve ability to `callmethod` on slot IDs that have not yet been bound, by binding them at that time.
2021-10-31 00:52:58 -07:00
David Wendt
d0d19bcf38
avm2: Stop instantiating methods at object construction time.
2021-10-31 00:52:58 -07:00
David Wendt
bfbd2271b0
avm2: Allow uninstantiated methods to be created on-the-fly.
2021-10-31 00:52:58 -07:00
David Wendt
3562c50dee
avm2: `call_property` on classes should also call unbound methods
2021-10-31 00:52:58 -07:00
David Wendt
477add3dd0
avm2: Add `ClassObject` methods for pulling unbound methods or bound method objects from the class or instance.
2021-10-31 00:52:58 -07:00
David Wendt
9c031070b3
avm2: `ClassObject` should include class traits in `TObject` methods that reference the current object's traits.
2021-10-31 00:52:58 -07:00
David Wendt
74fb965301
avm2: Call methods directly if we can find a class with an instance trait matching it's name.
2021-10-31 00:52:58 -07:00
David Wendt
039777c41e
avm2: `Object.hasOwnProperty`, `propertyIsEnumerable`, and `setPropertyIsEnumerable` only work with public-NS properties.
2021-10-30 11:44:29 -06:00
relrelb
9aed0e7db4
core: Reset `TextFormat.color` alpha
...
Since `TextFormat.color` should preserve the alpha value, and the AVM1
getter/setter no longer reset it, we need to reset it in other places:
* `TextField.textColor` setter.
* `EditText` SWF tag handling.
* HTML parsing.
And to set it explicitly to 255 in `LayoutBox::as_renderable_text`.
2021-10-30 10:03:36 -07:00
relrelb
34d1fa5226
avm1: Introduce `TextFormatObject`
...
`TextFormat` objects differ from regular objects in that
`TextField.setTextFormat` and `TextField.setNewTextFormat` accept
only the former, and ignore the latter.
Also, `TextFormat.prototype` has native accessors that coerce the
values on get/set.
2021-10-30 10:03:36 -07:00
Mike Welsh
a1130b973f
tests: Add test for GotoFrame2 after bogus tellTarget
2021-10-28 10:18:18 -07:00
Mike Welsh
bc801b2b32
avm1: GotoFrame2 after bogus SetTarget affects _root
...
For example, `tellTarget("bogus!!!") { var n = 2; gotoAndPlay(n); }`
should cause the _root clip to go to frame 2.
Fixes the character freezing in Steppenwolf 3-1 mentioned in #4585 .
2021-10-28 10:18:18 -07:00
Mike Welsh
6ac49b3d0d
tests: Add test for tellTarget with removed base clip
2021-10-28 10:18:18 -07:00
Mike Welsh
2e3154baa0
avm1: tellTarget should fail if base clip is removed
...
`tellTarget` to other clips should fail if the current base clip
has been removed. All properties of the clip return `undefined`
at this point, so traversing the target path should fail.
Fixes soft-lock in Steppenwolf 2-1 as mentioned in #4452 .
2021-10-28 10:18:18 -07:00
Toad06
a24d469f27
web: Unmute audio on iOS when silent mode is enabled
...
Co-Authored-By: Christoph Guttandin <158417+chrisguttandin@users.noreply.github.com>
2021-10-28 08:48:22 -07:00
Chris Midgley
755e5456da
chore: use node 16 in nightly release as well
2021-10-26 13:21:55 -07:00
Chris Midgley
781edd0feb
web: preferentially use node 16 to compile
2021-10-26 13:21:55 -07:00
Mike Welsh
26e0432ccc
wgpu: Fix some invalid WGSL
...
naga is currently lenient about some things which are invalid by
the WGSL spec. The Tint WGSL compiler disagreed, so these shaders
failed to compile in Chrome.
2021-10-25 21:59:09 -07:00
EmperorBale
5ac8e75239
avm2: Make ObjectEncoding C-like
2021-10-25 16:32:55 -07:00
EmperorBale
bab74f83fc
avm2: Remove all unsafe from bytearray
2021-10-25 16:32:55 -07:00
EmperorBale
9126c9297c
avm2: Derive PartialEq and Eq for enums
2021-10-25 16:32:55 -07:00
EmperorBale
69f2002d2a
avm2: Add todo comment
2021-10-25 16:32:55 -07:00
EmperorBale
1e9189dffc
tests: Improve AMF3 test
2021-10-25 16:32:55 -07:00
EmperorBale
84a7b3d148
tests: Add test for reading AMF0 objects
2021-10-25 16:32:55 -07:00
EmperorBale
e7a723f250
tests: Add test for reading AMF3 objects
2021-10-25 16:32:55 -07:00
EmperorBale
da601a4984
chore: Improve safety comments
2021-10-25 16:32:55 -07:00
EmperorBale
3b2a84ef9b
chore: Small cleanups
2021-10-25 16:32:55 -07:00
EmperorBale
b257e5537c
chore: Appease clippy
2021-10-25 16:32:55 -07:00
EmperorBale
42fe351c0d
avm2: Optimize readBytes & writeBytes by implementing write_at_within
2021-10-25 16:32:55 -07:00
EmperorBale
e86bdfdc3e
avm2: Remove unneeded condition
2021-10-25 16:32:55 -07:00
EmperorBale
3f3e600820
chore: Appease clippy
2021-10-25 16:32:55 -07:00
EmperorBale
83005a7ce5
avm2: Update flash-lso version
2021-10-25 16:32:55 -07:00
EmperorBale
efb3062d98
avm2: Add flash.net.ObjectEncoding
2021-10-25 16:32:55 -07:00
EmperorBale
e5fc2c8e66
avm1: Update SharedObject
2021-10-25 16:32:55 -07:00
EmperorBale
e2c2ac8961
avm2: Implement ByteArray.readObject + flash.net.ObjectEncoding
2021-10-25 16:32:55 -07:00
EmperorBale
c191340972
avm2: Refactor readBytes & writeBytes
2021-10-25 16:32:55 -07:00
Mike Welsh
d58ecf0bcf
ci: Enable WebGPU support in demo
...
ruffle.rs should be part of the Chrome WebGPU origin trial, so we
can enable wgpu feature to try it out.
It should gracefully fall back to WebGL when WebGPU is not
available.
2021-10-25 14:00:37 -07:00
EmperorBale
f6c5e2e0dc
avm2: Add test for array enumeration on elements
2021-10-25 13:45:29 -07:00
EmperorBale
67ffc7bcc8
avm2: Forward get_enumerant_name and property_is_enumerable to base when not found
2021-10-25 13:45:29 -07:00
dependabot[bot]
9349f87bf7
build(deps): bump embed-resource from 1.6.4 to 1.6.5
...
Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource ) from 1.6.4 to 1.6.5.
- [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases )
- [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.6.4...v1.6.5 )
---
updated-dependencies:
- dependency-name: embed-resource
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 13:40:48 -07:00
Mike Welsh
16c443165f
web: Add error-report label to bug report link
2021-10-24 17:21:03 -07:00
Mike Welsh
bbb788ced3
desktop: Improve error message for GL
...
wgpu only supports OpenGL on Linux, so provide a better message if
a user tries to use the GL backend on Windows/macOS.
2021-10-24 17:20:19 -07:00
Mike Welsh
2b57c0947a
wgpu: Disallow DX11 backend
...
This backend has not yet been reimplemented in wgpu 0.10+, so
disallow it for now.
2021-10-24 17:20:19 -07:00
Mike Welsh
e10d0fcbe7
wgpu: Switch shaders to WGSL
2021-10-24 17:20:19 -07:00
Mike Welsh
4141909bcb
web: Support wgpu on web
...
Add wgpu feature to web build (disabled by default currently).
2021-10-24 17:20:19 -07:00
Mike Welsh
df11cd6a04
web: Enable web_sys_unstable_apis
...
Enable web_sys_unstable_apis RUSTFLAGS in .cargo/config.toml.
These are necessary to use WebGPU in the browser, as well as other
features such as clipboard.
2021-10-24 17:20:19 -07:00