Skip to content

Conversation

@Lord-McSweeney
Copy link
Collaborator

@Lord-McSweeney Lord-McSweeney commented Nov 15, 2025

The first two commits are not observable by code (except in stack traces that will now include Sprite.constructChildren). The third commit fixes a minor issue with child construction-

construct_frame is called on the children of a MovieClip each frame, except on the first. This ensures children that were placed earlier in the frame lifecycle are properly instantiated. On the first frame of a MovieClip, the constructor for Sprite (super() in a subclass) calls Sprite.constructChildren to manually construct each child that was placed on the timeline in the first frame. This PR makes sure that these first-frame children are never constructed by the usual "construct_frame on every frame" logic by setting a new FRAME_CONSTRUCT_SKIPPED flag on them.

Closes #2916

@Lord-McSweeney Lord-McSweeney added waiting-on-review Waiting on review from a Ruffle team member A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already) labels Nov 15, 2025
This change should not be observable, as no other `DisplayObject` subclasses can have timeline children
Also make them standalone functions instead of associated methods.

Previously, they were associated methods on `TDisplayObject`, but they didn't
actually access the `DisplayObject` they were called on
…antiation

Often, `MovieClip`s have children that are placed before the `MovieClip`'s
AVM2 side is allocated and instantiated. These children will be instantiated
in the `super()` constructor (specifically, the `Sprite.constructChildren`
call), rather than in-line with normal frame construction. However, if the
`super()` constructor is /never/ called, these children will never be
instantiated. This commit adds a flag that is set on such early children.
Children with this flag set will never have `construct_frame` called on them
during normal frame construction.

Also add test coverage
@Lord-McSweeney Lord-McSweeney force-pushed the avm2-construct-children branch from 8d582ad to 7aa87e3 Compare December 3, 2025 22:58
@Lord-McSweeney Lord-McSweeney removed the waiting-on-review Waiting on review from a Ruffle team member label Dec 4, 2025
@Lord-McSweeney Lord-McSweeney merged commit 014d977 into ruffle-rs:master Dec 4, 2025
26 checks passed
Hancock33 added a commit to Hancock33/batocera.piboy that referenced this pull request Dec 7, 2025
------------------------------------------------------------------------------------------
duckstation.mk c49f32a5519bd312f06d4f3a4aadf10d7dba419e # Version: Commits on Dec 05, 2025
------------------------------------------------------------------------------------------
Deps: Set PKG_CONFIG_PATH when building,

-----------------------------------------------------------------------------------
eden.mk 90877dfc8546b3fb6d568ea5cce26060f2478b24 # Version: Commits on Dec 05, 2025
-----------------------------------------------------------------------------------
[cmake] only use MoltenVk on Apple platforms (#3146)

----------------------------------------------------
pcsx2.mk v2.5.350 # Version: Commits on Dec 04, 2025
----------------------------------------------------
- [CI:AppImage: Build our own ffmpeg](PCSX2/pcsx2#13554)

-----------------------------------------------------------------------------------
play.mk 63a35e28d102e482daaa5454a68c07192b4d3210 # Version: Commits on Dec 04, 2025
-----------------------------------------------------------------------------------
JS: Run NPM audit fix.,

-----------------------------------------------------
ryujinx.mk 1.3.230 # Version: Commits on Dec 04, 2025
-----------------------------------------------------
Canary-1.3.230

---------------------------------------------------------------
ruffle.mk nightly-2025-12-05 # Version: Commits on Dec 05, 2025
---------------------------------------------------------------
## What's Changed

* core/avm2: Minor fix to construction of children that were placed on the first frame by @Lord-McSweeney in ruffle-rs/ruffle#22239

* chore: Update translations from Crowdin by @kjarosh in ruffle-rs/ruffle#22411

**Full Changelog**: ruffle-rs/ruffle@nightly-2025-12-04...nightly-2025-12-05,

--------------------------------------------------------------------------------------
scummvm.mk 3e6309674d706a33a4a779f64d43d95314b92621 # Version: Commits on Dec 05, 2025
--------------------------------------------------------------------------------------
AGI: Update function signature in RTL code,

----------------------------------------------------------------------------------------
openjkdf2.mk 8190251af150adf28092b76549903980a09020b2 # Version: Commits on Dec 05, 2025
----------------------------------------------------------------------------------------
Fix dialog box popping up before videos, fix cutscene audio sync, fix on screen keyboard for steam deck and big picture mode, broke MoTS cutscene audio,

------------------------------------------------------------------------------------------------------
vulkan-validationlayers.mk 5e6c6bd96224c1c0bb73414a9227d93f7cc236b0 # Version: Commits on Dec 04, 2025
------------------------------------------------------------------------------------------------------
layers: Remove unused Include headers,

---------------------------------------------------------------------------------------------
libretro-fbneo.mk db02ef59a64209954b47965ae186ec95cf1da706 # Version: Commits on Dec 05, 2025
---------------------------------------------------------------------------------------------
(libretro) update files,

-----------------------------------------------------------------------------------------------
libretro-geolith.mk 53afdea6196cf8e7c19c110fa1ef1ca276810eca # Version: Commits on Dec 05, 2025
-----------------------------------------------------------------------------------------------
lspc: Dark bit should be inverted,

-----------------------------------------------------------------------------------------------
libretro-scummvm.mk 3e6309674d706a33a4a779f64d43d95314b92621 # Version: Commits on Dec 05, 2025
-----------------------------------------------------------------------------------------------
AGI: Update function signature in RTL code,

---------------------------------------------------------------------------------------------
libretro-vba-m.mk 09c2597aae302bacd5c7dd5345028956e8eba261 # Version: Commits on Dec 04, 2025
---------------------------------------------------------------------------------------------
gb: make joypad polling more accurate

Make joypad polling for GB more hardware-accurate. This fixes RoboCop

Revision 1.

Fixed with Claude.

Fix #1491.

Signed-off-by: Rafael Kitover <rkitover@gmail.com>,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-core Area: Core player, where no other category fits T-fix Type: Bug fix (in something that's supposed to work already)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AVM2: Child objects should be instantiated and assigned by super constructor

2 participants