Aaron Hill
bc240db517
avm2: Convert SimpleButton to AS
2023-02-24 16:08:29 -06:00
Aaron Hill
d31c686360
avm2: Convert MovieClip to AS
2023-02-24 16:08:29 -06:00
Aaron Hill
aa7dc52b82
avm2: Convert Sprite to AS
2023-02-24 16:08:28 -06:00
Aaron Hill
d996aecb04
avm2: Convert Shape to AS
2023-02-24 16:08:28 -06:00
Aaron Hill
39063a5a04
avm2: Add Graphics stub
2023-02-24 16:08:28 -06:00
Aaron Hill
8831042e8f
avm2: Convert LoaderInfo to AS
2023-02-24 16:08:28 -06:00
Aaron Hill
be16286407
avm2: Convert several flash.display and flash.events classes to AS
...
These classes all reference each other, so it's difficult to convert
them individually.
2023-02-24 16:08:28 -06:00
Aaron Hill
6ce7bd3277
avm2: Convert EventDispatcher and IEventDispatcher to AS
2023-02-24 16:08:28 -06:00
Aaron Hill
cd2770ce7e
avm2: Add SoundTransform stub
2023-02-24 14:48:51 -06:00
EmperorBale
99aa274e0f
avm2: Stop loading scripts in reverse order
2023-02-24 11:55:58 -08:00
EmperorBale
5bc3c696b5
avm2: Ignore duplicate definitions
2023-02-24 11:55:58 -08:00
feos
871a4d053d
core: add framerate to SWF load log
...
fixes #8531
2023-02-24 12:13:00 +02:00
TÖRÖK Attila
5a7cd92bfe
avm2: Use a lookup table for cosine in SoundMixer.computeSpectrum()
...
This results in 128 times fewer calls to the builtin cosf function.
2023-02-23 23:51:55 +01:00
Aaron Hill
5f4bf7b5fa
avm2: Stub Capabilities.manufacturer and Capabilities.language
...
These are needed by Steambirds: Survival
2023-02-23 12:25:34 -06:00
Nathan Adams
3a29ebc600
avm2: Comment where our RangeErrors have different-to-flash text in DOC
2023-02-23 08:12:42 -06:00
Nathan Adams
5f7978cfa5
avm2: Use avm errors for RangeErrors inside DisplayObjectContainer
2023-02-23 08:12:42 -06:00
Nathan Adams
e17b154d47
avm2: Iterate the inheritance chain for class-symbol linkage
2023-02-22 22:27:13 +01:00
Aaron Hill
203d4cd3aa
avm2: Use Value::Undefined for out-of-range Vector enumerant index
...
This makes Vector consistenht with the other implementations
of `get_enumerant_name`. This also fixes a bug where AMF object
serialization would loop all te way to `u32::MAX` when serializing
a vector, because it would never see `Value::Undefined` and break.
2023-02-22 15:03:09 -06:00
Aaron Hill
f1b0247de7
avm2: Remove install_trait_late
2023-02-22 14:41:01 -06:00
Aaron Hill
c52f1082c4
avm2: Make `early_resolve_interface` take in a `domain` directly
2023-02-22 14:41:01 -06:00
Aaron Hill
c258423dc3
avm2: Allow resolving interfaces before ClassObjects are available
...
The Adobe Animate compiler can emit a 'newclass' opcode for
a concrete class before the 'newclass' opcodes for the interfaces
it implements. As a result, we cannot rely on looking up an interface
`ClassObject` when resolving a class's interfaces.
We now store a map of exported classes in `Domain`, and use this
to lookup interfaces before their `ClassObject`s have been created.
Additionally, `link_interfaces` was failing to consider superinterfaces,
which meant that methods from superinterfaces were not being copied
into the vtable. I've fixed this along with the other changes.
2023-02-22 14:41:01 -06:00
Bale
2cfa97e84d
avm2: ByteArray.readUTF/readUTFBytes should cut off after null byte ( #9673 )
...
* avm2: Fix #9668
* tests: Extend ByteArray test
2023-02-22 18:47:59 +00:00
Marty_SVK
fac7fc0666
Stub System.pauseForGCIfCollectionImminent
...
This progresses Papas Scooperia
2023-02-22 12:34:13 -06:00
Nathan Adams
e8fcc8b194
avm2: Don't reset SimpleButtons that are created by scripts
2023-02-22 18:49:04 +01:00
Nathan Adams
aef466f8f3
avm2: Implemented BitmapData.drawWithQuality
2023-02-22 17:36:55 +01:00
Nathan Adams
6539262db7
render: Add Quality option to RenderBackend::render_offscreen
2023-02-22 17:36:55 +01:00
nosamu
70bf0a816a
core: Add options to set and force stage scale mode
2023-02-22 12:13:20 +02:00
nosamu
a505d7a6d3
core: Fix off-by-one bug with clipDepth
2023-02-21 16:39:42 +02:00
Adrian Wielgosik
f7a12698b9
core: Implement Color::to_premultiplied_alpha without floats
2023-02-19 22:25:34 +01:00
Adrian Wielgosik
92e52f2d0a
avm2: Add missing imports
2023-02-19 19:06:54 +01:00
Lord-McSweeney
89792865d0
avm2: Stub Loader.close
2023-02-18 18:35:20 +00:00
Aaron Hill
3327a9a3fd
core: Set clipDepth to 0 when swapDepths affects a clip
...
This makes "Garfield's Comic Creator" properly show
panels when you close the editor.
2023-02-17 23:11:57 -06:00
EmperorBale
158de01c92
avm2: `goto_frame` should use the movieclips scene by default
2023-02-17 18:46:43 -08:00
Aaron Hill
071306f107
avm2: Also register EventDispatcher methods in ns "flash.events:IEventDispatcher"
...
This is needed by "Steambirds: Survival"
2023-02-17 20:32:27 -06:00
EmperorBale
bc165a81ff
chore: Add comment explaining why we skip the first scope
2023-02-18 01:37:12 +01:00
EmperorBale
7ef56c1d16
avm2: Search global scope after everything else
2023-02-18 01:37:12 +01:00
CUB3D
f7b0c021a9
avm1: The this property should be mutable
2023-02-17 14:39:10 -06:00
Aaron Hill
4149913967
core: Introduce dedicated avm2 mouse picking logic ( #9565 )
...
The mouse picking behavior in AVM2 interacts in complicated
ways with `mouseEnabled` and `mouseChildren.` It's sufficiently
different from AVM1 that I decided to split the logic into separate
`mouse_pick_avm1` and `mouse_pick_avm2` methods.
The `mouseChildren` property is now fully implemented.
Additionally, the `click_block` tests now work correctly
under Ruffle.
Combined with the orphan-movie PR, this is enough to make
SteamBirds fully playable (though performance greatly degrades
over a course of a level).
2023-02-17 19:04:52 +00:00
Lord-McSweeney
559ec8356d
Port Video to Actionscript
2023-02-16 22:46:11 +02:00
relrelb
a7235febea
core: Use unnamed field in `Character::Bitmap`
...
Since `initial_data` was removed from `Character::Bitmap` in #9143 ,
it now holds a single field. Move back to an unnamed field, which
aligns with the other `Character` enum variants.
2023-02-16 19:02:57 +02:00
TÖRÖK Attila
77cfb5ab4c
core: Fix a clippy lint when building without the "mp3" feature.
2023-02-16 06:23:35 +01:00
EmperorBale
0ffdef48ab
avm2: Implement `finddef` opcode
2023-02-14 14:22:02 -08:00
Nathan Adams
eb35d6217b
avm2: DoAbc (72) seems to imply lazy loading
2023-02-14 08:51:45 +01:00
Nathan Adams
94fdc8bdb5
avm2: Support older DoAbc tag (72)
2023-02-14 08:51:45 +01:00
Nathan Adams
69f93f926e
swf: Rename DoAbc to DoAbc2
2023-02-14 08:51:45 +01:00
Adrian Wielgosik
5eb887c628
avm2: Stub describeType to have .@name work
2023-02-13 23:55:00 +01:00
Nathan Adams
a4fc39efcd
avm2: Copy Regexp methods to the Regexp prototype
2023-02-13 21:31:46 +01:00
Nathan Adams
899635f658
avm2: Copy Array methods to the Array prototype
2023-02-13 21:31:46 +01:00
Aaron Hill
a52a41de97
core: Fix stageX and stageY getters for MouseEvent
...
These getters were previously calling `local_to_global`
with the unused localX/localY coordinate set to 0. Howver,
`local_to_global` does a matrix multiplication, which in general
will depend on both the x and y values. This was causing the getters
to return incorrect results when any of the `transform.matrix` values
included a non-diagonal matrix.
We now call `local_to_transform` with the real `localX` and `localY`
values.
2023-02-13 21:19:20 +01:00
Nathan Adams
081387e047
avm2: Stub TouchEvent
2023-02-13 05:35:18 +01:00
renovate[bot]
a27bd66b58
fix(deps): update rust dependency patches
2023-02-13 04:59:31 +01:00
Aaron Hill
c597f9f996
core: Fix Clippy lints on nightly
2023-02-13 03:38:54 +01:00
renovate[bot]
fed24aa243
fix(deps): update rust dependencies - wasm-bindgen related
2023-02-13 02:57:52 +01:00
Lord-McSweeney
b848ab6860
Fix stub in DisplayObjectContainer
...
In mouse_children
2023-02-13 00:42:28 +01:00
Lord-McSweeney
eb7a96f55b
Fix stub types in security.rs
...
Change from avm2_stub_getter to avm2_stub_method
2023-02-13 00:42:28 +01:00
Adrian Wielgosik
561e118ffe
avm2: Export private traits normally, remove private_trait_scripts hack
2023-02-12 17:49:14 +01:00
Adrian Wielgosik
f717b99599
avm2: Compare private namespaces by pointer. Refactor rust-avm field sharing.
2023-02-12 17:49:14 +01:00
Adrian Wielgosik
e0e653e463
avm2: make Namespace a GC type
2023-02-12 17:49:14 +01:00
Aaron Hill
4e0dce2efa
core: Make SandboxType configurable, and set to 'remote' on web
...
The Newgrounds API checks `Security.sandboxType` to see if it should
run in debug mode or not (which determines whether or not medals
can actually be unlocked).
For now, desktop continues to use `localTrusted` as the default,
while web now uses `remote`. We might want to make this configurable
at some point, but this should be good enough for now (and better
match Flash's behavior).
2023-02-11 14:44:11 -06:00
Aaron Hill
9bce6b78d5
core: Queue up Sound and SoundChannel methods during loading
...
Flash supports calling `Sound.play`, `SoundChannel.stop`, and
`SoundChannel.soundTransform` while a sound load is in progress
(e.g. immediately after calling `Sound.load`).
To support this, we queue up information inside `SoundObject`
and `SoundChannelObject` when a load is in progress. When a load
completes, we trigger any queued `Sound.play` and `SoundChannel.stop`
calls, and apply the most recent `SoundChannel.soundTransform`
2023-02-11 11:53:56 -06:00
Aaron Hill
51fe1e9754
core: Handle `DirtyState::CpuModified` in `overwrite_cpu_pixels`
...
If we're going to overwrite the CPU pixels with the result of a
GPU operation, make sure the GPU texture is up to date with the
latest CPU pixels. I've also renamed the method to
`overwrite_cpu_pixels_from_gpu` to better reflect how it should
be used.
2023-02-11 11:37:00 -06:00
Bale
73e9fd55fb
avm2: Make sure scripts get initialized after all scripts have been loaded when lazy init is disabled ( #9478 )
...
* avm2: Initialize scripts **after** all scripts have been loaded
* tests: Add test for eager initialization
2023-02-11 00:38:38 +00:00
Aaron Hill
4b76d1b32a
core: Support using URLVariables as a POST request body ( #9489 )
...
This is needed by the Newgrounds API. We don't have the ability
to make fake requests to HTTP urls in our test frameworks,
so I haven't added any tests for this. However, I tested locally
that this allows the Newgrounds API to work (and got a medal
in Cloud Wars).
2023-02-11 00:18:10 +00:00
nosamu
c1fe3ded25
chore: remove unnecessary FromStr impl for LoadBehavior
2023-02-10 00:56:17 -08:00
nosamu
1a65a0942c
desktop: Add --letterbox option
2023-02-09 23:43:25 -08:00
EmperorBale
e7612f571d
avm2: Implement ScopeChain caching
2023-02-09 10:51:12 -08:00
golfinq
37ec94f95b
Avm2: Implement Stage.invalidate
2023-02-08 17:47:21 -07:00
Aaron Hill
a818dd0918
core: Use colorTransform in DisplayObject.setTransform
2023-02-08 20:56:46 +01:00
Adrian Wielgosik
61a5161a20
avm2: Convert most errors in get/set/initproperty to AVM errors
2023-02-07 18:50:15 -06:00
Adrian Wielgosik
c844d2ab6f
avm2: Only store actually-passed arguments to 'arguments'
2023-02-07 18:35:30 -06:00
Nathan Adams
ac9b6e3ecb
avm2: Mark Dictionary(true) and TimerEvent.updateAfterEvent() as stubs
2023-02-07 20:34:59 +01:00
Nathan Adams
e5f44b0f05
avm2: Replaced stubs in actionscript with new stub system
2023-02-07 20:34:59 +01:00
Nathan Adams
bdbf54ecd4
core: Added ability to mark stubs inside actionscript
2023-02-07 20:34:59 +01:00
Nathan Adams
dff558170e
avm2: Implement BitmapData.getPixels()
2023-02-07 19:10:25 +01:00
Nathan Adams
25cc6f3243
avm2: Change MovieClip::frame_scripts to Vec<Option<Avm2Object>>, where index is frame num
2023-02-07 18:26:27 +01:00
Nathan Adams
43d9c3deed
avm2: Make sure SoundChannel.soundTransform always returns a value
2023-02-07 18:26:27 +01:00
Nathan Adams
bc7773596b
avm2: addFrameScript allows null to unset the script, and only allows one script per frame
2023-02-07 18:26:27 +01:00
CUB3D
48f4df51a5
avm1: Correct depth calculation for AVM1 clips pending removal and add tests
2023-02-06 10:53:45 -07:00
CUB3D
2d11a250da
avm1: Retrieving the child of a container should prioritise lowest depth
2023-02-06 10:53:45 -07:00
CUB3D
a356be15fe
avm1: Only delay removals on AVM1, check for dynamic unload handlers
2023-02-06 10:53:45 -07:00
CUB3D
755425ebfa
avm1: Delay clip removals when a child has an unload listener
...
When removing a clip, first check if it has an unload event listener somewhere
it's hierarchy.
If it does, enqueue the removal to happen on the next frame, by moving it to a negative depth.
2023-02-06 10:53:45 -07:00
Nathan Adams
50fd7aeff5
core: Add quality options to the context menu
2023-02-06 16:08:04 +01:00
Nathan Adams
a220703618
core: Made PlayerBuilder take quality instead of setting it after the Player was made
2023-02-06 16:08:04 +01:00
Nathan Adams
d8e924affc
render: Add RenderBackend::set_quality method, and call it from core
2023-02-06 16:08:04 +01:00
Nathan Adams
12bd38b338
core: Changed Player::set_quality to take in a StageQuality directly
2023-02-06 16:08:04 +01:00
Nathan Adams
b270d1bbd7
render: Move StageQuality from core to render
2023-02-06 16:08:04 +01:00
Nathan Adams
00c7e8f634
avm2: Fixed bytearray compress/decompress methods setting position of resulting bytearray
2023-02-05 19:22:01 +01:00
Nathan Adams
e798d69299
avm2: Convert ByteArray EOF to avm error
2023-02-05 19:22:01 +01:00
Nathan Adams
c14f022837
core: Use overwrite_cpu_pixels in apply_filter
2023-02-05 18:41:43 +01:00
Nathan Adams
7476b3b0e0
avm2: Added a bunch of missing filter classes
2023-02-05 18:41:43 +01:00
Nathan Adams
42f3ee923f
avm2: Mark unsupported filters as stubs
2023-02-05 18:41:43 +01:00
Nathan Adams
3411a04cef
render: Made render specific Filter enum & structs, as swf ones don't map 1:1 to potential filters
2023-02-05 18:41:43 +01:00
Nathan Adams
b5a250e16f
render: Changed render_offscreen to return an Option instead of an Result
2023-02-05 18:41:43 +01:00
Nathan Adams
e73389aa71
wgpu: Implement blur filter
2023-02-05 18:41:43 +01:00
Nathan Adams
284a58c817
avm2: Implement BitmapData.apply_filter for ColorMatrixFilter
2023-02-05 18:41:43 +01:00
Lord-McSweeney
a369e71af6
Appease clippy again
2023-02-03 23:32:22 +01:00
Lord-McSweeney
83087f9f23
Change stubs to use new macro method
2023-02-03 23:32:22 +01:00
Lord-McSweeney
a6ea1ef4a7
Appease clippy
2023-02-03 23:32:22 +01:00
Lord-McSweeney
add115e97f
State "Stub" instead of "Implement"
...
...and fix a format issue.
2023-02-03 23:32:22 +01:00
Lord-McSweeney
963f3240f2
Stub DisplayObject.opaqueBackground
2023-02-03 23:32:22 +01:00
nosamu
12c67d5068
desktop: Improve --help messages
2023-02-03 21:17:56 +01:00
Nathan Adams
198e40fd2e
avm2: Changed return values of a bunch of stubs per PR feedbck
2023-02-01 21:45:12 +01:00
Nathan Adams
8e917c473e
avm2: Replaced stubs in Proxy with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
b28e921fb9
avm2: Replaced stubs in Keyboard with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
99e723a1cb
avm2: Replaced stubs in TextField with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
2a36f9b871
avm2: Replaced stubs in StaticText with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
ff768a1e73
avm2: Replaced stubs in Font with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
af73a1a292
avm2: Replaced stubs in Security with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
e48926799c
avm2: Replaced stubs in SharedObject with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
408482cd21
avm2: Replaced stubs in ObjectEncoding with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
69101af66b
avm2: Replaced stubs in SoundMixer with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
834ac93350
avm2: Replaced stubs in Sound with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
cb1fa72d6f
avm2: Replaced stubs in Transform with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
a576903f0c
avm2: Replaced stubs in IndexBuffer3D with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
24169a3577
avm2: Replaced stubs in Stage with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
6a6e81ad6a
avm2: Replaced stubs in LoaderInfo with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
33dbe82b4f
avm2: Replaced stubs in InteractiveObject with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
46ed595186
avm2: Replaced stubs in Graphics with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
0abfb79c62
avm2: Replaced stubs in DisplayObjectContainer with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
0e522fd58b
avm2: Replaced stubs in displayobject with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
fb0578ee26
avm2: Replaced stubs in bitmapdata with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
10ec9a1a74
avm2: Replaced stubs in namespace with new format (but still err as I don't know what to return otherwise)
2023-02-01 21:45:12 +01:00
Nathan Adams
8f53f5414c
avm2: Replaced stubs in bitmap with new format
2023-02-01 21:45:12 +01:00
Nathan Adams
44981af409
avm1: Replaced all existing stub warnings with new stub system
2023-02-01 21:45:12 +01:00
Nathan Adams
366f8bef43
core: Add feature known_stubs to retrieve all known stubs
2023-02-01 21:45:12 +01:00
Nathan Adams
4a0529dedc
core: Add Stub and StubCollection for tracking stubs used during a movie
2023-02-01 21:45:12 +01:00
renovate[bot]
caaf6d5c87
fix(deps): update rust dependencies
2023-01-31 09:39:42 -06:00
nosamu
5ee3b821dd
core: Fix DO render tree display
2023-01-29 11:58:59 -06:00
Moulins
e36b03bce9
core::html: correctly encode text in FormatSpans::to_html
...
Fixes issue #9327
2023-01-29 11:19:16 -06:00
CUB3D
f829157deb
avm1: Defining a local that already exists on the target of a with scope, defines it on the target not the parent
2023-01-29 18:05:25 +01:00
Aaron Hill
c6eb25194e
core: Bump flash-lso to latest commit
...
This deduplicates some dependencies, and removes
a future-incompat warning from `nom`.
2023-01-29 17:31:10 +01:00
Nathan Adams
85dc100ee9
avm2: Implement Sprite.dropTarget - though it's wrong right now
2023-01-29 00:52:52 +01:00
Daniel Jacobs
6697848b92
avm1: Don't ignore mouse_pick on static text ( fix #9274 )
2023-01-29 00:39:06 +01:00
Daniel Jacobs
b00628f45d
avm2: Add warning to MouseEvent.updateAfterEvent
2023-01-28 14:31:52 -06:00
Daniel Jacobs
65a0aaeb7b
avm2: Stub MouseEvent.updateAfterEvent
...
Basically a direct copy of https://github.com/ruffle-rs/ruffle/pull/7653
2023-01-28 14:31:52 -06:00
Aaron Hill
7ba960987c
core: Display class name in ErrorObject debug impl
...
This lets us know something about the type of error
that was thrown, and doesn't require an Activation/UpdateContext.
2023-01-24 20:38:45 -06:00
TÖRÖK Attila
e77b1e379c
core/audio: mp3: Use MpaReader instead of the deprecated Mp3Reader from Symphonia
2023-01-24 20:10:40 -06:00
renovate[bot]
8b6eef1715
fix(deps): update rust dependencies
2023-01-24 20:10:40 -06:00
Daniel Jacobs
0a04b22a79
avm2: Stub simple flash.text.engine enums
2023-01-23 13:51:26 -06:00
MartySVK
ad688b45da
avm2: added Stage.fullScreenSourceRect stub ( #9265 )
...
* avm2: added Stage.fullScreenSourceRect
* fixing checks I hope
2023-01-22 16:29:12 -05:00
Aaron Hill
e2954821ea
core: Take two - delay reading image back from render backend using `SyncHandle` ( #9184 )
...
* Take two: Delay reading image back from render backend using `SyncHandle`
This allows us to avoid blocking immediately after a `BitmapData.draw` call.
Instead, we only attempt to use the `SyncHandle` when performing an operation
that requires the CPU-side pixels (e.g. BitmapData.getPixel or BitmapData.setPixel).
In the best case, the SWF will never explicitly access the pixels of
the target BitmapData, removing the need to ever copy back the render backend
image to our BitmapData. If the SWF doesn't require access to the pixels immediately,
we can delay copying the pixels until they're actually needed, hopefully allowing
the render backend to finish processing the BitmapData.draw operation in
the backenground before we need the result.
Now that the CPU and GPU pixels can be intentionally out of sync with
each other, we need to ensure that we don't accidentally expose 'stale'
CPU-side pixels to ActionScript (which needs to remain unaware of
our internal laziness). We now use a wrapper type `BitmapDataWrapper`
to enforce that the `SyncHandle` is consumed before accessing the
underlying `BitmapData.
* core: Skip GPU->CPU sync for source and target BitmapData during draw
* Introduce DirtyState enum
2023-01-21 21:08:04 +00:00
MartySVK
6d5f6385a5
avm2: added TextField.restrict stub ( #9218 )
...
* added TextField.restrict stub
Co-authored-by: Martin Mravec <marty.devil@gmail.com>
2023-01-19 22:23:33 -05:00
Adrian Wielgosik
fb4d2d3f04
avm2: Implement TextField.maxChars
2023-01-19 01:24:47 +01:00
Nathan Adams
5f72ebaef9
core: Don't call avm2 callstack method if there's no callstack
2023-01-19 00:50:56 +01:00
Nathan Adams
f5d69f5ad8
avm2: Corrected panic messages in date code
2023-01-16 21:48:00 +01:00
EmperorBale
3287173da3
avm2: Fix edge case when setting fullYear of date
2023-01-16 21:48:00 +01:00
EmperorBale
6bb079cc60
avm2: Remove some useless else statements in date
2023-01-16 21:48:00 +01:00
MrCheeze
ebe5eed143
avm2: Fix corner case when goto same frame multiple times ( close #9018 )
...
This change makes it so that if there is a goto to a specific frame,
then a frame script is registered for that frame, and then a goto to the
same frame again, the frame script will not be skipped. At least one movie
appears to depend on this behaviour.
2023-01-16 18:37:19 +01:00
nosamu
952aa2d5f9
avm2: Correct name of rollover event
2023-01-14 20:04:33 +01:00
Aaron Hill
3a6c8d9796
core: Use BitmapData instead of separate `initial_data` field
...
Now that a `Bitmap` always stores a `BitmapData`, we can read the pixels
directly from the `BitmapData`, instead of duplicating them in an
`initial_data` field
2023-01-14 01:28:22 -05:00
Aaron Hill
b5796f9016
core: Derive Default for FramePhase
2023-01-13 20:37:52 +01:00
Calvin304
6c71f5b2a6
avm2: Naive DefineButtonSound impl for Avm2Button
2023-01-11 17:45:39 -05:00
Nathan Adams
9cd850d30e
render: Make render_offscreen return a sync handle which can be used to get the texture at a later time
2023-01-11 16:53:33 -05:00
Nathan Adams
133044b06b
avm2: Fix start_drag with negative width or height
2023-01-11 00:09:01 +01:00
MrCheeze
0597ae56e6
core: Make AVM2 frame labels case sensitive
2023-01-10 11:28:56 -05:00
renovate[bot]
630558a936
fix(deps): update rust dependencies
2023-01-10 16:37:40 +01:00
Moulins
3b1c981d25
Clears the AVM1 stack after executing bytecode
...
AVM1 bytecode may leave the operand stack unbalanced, and this will
cause a slow memory leak if the stack is never cleared.
2023-01-10 14:14:17 +01:00
CUB3D
c6bd431864
avm1: Deduplicate threshold operations
2023-01-10 13:59:06 +01:00
CUB3D
ea6ea8074a
tests: Add tests for BitmapData.threshold, fix issues found as a result
2023-01-10 13:59:06 +01:00
CUB3D
70f071b347
avm1: Implement Bitmapdata.threshold
2023-01-10 13:59:06 +01:00
CUB3D
8db909a7d4
desktop: Allow specifying player version
2023-01-10 13:13:30 +01:00
MrCheeze
bf6342bd4b
avm2: Fix hitTestPoint not transforming coordinates to world space
...
This behaviour is essentially copied from avm1 movie_clip.rs's hit_test.
Seems to fix several flashes that had broken collision until now.
2023-01-10 12:53:20 +01:00
Nathan Adams
724609e323
audio: Don't panic when reading an invalid mp3, bubble the error up
2023-01-10 11:10:46 +01:00
Nathan Adams
3b24d849e7
audio: Removed unwraps in mixer.rs and replaced with reasoned expects
2023-01-10 11:10:46 +01:00
Nathan Adams
7a9e8b4771
core: Made NullNavigatorBackend no longer use unwraps
2023-01-10 11:10:46 +01:00
CUB3D
84d0111a14
avm1: Add test for with scope nesting
2023-01-10 10:34:10 +01:00
CUB3D
ca82ff65de
avm1: Defining a local in a with scope should actually define it on the parent scope
2023-01-10 10:34:10 +01:00
Nathan Adams
a37e070724
core: Use Color::WHITE for draw_rect when we don't care, as it's just identity color transform and thus cheaper
2023-01-10 09:39:28 +01:00
Nathan Adams
53d6fa4d8b
render: Make render commands take in an actual value, not ref for immediate cloning
2023-01-10 09:39:28 +01:00
Adrian Wielgosik
14ee9b43fb
avm2: Replace ok_or by ok_or_else
2023-01-09 21:01:39 +01:00
Aaron Hill
40d8751d67
avm2: Implement clipRect parameter for BitmapData.draw
2023-01-08 16:11:55 -05:00
Aaron Hill
1b71e288fd
Remove 'gc_context lifetime
...
The latest `gc-arena` makes this unnecessary - we can just
use our `'a` lifetime for `MutationContext`
2023-01-06 19:20:39 -05:00
Moulins
d332a174c3
Bump `gc-arena` to current master revision
...
This required small changes to some Debug impls that were missed in #8964
2023-01-06 18:22:43 -05:00
Nathan Adams
a7738bec69
core: Added a few simple tracing::instruments
2023-01-06 04:25:22 +01:00
Nathan Adams
13fd830e7c
core: Switch from log to tracing
2023-01-06 04:25:22 +01:00
MrCheeze
71fcd383a3
avm2: Add ctrlKey, altKey, shiftKey, controlKey properties to KeyboardEvent
2023-01-04 16:27:09 -05:00
Nathan Adams
4d948616db
avm1: Implement BitmapData.draw with blend mode, fixes #8920
2023-01-04 12:09:08 -05:00
Nathan Adams
cd550457e1
core: Made TDisplayObject::movie() no longer an Option<>
2023-01-04 08:20:08 +01:00
Nathan Adams
40a7bb04d6
core: Removed default impl of TDisplayObject::movie(), implement it everywhere
2023-01-04 08:20:08 +01:00
Aaron Hill
10491a1be9
core: Store data in `BitmapData` instead of `Bitmap`
...
This makes `Bitmap` delegate to `BitmapData` for
all of the bitmap-related information (handle, width, and height).
As a result, we now unconditionally store a `BitmapData` in `Bitmap`.
As a result, swapping the underling `BitmapData` instance will
automatically change the properties (and rendered image) of a `Bitmap`.
This required some refactoring in the render backends in order to
get access to a `BitmapHandle` through `BitmapData`.
2023-01-03 18:01:41 -07:00
MrCheeze
41df7fdc59
avm2: For old swf versions, invalid goto labels jump to frame 1 ( fix #8954 )
...
The regression test for this was edited directly in JPEXS, so there is
no corresponding fla to compile into the swf.
2023-01-03 17:10:06 -07:00
MrCheeze
77104ca473
avm2: Improve accuracy of gotoAndPlay / gotoAndStop (partially fix #8954 )
...
Partially based on AVM1 implementation, partially based on the new
regression tests added in this commit.
2023-01-03 17:10:06 -07:00
nosamu
664a86161a
avm2: Fix `for each..in` loops over Dictionary values
2023-01-03 16:52:15 -07:00
Moulins
27307d847a
core: Replace some derived Debug impls with manual ones
...
In future versions of `gc-arena`, the `Debug` impl. of `Gc`
and `GcCell` will print the pointed-to value, which will cause
derived `Debug` impls. to enter an infinite recursion.
As such, this manually implements `Debug` on types wrapping a
`Gc/GcCell` to maintain the current behavior.
2023-01-03 18:03:23 -05:00
Nathan Adams
5a7ec70254
core: Remove blend mode unsupported message
2023-01-03 03:39:13 +01:00
Nathan Adams
ded46e20e7
render: Replace PushBlendMode/PopBlendMode with Blend
2023-01-03 03:39:13 +01:00
EmperorBale
a51ffd0e9f
avm2: Strings passed to date constructor should be parsed
2023-01-02 11:43:03 -08:00
EmperorBale
ab3a1e6148
avm2: Move date parsing into a separate function
2023-01-02 11:43:03 -08:00
MrCheeze
bf18334294
avm2: Fix calling setTextFormat without providing a beginIndex and EndIndex
...
Previous behaviour defaulted to undefined and applied the format to the
range [0,0) instead of defaulting to -1 and applying the format to the
full length of the TextField.
2023-01-01 21:03:12 -08:00
Aaron Hill
9d6763510b
core: Remove redundant 'clone' calls
2022-12-31 17:13:55 -05:00
nosamu
89e01b5598
avm2: Throw error in Loader.unload stub
2022-12-29 10:50:35 +01:00
EmperorBale
ac4d74b9ed
core: Use applicationDomain specified in context if available
2022-12-28 17:25:11 -05:00
EmperorBale
7e5018331d
core: Add new `context` parameter to loader
2022-12-28 17:25:11 -05:00
dependabot[bot]
6f430bb40d
build(deps): bump serde from 1.0.151 to 1.0.152
...
Bumps [serde](https://github.com/serde-rs/serde ) from 1.0.151 to 1.0.152.
- [Release notes](https://github.com/serde-rs/serde/releases )
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.151...v1.0.152 )
---
updated-dependencies:
- dependency-name: serde
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
2022-12-28 10:55:35 +02:00
David Wendt
08fed6aeaa
core: Don't attempt to set properties on parents after construction unless the child has an explicit name.
...
This already was implemented, but the prior commits broke it.
2022-12-27 20:15:49 -07:00
David Wendt
7eb0ca8ecc
core: Unconstructed display objects should be `null`, not `undefined`.
2022-12-27 20:15:49 -07:00
David Wendt
cbf2e94aba
core: Fix AVM2 buttons getting constructed with the wrong initial state.
...
This code was always wrong; and only saved from breaking by other wrong code elsewhere. Specifically:
* `SimpleButton.construct_frame` sets the wrong initial state
* but `MovieClip.instantiate_child` fires frame events before `post_instantiation`
* and `SimpleButton.post_instantiation` sets the correct state
2022-12-27 20:15:49 -07:00
David Wendt
eb0eede07d
chore: Remove unused/superceded event issue code
2022-12-27 20:15:49 -07:00
David Wendt
b6aa035663
core: Instantiating display objects on the timeline should no longer construct them.
...
This works now because all object placement and removal happens in `enter_frame`. Constructing those objects right away causes them to drop added events.
We cannot remove other instances of `construct_frame`, however - those are in places where we actually do expect constructors to run, not just see things get placed.
2022-12-27 20:15:49 -07:00
David Wendt
4b71fff745
core: Children added to AVM2 buttons should not emit added events
2022-12-27 20:15:49 -07:00