Commit Graph

8864 Commits

Author SHA1 Message Date
Nathan Adams 1004f3fee9 tests: Add a test for a shape with HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Nathan Adams dc17f7dc30 tests: Add a test for rendering a self-intersecting glyph 2023-03-18 19:14:08 -07:00
Nathan Adams 6987c81623 render: Respect HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Nathan Adams e7b812c2cd render: Glyphs are assumed to have HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Tom Schuster e9e342fe23 avm2: Implement String call handler 2023-03-18 17:51:22 -07:00
Tom Schuster 5aac938e86 avm2: Implement XMLList.text() 2023-03-18 12:18:24 -07:00
Tom Schuster c285c1eb75 avm2: Implement XML.text 2023-03-18 11:12:15 -05:00
relrelb 156c76cb94 web: Simplify custom context menu separators logic
Instead deduplicating separators in `RufflePlayer.showContextMenu()`
using DOM attributes, do it right in `RufflePlayer.contextMenuItems()`,
using a simpler approach.
2023-03-18 02:10:08 -07:00
Nathan Adams b46f511326 avm2: Implement GraphicsTrianglePath 2023-03-18 06:27:49 +01:00
Nathan Adams 96bb0b8e2e avm2: Lazily create commands and data in GraphicsPath 2023-03-18 06:27:49 +01:00
Nathan Adams de8958c40b avm2: Implement GraphicsStroke 2023-03-18 06:27:49 +01:00
Nathan Adams 2eaaa9b573 avm2: Implement GraphicsSolidFill 2023-03-18 06:27:49 +01:00
Nathan Adams fe327dc3de avm2: Implement GraphicsPath 2023-03-18 06:27:49 +01:00
Nathan Adams 2567bd2f42 avm2: Implement GraphicsGradientFill 2023-03-18 06:27:49 +01:00
Nathan Adams 7f7fbc2091 avm2: Implement GraphicsEndFill 2023-03-18 06:27:49 +01:00
Nathan Adams 3e84da036f avm2: Implement GraphicsBitmapFill 2023-03-18 06:27:49 +01:00
David Wendt 47f594d108 avm2: Stub `flash.media.Microphone` and depended classes 2023-03-17 20:39:45 -06:00
Aaron Hill 580c18844e naga-agal: Remove 'do_extend'
This was a leftover from before we started usiung vec4 everywhere
for compatibility with AGAL. There are a few specific opcodes that
don't need extension, but it doesn't depend on the destination
register.
2023-03-17 20:11:59 -05:00
Aaron Hill 1e973af747 avm2: Implement Context3D.setRenderToTexture/setRenderToBackBuffer
In the process, I fixed a bug where we were clearing the depth
and stencil buffers with the incorrect value.

This makes Fancy Pants World 4 Part 1 playable to completion
(though there are still some rendering issues that need
to be fixed).
2023-03-17 20:11:59 -05:00
Aaron Hill d8a6195d67 tests: Use 'warn' log level for wpgu crates in regression tests
This makes the test output much less verbose.
2023-03-17 19:42:48 -05:00
David Wendt fe0cbc4cb8 avm2: Stub `flash.media.Camera` 2023-03-17 18:27:45 -06:00
Nathan Adams 3a353e15d1 avm2: Convert transform to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 218b621ae3 avm2: Convert external_interface to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 2513292566 avm2: Convert event_dispatcher to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams fda3390aa1 avm2: Convert event to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 8db6375c4c avm2: Convert display_object_container to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 37f3ea7077 avm2: Convert interactive_object to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 82fc05667c avm2: Convert loader to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams ed9257ee39 avm2: Convert (some of) movie_clip to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams bc118109e4 avm2: Convert simple_button to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams 652a8f86d6 avm2: Convert sprite to use ParametersExt 2023-03-17 20:40:33 +01:00
Nathan Adams b19ddbe0fc avm2: Convert stage to use ParametersExt 2023-03-17 20:40:33 +01:00
Tom Schuster 750291c993 avm2: Stub XML settings 2023-03-17 14:25:19 -05:00
Aaron Hill 9ff6ee21df avm2: Handle early class lookup during parameter resolution
This factors out the early-resolution logic I added in `op_coerce`,
making it useable during paramter resolution as well. This lets
a static initializer reference the containing class in parameter
types, even though the ClassObject hasn't yet been initialized.
2023-03-17 13:23:14 -05:00
Aaron Hill ba88b52167 avm2: Correctly apply 'skip_next_enter_frame' to Loader
We were missing the initial 'set_skip_next_enter_frame(true)'
call, and we weren't properly clearing it in `enter_frame`.
Loaders appear to have the same behavior as MovieClips.

