Commit Graph

5905 Commits

Author SHA1 Message Date
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
Kornelius Rohrschneider 400edf5368 core: Add MovieClip initial loading state
A load_initial_loading_swf function has been added to the Loader. It
makes the MovieClip enter the initial loading state in which some
attributes have certain initial loading values to signal that the file
is currently being loaded and neither an error has occurred nor the
first frame has been successfully loaded yet.
The Loader calls the function when initialising the loading before it
gets an error or success.

Additionally, load_error_swf has been improved: If a local URL is
fetched on a WASM target, the _url property will now be correctly set as
in the flash player.

The documentation has been improved.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider a0d0b8e638 core: Refactor & improve NavigatorBackend implementations
All NavigatorBackend implementations have been refactored, resulting in
improved code quality, less duplicated code, more consistent and easier
to understand procedures, additional error handling and better error
messages.

A resolve_url method has been added to the NavigatorBackend trait. It
takes a URL and and resolves it to the actual URL from which a file can
be fetched (including handling of relative links and pre-processing). It
has been implemented in each NavigatorBackend implementation.

Duplicated code has been put into new public functions in
core/src/backend/navigator.rs which are called by all NavigatorBackend
implementations.

ExternalNavigatorBackend:
- The navigate_to_url and fetch methods have been adapted to use
  resolve_url, removing redundant code.
- Error handling has been added in case that the URL can't be converted
  to a PathBuf.
- A TODO about differences between the flash player fetch and the
  Ruffle fetch implementation has been added.

WebNavigatorBackend:
- The previous resolve_url method exclusively to the WebNavigatorBackend
  has been replaced by the new resolve_url method. It is used by
  navigate_to_url and fetch.
- resolve_url now always pre-processes the URL if it's valid (even if no
  base_url exists) and explicitly returns whether the URL can be parsed.
- navigate_to_url now traces an explanatory error each if the URL can't
  be parsed or is local.
- fetch now returns an explanatory error each if the URL can't be parsed
  or is local (previously, a vague "Got JS error" has been returned).

TestNavigatorBackend & NullNavigatorBackend:
- fetch pre-processes the URL now (using the resolve_url implementation).
- If the URL isn't local, an explanatory error is returned (previously,
  it was just an "Invalid URL" error).
- If the URL can't be parsed, an explanatory error with the reason is
  returned (previously, it was just an "Invalid URL" error).

Additionally, error messages in all NavigatorBackend implementations
have been improved and made more consistent, e.g. if a local file can't
be read.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 687c0e7516 core: Complete MovieClip error state & Change uncompressed_len to i32
Previously, the MovieClip error state contained one TODO in order to be
completely implemented: The HeaderExt variable uncompressed_len needs to
be -1 in the error state, but its type has been u32.
The type has now been changed to i32, and the variable is set to -1 in
the default_error_header function. Therefore, the MovieClip error state
is now fully implemented.

Other connected functions and variables like SwfMovie::uncompressed_len
or MovieClip::total_bytes have been adjusted to this type change. Code
has been adjusted if needed where this value is used.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 893052c2a6 core: Add MovieClip error state
A load_error_swf function has been added to the Loader. It makes the
MovieClip enter the error state in which some attributes have certain
error values to signal that no valid file could be loaded. This happens
if no file could be loaded or if the loaded content is no valid
supported content.
The function creates an error state movie stub using the new
SwfMovie::error_movie function (which uses a new default_error_header
function) and configures remaining variables with the
movie_not_available method.
One TODO in order for the error state to be completely implemented has
been added.

Since the error state of the MovieClip includes the final URL of the SWF
file obtained after any redirects, the load_error_swf and
movie_loader_error functions (now) take an swf_url attribute.
To get this URL in case no file could be loaded, the
NavigatorBackend::fetch method has been changed to return an
ErrorResponse struct (including the url and the actual error) in the
error case. The Response struct returned in the success case has been
renamed to SuccessResponse.
All fetch implementations have been adapted accordingly. Code has been
adjusted to return the actual error where that's needed.

Documentation has been added and improved.
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 5352c86202 core: Remove duplicated functions
Duplicated functions have been removed (and replaced by corresponding
calls to the other functions).
2023-07-17 00:08:02 +02:00
Kornelius Rohrschneider 2d629dbf72 core: Correct _framesloaded value if movie couldn't be loaded
If an SWF tries to load a movie that can't be loaded, the Flash Player
sets _framesloaded of the MovieClip to -1. This has previously not been
implemented in Ruffle.

