Commit Graph

5852 Commits

Author SHA1 Message Date
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
Nathan Adams 1fd8ca7bad core: Reduce the amount of false-invalidations 2023-07-20 23:19:20 +02:00
Nathan Adams 400ff32723 wgpu: Implement a naive DisplacementMap filter 2023-07-20 12:41:30 +02:00
Lord-McSweeney 7c33932f53 core: Allow NetStream script data to call any functions 2023-07-19 17:26:24 -06:00
Lord-McSweeney 42c1facf55 avm1+tests: Implement onMetaData event for AVM1, fix netStatus test for AVM2 2023-07-19 17:26:24 -06:00
Lord-McSweeney 14b78aafcc avm2: Support onCuePoint and onMetadata NetStream.client function handlers 2023-07-19 17:26:24 -06:00
Aaron Hill 715abd8985 avm2: Use invisible mask descendants for mouse picking and rendering
The 'DisplayObject.visible' flag seems to be ignored for mask objects
(and their descendants) - mouse picking still takes them into account,
and they get rendered as part of the mask.

This commit changes display object rendering and AVM2 mouse picking
to ignore DisplayObject.visibility when dealing with mask objects/
descendants.
2023-07-19 23:18:28 +02:00
CUB3D 771f568509 core: Trying to access a named shape should resolve to the parent as they have no object representation 2023-07-19 22:32:42 +02:00
sleepycatcoding 4c1c3cc105 avm2+tests: Allow concating XMLLists; add test 2023-07-19 16:03:10 -04:00
Lord-McSweeney 5975714f75 avm2+swf+tests: Store metadata on Traits and VTable, report metadata in describeType; parse ABC metadata key-value pairs correctly; add test 2023-07-19 16:24:23 +02:00
Nathan Adams b8081ac609 core: Use actual bounding box of curves instead of an approximation 2023-07-19 02:09:12 +02:00
Nathan Adams 00ea6180dc avm2: Default line caps should be Round, not None 2023-07-19 02:09:12 +02:00
Aaron Hill 0fa16dfe69 avm2: Remove redundant 'depth' variable in XML parsing 2023-07-19 00:20:14 +02:00
MartySVK 6667ea1d94
avm2: Stub flash.globalization.CurrencyFormatter.format (#12108)
* fixes Rogue Soul 2

* return after stub_method
2023-07-17 21:00:43 +00:00
relrelb 151ad97686 avm1: Migrate `SharedObject` to `NativeObject` 2023-07-17 11:34:06 +03:00
renovate[bot] 268403faad chore(deps): lock file maintenance rust dependencies 2023-07-17 09:55:56 +03:00
nosamu de9ea9571b avm2: Implement SharedObject.size 2023-07-17 00:53:52 +02:00
nosamu fea0df192f avm1: Implement SharedObject.getSize() 2023-07-17 00:53:52 +02:00
MrCheeze 08e13b5056 core: Make underlines the same color as their text 2023-07-17 00:32:46 +02:00
Kornelius Rohrschneider ac5b3d9b2f core: Move use_new_invalid_bounds to Avm1 & Add documentation
The variable use_new_invalid_bounds has been moved from the
UpdateContext and the Player to the Avm1 struct because it is only used
for AVM1 code. A getter method and an activator method setting it to
true have been added as well.
The get_bounds function, which uses the variable, has been adapted to
use the getter and the activator.

Additionally, documentation has been added and improved.
The MovieClip now contains documentation about all MovieClip states and
the use_new_invalid_bounds documentation has been extended to explain
the logic of how the variable is set and used.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 48192efe8a core: Remove MovieClip::oldest_parent_swf_version
The MovieClip variable oldest_parent_swf_version and its getter method
have been removed because they were unnecessary, as the UpdateContext
already provides the root movie.
The call of the getter method has been replaced by
activation.context.swf.version().
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider a0493c770e core: Implement suggested changes to PR
The suggested changes in the feedback to the pull request have been
implemented.
Therefore, this commit consists of multiple smaller changes:

- The unload_movie method has been renamed to avm1_unload_movie.
- The movieclip_default_state test now doesn't test
  getTextSnapshot().getCount() because the underlying methods haven't
  been implemented in AVM1 yet.
  This should be reverted when they have been implemented or stubbed in
  AVM1.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider c74a43e643 core: Add MovieClip unloaded state
An unload_movie method has been added to the MovieClip. It unloads the
MovieClip, which means that one frame after it has been called,
avm1_unload and the new transform_to_unloaded_state method get called
and the MovieClip enters the unloaded state in which some attributes
have certain values.
To do this, it creates and spawns a future which calls avm1_unload and
transform_to_unloaded_state (which actually makes the MovieClip enter
the unloaded state).
It uses the new MovieUnloader (which has been added to the Loader enum)
to pass the MovieClip to the asynchronous code. The MovieUnloader saves
a handle and the target clip, and the asynchronous code retrieves it
from the LoadManager.

unload_movie is now called when a MovieClip should be unloaded.
TODOs have been added, describing to check whether other avm1_unload
calls also need to be delayed by one frame and whether unload_movie also
needs to be called in other places.

Additionally, a spelling mistake has been corrected.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider d2ac9d32b4 core: Correct MovieClip default state
Previously, the MovieClip default state contained wrong values for
opaqueBackground, transform.pixelBounds and getRect & getBounds with
another default MovieClip as the parameter.
This has been corrected; the calculation of these values has been fixed.

To do that, a use_new_invalid_bounds_value variable has been added to
the UpdateContext and the Player (from which the UpdateContext is
created).
Additionally, an oldest_parent_swf_version variable has been added to
the MovieClip with a getter method for it. It is calculated and saved on
demand in the getter.
These variables are retrieved in the get_bounds function and used to set
use_new_invalid_bounds_value and to calculate the correct bounds.

Ruffle now uses the correct MovieClip default state.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 96e0f445bb core: Correct MovieClip image state
The set_cur_preload_frame and set_current_frame methods have been added
to the MovieClip.
If the Loader now loads an image, these methods are called to set the
MovieClip image state correctly.

Additionally, load_error_swf now uses set_cur_preload_frame instead of
the removed movie_not_available method.
2023-07-17 00:08:02 +02:00