This makes us correctly run the first framescript for the loaded
SWF.
2023-03-17 12:44:56 -05:00
nosamu 33f585fa6c avm2: Stub TextField.mouseWheelEnabled 2023-03-17 18:05:14 +01:00
Tom Schuster b791c402d2 avm2: Stub flash.net.sendToURL 2023-03-17 17:49:53 +01:00
Aaron Hill 605b5fe09a avm2: Correctly declare Array.removeAt as an AS3/prototype method
It was incorrectly declared as public method, which lead to
spurious 'missing override' errors in classes extending Array
that define a 'removeAt' method.
2023-03-17 17:00:47 +01:00
MrCheeze 8c180f97b6 core: Allow duplicate frame and scene labels (close #9943) 2023-03-17 12:54:16 +01:00
Aaron Hill 1edcbe438d core: Avoid several BitmapData GPU -> CPU sync
We don't need to perform a sync when getting the width/height,
getting or setting the 'disposed' status, or uploading to
a Context3D texture.

The Context3D change (using `copy_texture_to_texture` instead
of relying on the CPU pixels) has the added advantage of avoiding
a validation error when our source image row length isn't aligned
to `COPY_BYTES_PER_ROW_ALIGNMENT`

This dramatically speeds up the Fancy Pants World 4 loading time
(on a branch with my XML prs merged). Without this change, my
machine spends around 10 seconds on a blank white screen after
clicking 'Play'. With this change, the time spent on that screen
is reduced to around 1-2 seconds.
2023-03-17 04:56:03 -05:00
EmperorBale dd33a8a698 avm2: Make `get_lex` & `find_prop_strict` throw AVM Errors 2023-03-16 22:33:23 -07:00
Mike Welsh 4c672bbfb8 tests: Update `SoundChannel.position` test
Currently ignored, but add a test case for the cached position
behavior (#9952).
2023-03-16 21:25:41 -07:00
Mike Welsh 0c38f9a2e1 avm2: Update `SoundChannelObject::position` on read (fix #9952)
`SoundChannel.position` was being updated by the audio manager each
tick, but the Flash Player only updates and caches the position
when `SoundChannel.position` is accessed. In contrast, an AVM1
`Sound` will constantly update its position.

This means accessing `position` only once after a sound has
finished playing will return 0.

Fixes #9952.
2023-03-16 21:25:41 -07:00
Aaron Hill c73f68207b avm2: Add support for orphan Loader instances
Despite not being MovieClips, Loader instances appear to get
the same kind of orphan handling - you can instantiate a
Loader and call 'Loader.load' without ever adding it
to a parent, and the loader will still run.

I've changed the movie code to work with a new `DisplayObjectWeak`
enum. Currently, this just supports `MovieClip` and `Loader`,
but it can easily be extended if we ever need other weak display
objects.

This also fixes a bug where we were adding the loaded MovieClip
as a child of the Loader slightly too early.
2023-03-16 20:55:06 -05:00
Aaron Hill 32f8330199 avm2: Implement xml descendants operator, and XMLList.toXMLString
This includes the 'GetDescendants' opcode, which is used by the
the 'xml..elementName' syntax. The 'XMLList.toXMLString()
impl makes it much easier to write tests for this.
2023-03-16 18:00:20 -05:00
Aaron Hill 53c6011ade render: Support more Context3D texture formats
None of these formats can currently be implemented
correctly with wgpu, so we just use Rgba8Unorm instead.

The handling of opaque compressed textures is a little
sketchy - it should work for 'normal' SWFs that upload
an opaque BitmapData, but we might need to manually
adjust the alpha values if
2023-03-16 17:40:41 -05:00
Aaron Hill 8d40734482 avm2: Convert Sound and SoundChannel to ActionScript classes 2023-03-16 23:20:59 +01:00
Nathan Adams 74c28723e5 avm2: Use object_to_matrix in new Graphics methods 2023-03-16 23:06:22 +01:00
Nathan Adams 7069cf6219 chore: Appease the as style checker 2023-03-16 23:06:22 +01:00
Nathan Adams 933dadea24 avm2: Implement Graphics.lineGradientStyle and Graphics.beginGradientFill 2023-03-16 23:06:22 +01:00