A new movie_not_available function has been added to the MovieClip
class. It sets the cur_preload_frame variable to 0.
This function is now called in the movie_loader_error function of the
Loader class (if a movie can't be loaded).

The frames_loaded function (which returns _framesloaded of the
MovieClip, which is given to the SWF) now returns an i32 and not an u16
value. This allows it to return a negative value. Code has been adjusted
where an u16 value is expected (clamping negative values to 0).
frames_loaded now returns cur_preload_frame - 1. Previously, it has
returned cur_preload_frame - 1 and clamped it to zero, but since the -1,
in case cur_preload_frame is zero, is explicitly wanted, this has been
corrected.
2023-07-17 00:08:02 +02:00
MrCheeze 901594b99f
avm2: Do not remove an EditText's selection on unfocus (fix #9006) + implement selectionBegin/selectionEnd/caretIndex (#9067)
* avm2: Do not remove an EditText's selection on unfocus (fix #9006)

There are significant differences between how selection and caret info
work between AVM1 and AVM2.

In AVM1, there is only a single, global selection, which applies to
whichever element is currently focused. Therefore changing the focus
necessarily erases any information of what was selected before. There
can also be no active selection at all.

In AVM2, every text field has its own independent selection info. It is
NOT optional, the default selection is just a caret at position 0. If a
field loses focus, the selection is not rendered, but it is still
present. Movies such as #9006 rely on the same selection still being
there once you give back focus to the field.

Ruffle's model of selections (an Option per text field) is different
from both the AVM1 model (an optional singleton) and the AVM2 model
(mandatory per text field). This fix does not change that, it is only a
narrow fix targeted at 9006.

* avm2: implement selectionBegin/selectionEnd/caretIndex and add a test.

The selection test validates a few situations, including the behaviour
when unfocusing that was fixed in the previous commit.

The test does not validate how the selection changes after replacing
text, as there are still some inaccuracies there.

* avm2: Additional selection fixes needed after merging with master.

1. The default caret for an AVM2 textbox is at the end of the textbox,
   not the beginning.
2. Selection should not be changed when focusing on a textbox in AVM2.
3. Fixed a test whose output.txt didn't actually match the flash player
   output.

* avm2: Make the selection AVM checks compatible with mixed AVM, and revert the on_focus_changed parameters

---------

Co-authored-by: Nathan Adams <dinnerbone@dinnerbone.com>
2023-07-15 16:17:45 +00:00
Nathan Adams 26cf380aa4 avm2: Fix Array.sort(function) 2023-07-15 17:53:05 +02:00
CUB3D 14712b46c6 chore: Fix clippy lint 2023-07-15 11:45:02 +02:00
CUB3D d7a780f5ea core: Fix caching order, add test 2023-07-15 11:45:02 +02:00
CUB3D 27bc6e9609 avm1: Fix panic on writing self-referential SharedObjects 2023-07-15 11:45:02 +02:00
Abiel Deneke 4afcadf4fd avm2: Implement `Matrix3D.transformVectors` 2023-07-14 23:39:39 -04:00
michiel2005 6b423a7eef Ran cargo fmt 2023-07-14 16:51:07 -06:00
michiel2005 fc32dc3671 Removed some code that was double checking without any need. 2023-07-14 16:51:07 -06:00
michiel2005 c812a8af54 checked for movie equality in check_display_object_equality().
Makes code more readable.
2023-07-14 16:51:07 -06:00
michiel2005 4f605947e5 Well, we don't talk about this mistake. 2023-07-14 16:51:07 -06:00
michiel2005 2307bd7e74 Changed down_object to pressed and removed one issue in my code Lord-McSweeney found 2023-07-14 16:51:07 -06:00
michiel2005 8834b3b42b Added changes as Adrian recommended 2023-07-14 16:51:07 -06:00
michiel2005 412f2880ad Removed a unnecessary variable 2023-07-14 16:51:07 -06:00
michiel2005 90cb88d50e We're also checking for the depth now when searching for displayobjects 2023-07-14 16:51:07 -06:00
michiel2005 aaede767fe Made sure that the objects are actually in the same movie and added a bit of documentation 2023-07-14 16:51:07 -06:00
michiel2005 8141e7b54c avm1: fix buttons that were not clickable after a goto 2023-07-14 16:51:07 -06:00
Moulins 3ea67668c0 render: make Context3D renderers fully GC-agnostic
The 'gc_arena' dependency was only used to manipulate the `GcCell`s
containing the vertex and fragment shaders; replacing these by a
reference to a plain old `Cell` means tha  the Context3D traits and
types do not need to interact with GC'd object anymore.

As a knock-on effect, we can also remove the `Activation` parameter
from most of the `Context3DObject` methods.
2023-07-14 16:06:36 -06:00
Moulins a0ad308de0 avm2: use an inner RefLock instead of GcCell in Context3D-related objects 2023-07-14 16:06:36 -06:00
relrelb 204cf4b2bc avm1: Migrate `Xml` to `NativeObject` 2023-07-14 17:10:10 +03:00
Nathan Adams f150a32d86 core: Only scale filters with stage view matrix 2023-07-12 18:51:11 +02:00
Nathan Adams 30e7a1eac6 core: Account for filter size changes when drawing cacheAsBitmaps 2023-07-12 18:51:11 +02:00
Nathan Adams d721072825 core: Extract DrawCacheInfo type from big tuple inside render_base 2023-07-12 18:51:11 +02:00
Nathan Adams f9ec5eb9b8 avm1: Make XMLNode constructor use NativeObject directly 2023-07-12 18:33:58 +02:00
Nathan Adams d4b81cae5c avm1: Migrate XMLNode to NativeObject 2023-07-12 18:33:58 +02:00
renovate[bot] f0607d6a1f chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
nosamu 17df97a59a core: Fix panic from oversized bitmap warning
And warn only once per bitmap
2023-07-11 22:02:35 +02:00
Adrian Wielgosik ffc6e2ffdc core: Mark stack-heavy DO functions as noinline 2023-07-10 11:32:50 +02:00
Aaron Hill e16a4833ac avm2: Stub Program3D.dispose 2023-07-10 00:23:25 -04:00
moulins f5b4fbce77
Upgrade to new `gc-arena` API (#11182)
* core: add temporary, ruffle-internal copy of `gc-arena` crate

This will allow bumping the upstream `gc-arena` version while
reexporting our own version of the old `GcCell` API, so that
Ruffle's code can be gradually migrated.

Once the migration is done, this crate should be removed.

* core: bump `gc-arena` to kyren/gc-arena#56

Add back the removed `GcCell` to our internal facade crate

* core: bump `gc-arena` to current master

This bump renames `Gc::allocate` to `Gc::new`

* core: rename `GcCell::allocate` to `GcCell::new`, to match `Gc`

* core: bump gc-arena to (slighly after) v0.3.1

Add typedefs for old `*Context` names in the gc-arena facade crate

* core: replace uses of `CollectionContext<'_>` by `&Collection`

* core: Add `gc()` convenience method for `*Context` and `Activation` types

This allows shortening most instances of `[activation.]context.gc_context`
to `activation.gc()` or `context.gc()` (but not all instances, because of
borrowck) Note that this doesn't actually do these shortenings to avoid
major code churn.
2023-07-09 17:04:25 -04:00
Aaron Hill b6fae8e214 wgpu: Cache Program3D bind group layout
The bind group layout only depends on the texture registers
(and 2D/cubemap type) accessed by the fragment shader, not on
the runtime texture bound with Context3D. This means that we can
build and cache it when we compile the AGAL program to a Naga
module.

Since the bind group layout is used for the overall pipeline, I've
refactored the shader caching code into `ShaderPairAgal`, which
holds both the vertex and fragment shader bytecode, and compiles
both in the `compile` function.
2023-07-09 12:39:10 -04:00
Adrian Wielgosik a0d6389bd6 avm2: Replace Activation.resolve_type by domain lookup 2023-07-08 19:51:38 +02:00
Adrian Wielgosik b38bd604db avm2: Fix Multiname-with-params formatting 2023-07-08 01:55:44 +02:00
Lord-McSweeney 5337975cba avm2: Remove old hack now that DOs use an instance allocator 2023-07-07 23:14:54 +02:00
Aaron Hill 61c50e636a
avm2: Convert `has_class_in_chain` to use a `GcCell<Class>` (#11494) 2023-07-07 16:22:38 -04:00
Lord-McSweeney b68008426a avm2: Use the current SWF version instead of root SWF version in MC.gotoAndPlay 2023-07-07 21:19:16 +02:00
Aaron Hill 4cf0735692 avm2: Implement Utils3D.projectVector and Utils3D.projectVectors 2023-07-06 11:34:40 -04:00
Lord-McSweeney f8fa8a68cf avm2: Replace Option<Object<'gc>> with Object<'gc> in all native methods 2023-07-06 10:56:49 -04:00
Aaron Hill c295e3e481 avm2: Implement NetConnection.connect with a null `command` 2023-07-06 01:20:34 -04:00
Aaron Hill 009fab1889 core: Expose `LoaderInfo.parameters` and fix other properties
When using a 'Loader', properties on the 'contentLoaderInfo' become
set during specific events in the load sequence. In particular,
'LoaderInfo.bytesTotal' becomes available during the first 'progress'
event.

Also, 'LoaderInfo.parameters' is now properly set from the URL query
parameters. In Flash player, this work even with filesystem urls
(e.g. 'file:///some/path/to/file.txt?paramOne=valOne' will load
a file named 'file.txt', setting and expose the parameter 'paramOne'
with value 'valOne' in `LoaderInfo.parameters`). This required some
cleanup to the desktop and test NavigatorBackend impls to strip
out query parameters when loading a parameter from disk.

Previously, we would set `SwfMovie.parameters` manually from the url.
Now, the various `SwfMovie` constructors automatically extract
query parameters from the provided url. Outside of `SwfMovie`,
we only append *extra* parameters (e.g. those set from `flashvars`).

This makes CPMStar ads work, since the loaded SWF needs to access
`LoaderInfo.parameters`
2023-07-05 19:47:16 -04:00
Aaron Hill 8ac8be7213 avm2: Implement Graphics.drawPath
The 'winding' argument and filling behavior described in the docs
are not yet implemented. However, this implementation is good enough
for Scratch to render its default cat image.
2023-07-05 19:21:50 -04:00
Lord-McSweeney ab51654c17 avm2: Remove unused Activation.is_executing 2023-07-05 19:07:50 -04:00
Lord-McSweeney 2725d49119 avm2: Clean up Activation a little 2023-07-05 19:07:50 -04:00
Aaron Hill bbb5619bc9 tests: Add TextField Event.CHANGE test and update test input format 2023-07-05 18:00:59 -04:00
Aaron Hill 4695d1fa63 avm2: Implement 'change' event for TextField 2023-07-05 18:00:59 -04:00
Adrian Wielgosik 87ede6a052 avm2: Set correct `this` values in function calls 2023-07-05 22:36:20 +02:00
Aaron Hill 2d1da4d18e avm2: Throw TypeError when trying to parse malformed XML
Scratch detects if a string is valid XML by trying to construct
an XML object, and catching the thrown error.
2023-07-05 19:41:23 +02:00
Nathan Adams a99b30927f avm1: Panic if we see a shader filter 2023-07-05 19:18:00 +02:00
Nathan Adams 4fc170e5bd avm1: Implement gradient filters conversions 2023-07-05 19:18:00 +02:00
Nathan Adams bfedfbaa98 avm1: Implement displacement map filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 8a767492e6 avm1: Implement drop shadow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 40b4f9bafa avm1: Implement glow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 30027bc03e avm1: Implement convolution filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams df6064b2e9 avm1: Implement color matrix filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams b3629669bd avm1: Implement blur filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 73bc637ad7 avm1: Implement bevel filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 2b48f579e6 avm1: Implement MovieClip.filters 2023-07-05 19:18:00 +02:00
Nathan Adams 681ff3dd24 avm1: Add helper method to get/set strength in filter objects 2023-07-05 19:18:00 +02:00
Aaron Hill e716b3fd7f avm2: Implement XML.descendants for attributes
We were previously only ever checking children,
and not attributes.

In order to avoid matching both attributes and elements
with a given name in 'descendants', `E4xNode::matches_name`
now checks `is_attribute` on the provided `Multiname`. This
requries changing several other parts of the codebase to
properly set this flag on `Multinames` provided by ActionScript.
2023-07-04 19:38:30 -04:00
Aaron Hill f7cbe3b7cd avm2: Implement Graphics.copyFrom 2023-07-04 16:12:29 -04:00
Aaron Hill f22bef99b4 core: Fix some Clippy lints on the latest nightly 2023-07-04 20:50:46 +02:00
Lord-McSweeney 275c42b39c core: Correctly apply blend modes and filters from button records 2023-07-04 20:24:12 +02:00
Lord-McSweeney c943866745 core+avm1: Implement FLV onCuePoint for AVM1 2023-07-04 00:36:25 +02:00
Nathan Adams 146d565c02 render: Add Filter::scale() and use it to scale filter values (currently just blur_) 2023-07-03 20:13:40 +02:00
renovate[bot] 13b1078142 chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
Aaron Hill 768eaa1a01 avm2: Store at most a single type parameter in names/clasess
The only generic class is `Vector`, which only has a single parameter.
However, we currently store a list of type parameters in several places,
which requires redundant checks that the list only has one entry.

Instead, we now store an `Option` everwhere except for
`swf::Multiname::TypeName` (since the actual SWF format supports
multiple type parameters). We still perform the same check when loading
bytecode (the swf Multiname should only have at most one type
parameter), but the rest of the codebase can deal with an `Option`
instead.
2023-07-02 16:02:53 -04:00
Aaron Hill b77c1fc78f core: Fix Nightly clippy lint 2023-07-02 14:32:45 +02:00
Aaron Hill f7c50865a0 core: Update formatting with latest nightly 'cargo fmt' 2023-07-02 14:32:45 +02:00
Adrian Wielgosik bd043c09c7 cargo fmt 2023-07-01 23:38:09 +02:00
David Wendt 679f179a60 docs: Document the aliasing situation with `VideoSource::Swf` 2023-07-01 23:38:09 +02:00
David Wendt d382b29fb1 core: Allocate a new `VideoSource` when attaching netstreams rather than attaching the stream to every instance of the video 2023-07-01 23:38:09 +02:00
David Wendt b2544618ab core: `VideoStream` should not hold the last decoded frame as this data structure is shared across multiple instances of the same character 2023-07-01 23:38:09 +02:00
Adrian Wielgosik 7eb7f2ee2c avm2: Correctly set and use Video class from Rust 2023-07-01 22:45:20 +02:00
Lord-McSweeney 7ad864ca02 avm2+tests: Implement Matrix3D.copyColumnFrom; add a test 2023-07-01 15:23:29 -04:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
Aaron Hill 710be15f78 core: Bail out of operations::color_transform if [xy]_min==[xy]_max
In the special case where y_min==y_max==(height-1),
we would create a bad 'encompassing' region - subtracing
one from the max would make it smaller than the min,
causing `PixelRegion::encompassing_pixels` to treat it
as the minimum, and add one to `height - 1`

There's no work to do when x_min==x_max or y_min==y_max,
so we can also skip the sync and GC write in this case.
2023-07-01 09:55:59 -04:00
Nathan Adams 5e608764ec core: Add debug feature to find display objects by mouse 2023-07-01 12:58:32 +02:00
Aaron Hill c2fcdf6fd6 avm2: Implement Stage3D.requestContext3DMatchingProfiles
For now, we just ignore the parameters and call requestContext3D
2023-06-30 23:22:56 -04:00
Crowdin Bot 29a5c6a4cd chore: Update translations from Crowdin 2023-07-01 00:47:31 +02:00
David Wendt 32524d3abd core: AVM2 display object allocators always ensure both halves of the display object are connected correctly 2023-06-30 16:14:28 -06:00
David Wendt 8ac8b926ac core: If a video does not have an `onMetaData` block, register a compatible-ish datastream so that we can still play the video 2023-06-30 16:14:28 -06:00
David Wendt b9aaaf5259 flv: ScreenVideo v2 also wants the FLV video data byte 2023-06-30 16:14:28 -06:00
David Wendt 3ff1db014f flv: Screen Video wants the FLV `VideoData` header byte 2023-06-30 16:14:28 -06:00
David Wendt ff1ed66729 flv: VP6 video packets have a horizontal and vertical adjustment before the actual video data. 2023-06-30 16:14:28 -06:00
David Wendt 98ee78be1a avm2: Make netstream event initialization more concise 2023-06-30 16:14:28 -06:00
David Wendt 04ee039d3c avm2: Use `ParametersExt` to grab parameters in `Video.init()` 2023-06-30 16:14:28 -06:00
David Wendt faf8fb5d3f avm2: Move as much `Video` initialization as possible into an instance allocator function 2023-06-30 16:14:28 -06:00
David Wendt 45e6f07009 core: Pause the stream if we hit a tag parsing error. 2023-06-30 16:14:28 -06:00
David Wendt af0149c476 core: Log netstream signature verification errors 2023-06-30 16:14:28 -06:00
David Wendt b639af1ada avm2: `Video.init` doesn't need to call `super_init` 2023-06-30 16:14:28 -06:00
David Wendt d2f806a901 core: The AVM2 version of this test wants a spurious status event 2023-06-30 16:14:28 -06:00
David Wendt ab21b5b106 core: The stop event is `NetStream.Play.Stop` 2023-06-30 16:14:28 -06:00
David Wendt fc50a688fb core: Update stream time after processing tags 2023-06-30 16:14:28 -06:00
David Wendt 4dd9508471 avm1: Implement onStatus events for NetStream 2023-06-30 16:14:28 -06:00
David Wendt 63b27a4a20 avm2: Pass status events through to AVM2. 2023-06-30 16:14:28 -06:00
David Wendt 757ae40abc core: Add stubs for stream event triggers 2023-06-30 16:14:28 -06:00
David Wendt da2ef5392e core: Make the `NetStream`/AVM link bidirectional 2023-06-30 16:14:28 -06:00
David Wendt 067474dea5 chore: Remove unused variables from stream.rs 2023-06-30 16:14:28 -06:00
David Wendt d498a412e5 core: Retain original SWF dimensions for self bounds 2023-06-30 16:14:28 -06:00
David Wendt b164319e32 core: FLV metadata is stored as an array, not an object. 2023-06-30 16:14:28 -06:00
David Wendt 643b053e8d core: Don't mark the video stream as corrupt if we haven't gotten the full header yet 2023-06-30 16:14:28 -06:00
David Wendt 587a99fae7 core: Netstream loaders are... well, netstream loaders. 2023-06-30 16:14:28 -06:00
David Wendt 0e207cce8d core: Actually spawn the loader future for the netstream 2023-06-30 16:14:28 -06:00
David Wendt 7e986bd90d avm1: `NetStream` constructor must return itself 2023-06-30 16:14:28 -06:00
David Wendt 766ee5302d core: Properly expose AVM1/2 objects for videos. 2023-06-30 16:14:28 -06:00
David Wendt a52f738009 core: Silence various errors triggered by loading an empty video stream 2023-06-30 16:14:28 -06:00
David Wendt 257403d04e core: Errors in tag parsing should include the explanation of the underlying error 2023-06-30 16:14:28 -06:00
David Wendt f690162a4f avm2: Actually create an unconnected `Video` when one is constructed via `new Video` 2023-06-30 16:14:28 -06:00
David Wendt c86360a10b core: `Video`s attached to a `NetStream` get their bitmap size and data from the attached `NetStream`. 2023-06-30 16:14:28 -06:00
David Wendt 9e318fc8e8 core: Process basic FLV video data tags and funnel them to the video backend.
This works a bit differently from SWF videos, we do not retain decoded video frames or valid seek points indefinitely. This assumes code interacting with `NetStream` is at least mildly aware of how a video codec is supposed to work and what the performance implications of that are.
2023-06-30 16:14:28 -06:00
David Wendt 3d5156b90d core: Update the stream offset after each tag is processed.
The `preload_offset` is only ever moved forward, of course.
2023-06-30 16:14:28 -06:00
David Wendt 3410d9fcf8 core: Process `onMetaData` to get our stream definition with.
We use `preload_offset` to avoid processing the same metadata multiple times.
2023-06-30 16:14:28 -06:00
David Wendt 286acddfea core: Introduce the notion of a separate preload step.
We don't actually process tags out of order, we're just tracking what tags have already been processed. FLV embeds critical video metadata in a ScriptData tag that we need to pull data out of and process.
2023-06-30 16:14:28 -06:00
David Wendt bc9fd3613e core: Add stub FLV processing 2023-06-30 16:14:28 -06:00
Fancy2209 8f0a43f9d9
Add prependRotation, copyRowTo and copyRowFrom (#11698)
Co-authored-by: Aaron Hill <aa1ronham@gmail.com>
2023-06-30 14:31:08 -04:00
Aaron Hill 1c151a86d6 avm2: Stub isXMLName 2023-06-29 15:51:39 -04:00
Nathan Adams a5915a9bdb swf: Make Color Copy 2023-06-29 20:32:36 +02:00
Lord-McSweeney 04747f86b6 avm2: Stub AVM1Movie 2023-06-29 12:05:01 -04:00
EmperorBale e846d035e5 avm2: Use `method_name` as last resort if available in stack trace 2023-06-29 11:49:48 -04:00
Aaron Hill 9b8a8c9974 avm2: Correctly re-use objects in XML/XMLList call handlers and ctors
`XML(someXMLObj)` and `XMLList(someXMLList)` perform the
normal cast behavior (returning the same object), instead
of creating a new object like other arguments do.

This also applies to `new XMLList(someXMLObj)`
and `XML(singleElemXMLList)`
2023-06-28 21:16:05 -04:00
Crowdin Bot 1430e98851 chore: Update translations from Crowdin 2023-06-28 23:19:47 +02:00
Niv.Kaminer 053bcf9376 core: Update sounds in rootless SWF (close #11666) 2023-06-26 16:59:01 -04:00
renovate[bot] 3057aa59dd chore(deps): lock file maintenance rust dependencies 2023-06-25 21:53:00 -04:00
renovate[bot] f62dd17284 fix(deps): update rust crate indexmap to v2 2023-06-25 20:27:33 -04:00
Nathan Adams 0ca206ce4f core: Add dumb filter list inside debug ui 2023-06-25 21:58:46 +02:00
Nathan Adams 628d8f66ad render: Add filters to BitmapCacheEntry 2023-06-25 21:58:46 +02:00
Lord-McSweeney a38dec3f9c core: Erase filters in GotoPlaceObject::new if initial PlaceObject has none 2023-06-25 18:27:54 +02:00
Lord-McSweeney 0dba2ac37c core: Overwrite filters in GotoPlaceObject::merge 2023-06-25 18:27:54 +02:00
Lord-McSweeney 2d02886f5a avm2+tests: Support CData in XML.toXMLString; add test 2023-06-25 00:25:47 -04:00
Nathan Adams f24aabf74e core: Don't hold a borrow on Avm1Button whilst adding children - fixes #11706 2023-06-24 22:33:42 +02:00
MrCheeze 1baccb483a core: Apply filters when modifying an object, not just when instantiating 2023-06-24 17:22:32 +02:00
Nathan Adams 6d77ff1fc4 core: Store just abcd fields of Matrix inside BitmapCache, as we don't use tx/ty 2023-06-24 01:42:04 +02:00
Nathan Adams 4f9cc4e3c4 core: Clear this on scrollRect, not just ancestors 2023-06-24 01:42:04 +02:00
Nathan Adams 668cc31fa4 chore: Comment changes regarding cacheAsBitmap 2023-06-24 01:42:04 +02:00
Nathan Adams a5b28b50bf core: Don't invalidate things more than once per frame, to avoid repeat walking of the DO tree 2023-06-24 01:42:04 +02:00
Nathan Adams cdb0774642 core: Hook up DisplayObject::opaque_background 2023-06-24 01:42:04 +02:00
Nathan Adams ee444853b4 avm1: Implement MovieClip.cacheAsBitmap 2023-06-24 01:42:04 +02:00
Nathan Adams d94c73cebe core: Rename bitmap cache methods and make clear which one is preference and which one is actual 2023-06-24 01:42:04 +02:00
Nathan Adams 9795fc9311 core: Invalidate ancestors on scrollRect changes 2023-06-24 01:42:04 +02:00
Nathan Adams f0b72ee89c core: Add cacheAsBitmap debug buttons 2023-06-24 01:42:04 +02:00
Nathan Adams f81b1f83b9 core: Fix panic in recursive set_maskee/set_masker 2023-06-24 01:42:04 +02:00
Nathan Adams 1a9bec3062 core: Don't use cacheAsBitmap when bitmapdata.draw() as it'll keep reinvalidating it 2023-06-24 01:42:04 +02:00