avm2: Store PerspectiveProjection to DisplayObject#19670
avm2: Store PerspectiveProjection to DisplayObject#19670Dinnerbone merged 8 commits intoruffle-rs:masterfrom
Conversation
19168c2 to
af96e50
Compare
af96e50 to
970b60c
Compare
e5874ce to
da3e09a
Compare
| [approximations] | ||
| number_patterns = [ | ||
| # Both FP 32,0,0,465 (for Linux) and FP 32 (for Windows) produced slightly different numbers in some environment. However, the original trace from mozilla/shumway is respected in the output file. | ||
| 'focalLength: ([0-9.]+)' | ||
| ] | ||
| max_relative = 0.0000001 |
There was a problem hiding this comment.
I believe the output.txt is from https://github.com/mozilla/shumway/blob/master/test/swfs/avm2/flash/geom/perspectiveprojection/PerspectiveProjectionClass.swf.trace .
I couldn't reproduce exactly the same result from PerspectiveProjectionClass.as in the same directory (after recompilation with mxmlc) or even from the test.swf (without recompilation).
(Fun fact: I was able to pass this test without this approximation until #19748 was merged -- What does it mean? Anyway, I think the problem is that I cannot reproduce the output.txt from ActionScript or SWF.)
There was a problem hiding this comment.
I think a small difference like this isn't a problem, we have similar issues with some of the AVM2 Number tests already.
| .classes() | ||
| .perspectiveprojection | ||
| .construct(activation, &[])?; | ||
| .construct(activation, &[])? |
There was a problem hiding this comment.
Hmm, does this really return a new PerspectiveProjection each time the getter is called?
There was a problem hiding this comment.
Yes, to make it clear, I added a test case testEq() to geom_transform just now.
From the same Transform, every call to the getter creates a new PerspectiveProjection.
| }, | ||
| )); | ||
| stage.set_is_root(gc_context, true); | ||
| stage.set_perspective_projection(gc_context, None); // Set default PerspectiveProjection |
There was a problem hiding this comment.
Is this line necessary?
There was a problem hiding this comment.
Yes, this line actually sets PerspectiveProjection::default() to DO's PerspectiveProjection.
ruffle/core/src/display_object/stage.rs
Lines 894 to 896 in aa6197e
Technically it's fine to set PerspectiveProjection::default() directly at here, but for consistency with root.set_perspective_projection() in a different file I'm passing None here.
Line 397 in aa6197e
The
root actually has a different value used when None (null) is provided..ruffle/core/src/display_object/movie_clip.rs
Lines 2836 to 2845 in aa6197e
da3e09a to
aa6197e
Compare
cookie-s
left a comment
There was a problem hiding this comment.
Thank you for review!
| .classes() | ||
| .perspectiveprojection | ||
| .construct(activation, &[])?; | ||
| .construct(activation, &[])? |
There was a problem hiding this comment.
Yes, to make it clear, I added a test case testEq() to geom_transform just now.
From the same Transform, every call to the getter creates a new PerspectiveProjection.
| }, | ||
| )); | ||
| stage.set_is_root(gc_context, true); | ||
| stage.set_perspective_projection(gc_context, None); // Set default PerspectiveProjection |
There was a problem hiding this comment.
Yes, this line actually sets PerspectiveProjection::default() to DO's PerspectiveProjection.
ruffle/core/src/display_object/stage.rs
Lines 894 to 896 in aa6197e
Technically it's fine to set PerspectiveProjection::default() directly at here, but for consistency with root.set_perspective_projection() in a different file I'm passing None here.
Line 397 in aa6197e
The
root actually has a different value used when None (null) is provided..ruffle/core/src/display_object/movie_clip.rs
Lines 2836 to 2845 in aa6197e
aa6197e to
513015d
Compare
fdba546 to
744856c
Compare
744856c to
0a76bf0
Compare
|
I've fixed the rebase conflict. Thank you so much! |
Stage and root have their own initial PerspectiveProjection value, and it's also used when attempting to set `null`.
* Remove FIXME for TestTranformUpdate() * Add four more test cases
Small number differences in focalLength are accepted as approximation
It's now unused because ruffle_render::Transform stores Option<PerspectiveProjection>.
It's very hard to verify this value with any test while PerspectiveProjection rendering is not implemented. However, this change makes the most sense.
It's not obvious whether each getter of one Transform object should return the same instance or newly created instance.
0a76bf0 to
db155ab
Compare
--------------------------------------------------------------------------------------- amiberry.mk 8f253ae5e44b7cc5bd90454bf63e719b6ffc6a24 # Version: Commits on Jun 10, 2025 --------------------------------------------------------------------------------------- bugfix: Prevent null pointer return for small ROM buffer sizes, -------------------------------------------------------------------------------------------- amiberry-lite.mk ee9f7f9cb4a3623d9050a1adc1aec45063f022d4 # Version: Commits on Jun 11, 2025 -------------------------------------------------------------------------------------------- bugfix: Fix some address sanitizer issues, ------------------------------------------------------------------------------------------ dolphin-emu.mk a16387741383ca00524f78f9854c55be7089cf93 # Version: Commits on Jun 10, 2025 ------------------------------------------------------------------------------------------ Merge pull request #13746 from LillyJadeKatrin/retroachievements-hardcore-changed MainWindow - Avoid excessive emulation state changes, ------------------------------------------------------------------------------------------ duckstation.mk 36b869003a5032ad6b8ebdfeb290664590722e00 # Version: Commits on Jun 10, 2025 ------------------------------------------------------------------------------------------ Qt: Use standard key sequences for main window shortcuts Notably, this enables command+R to refresh on macOS, where F5 is not commonly used., ----------------------------------------------------------------------------------------- lightspark.mk a92464d46e92f0e974d3fd848a69d85386fa0280 # Version: Commits on Jun 11, 2025 ----------------------------------------------------------------------------------------- [ABCVm] fix several issues with local numbers fixes some regressions in \Nightflies\, -------------------------------------------------------------------------------------- openmsx.mk c0305648eea0974c57318ec420d6a166f8bcd767 # Version: Commits on Jun 09, 2025 -------------------------------------------------------------------------------------- Add auto raw screenshot size option to the GUI. Closes #1062., ---------------------------------------------------- pcsx2.mk v2.3.414 # Version: Commits on Jun 10, 2025 ---------------------------------------------------- - [IopBios: do not overflow snprintf tmp buffer](PCSX2/pcsx2#12826) ------------------------------------------------------------------------------------- ppsspp.mk d5cf9c97ca79c558268abd7b331238b33c35ed0f # Version: Commits on Jun 11, 2025 ------------------------------------------------------------------------------------- Merge pull request #20506 from crashGG/mmpx-enhace Fixed luma calculation in MMPX, --------------------------------------------------------------- ruffle.mk nightly-2025-06-11 # Version: Commits on Jun 11, 2025 --------------------------------------------------------------- ## What's Changed * build(deps): bump the cargo-minor group across 1 directory with 9 updates by @dependabot in ruffle-rs/ruffle#20591 * web: Switch from `unload` to `pagehide` event by @Toad06 in ruffle-rs/ruffle#20429 * core: Add known_failure tests for frame script handling by @nivkner in ruffle-rs/ruffle#20589 * avm2: hitTestPoint should only use local coordinates for the player root by @ZingBallyhoo in ruffle-rs/ruffle#20054 * avm2: Store PerspectiveProjection to DisplayObject by @cookie-s in ruffle-rs/ruffle#19670 * desktop: Implement font sorting using fontconfig by @kjarosh in ruffle-rs/ruffle#20392 * avm1: don't panic when trying to set a different NativeObject kind by @moulins in ruffle-rs/ruffle#20482 * avm2: Don't activate fast-path for non-public Multiname by @Lord-McSweeney in ruffle-rs/ruffle#18746 **Full Changelog**: ruffle-rs/ruffle@nightly-2025-06-10...nightly-2025-06-11, ---------------------------------------------------- ryujinx.mk 1.3.85 # Version: Commits on Jun 11, 2025 ---------------------------------------------------- Canary-1.3.85 -------------------------------------------------------------------------------------- scummvm.mk fdcbc279765e432cbabf19264273f4a87f61fc11 # Version: Commits on Jun 10, 2025 -------------------------------------------------------------------------------------- SCUMM: Use correct save slot when loading during a SMUSH video This only affected the original load dialogs., -------------------------------------------------------------------------------------- shadps4.mk 3e0ec9ebef8c6b7d752d4538e42b36b571c983a6 # Version: Commits on Jun 11, 2025 -------------------------------------------------------------------------------------- Core: Merge Direct Memory Areas (#3084) * Merge dmem areas * Fix DirectMemoryArea::CanMergeWith Don't merge dmem areas if the memory types are different. * Reduce some warnings to info Both functions should behave properly now, there's no reason to warn about their use. * Clang, --------------------------------------------------------------------------------------- thextech.mk 60b4df7c9465eae98e60b0949c2fd92fb6c00a15 # Version: Commits on Jun 11, 2025 --------------------------------------------------------------------------------------- Update AudioCodecs, ------------------------------------------------- vice.mk r45696 # Version: Commits on Jun 11, 2025 ------------------------------------------------- used constant instead of magic number, make docs match the implementation :) git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45696 379a1393-f5fb-40a0-bcee-ef074d9b53f7, ---------------------------------------------------------------------------------------- rpi-utils.mk b7651d86d71a172b2208c67b2e360cbcb4f9d98f # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------- pinctrl: Clarify the required privelege level See: raspberrypi/utils#135 Signed-off-by: Phil Elwell <[email protected]>, ---------------------------------------------------------------------------------------- pironman5.mk b70f2afc10d70661d8a798d1744696a1e9864282 # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------- chore: update version to 1.2.13.3 and pm_auto dependency to 1.2.9, ------------------------------------------------------------------------------------ box64.mk 44669935dae4ca780417c877981c3ca9390758c9 # Version: Commits on Jun 11, 2025 ------------------------------------------------------------------------------------ [WOW64] Small improvement to grab_segdata (#2728), ------------------------------------------------------------------------------------------ fallout2-ce.mk a67fe7ead1ac985eba480e9c31fd1df49db39c44 # Version: Commits on Jun 11, 2025 ------------------------------------------------------------------------------------------ Merge pull request #191 from fallout2-ce/scan_scripts_for_unknown_opcodes_2 Scanner of not implemented opcodes, metarules, config options, ---------------------------------------------------- fheroes2.mk 1.1.9 # Version: Commits on Jun 11, 2025 ---------------------------------------------------- - Add the ability to set owner color for capturable objects in the Editor - Add the Black Cat and Barrel objects - Update rendering of spells in battles and fix several rendering issues - Improve performance for the Editor and language support - Bundle several maps with fheroes2 - Over _**30**_ issues have been closed since the 1.1.8 release Full list of changes can be found [here](https://github.com/ihhub/fheroes2/wiki/Change-Log). Please follow the [**installation guide**](https://ihhub.github.io/fheroes2/INSTALL.html) to download and install fheroes2., ---------------------------------------------------------------------------------------- openmohaa.mk a3662d01badf81856948a377446615609861e341 # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------- Use a debug print rather than an error drop when the reference count for an area is negative (#755), ----------------------------------------------------- warehouse.mk 2.1.0 # Version: Commits on Jun 10, 2025 ----------------------------------------------------- Remove mime tags from appstream, ----------------------------------------------------------------------------------------- winetricks.mk 9279fc0acdb7501a68258fe2da8424774e79b860 # Version: Commits on Jun 11, 2025 ----------------------------------------------------------------------------------------- busybox: update to FRP-5579-g5749feb3, ---------------------------------------------------------------------------------------- retroarch.mk aebfff21662da81dcd74573dc6b004457fc62299 # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------- apple: better mfi controller disconnect handling, ---------------------------------------------------------------------------------------- doomretro.mk 1795a80c56751515507d16af4db68c253516644d # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------- Further work on `play` CCMD, ------------------------------------------------------------------------------------- gzdoom.mk 11809748a13ae088395e59c763b0f9114a4585a0 # Version: Commits on Jun 11, 2025 ------------------------------------------------------------------------------------- Fixed outdated example in config file Config file said to use 'doom.doom2.Autoload' and 'doom.doom2.commercial.Autoload', which do not seem to work anymore. Replaced with 'doom.id.doom2.Autoload' and 'doom.id.doom2.commercial.Autoload', respectively., ----------------------------------------------------------------------------------- tr1x.mk 9d582d30143663e01c3bb0e9871b0165b5b14152 # Version: Commits on Jun 10, 2025 ----------------------------------------------------------------------------------- lara/col/swim: add water exit fix option This makes TR2's water exit constraint - whereby Lara can't exit horizontally or below - optional in both games. In addition the setting will control whether or not Lara can exit water onto a slope. Resolves #3154., ----------------------------------------------------------------------------------- tr2x.mk 9d582d30143663e01c3bb0e9871b0165b5b14152 # Version: Commits on Jun 10, 2025 ----------------------------------------------------------------------------------- lara/col/swim: add water exit fix option This makes TR2's water exit constraint - whereby Lara can't exit horizontally or below - optional in both games. In addition the setting will control whether or not Lara can exit water onto a slope. Resolves #3154., --------------------------------------------------------------------------------------------------- libretro-dosbox-pure.mk 1a86ae47a58fca1fa8c5f5e4bd2ff98dfdb91b8e # Version: Commits on Jun 11, 2025 --------------------------------------------------------------------------------------------------- Add more options to the 'Force Output FPS' core option that can be used to enable frame skipping (#616), ---------------------------------------------------------------------------------------------- libretro-ppsspp.mk d5cf9c97ca79c558268abd7b331238b33c35ed0f # Version: Commits on Jun 11, 2025 ---------------------------------------------------------------------------------------------- Merge pull request #20506 from crashGG/mmpx-enhace Fixed luma calculation in MMPX, ----------------------------------------------------------------------------------------------- libretro-scummvm.mk fdcbc279765e432cbabf19264273f4a87f61fc11 # Version: Commits on Jun 10, 2025 ----------------------------------------------------------------------------------------------- SCUMM: Use correct save slot when loading during a SMUSH video This only affected the original load dialogs., --------------------------------------------------------------------------------------------- libretro-vba-m.mk 74528ccb30f69c6b29d24072863e31bcaa15e549 # Version: Commits on Jun 11, 2025 --------------------------------------------------------------------------------------------- Switch to SDL3 3.2.16, --------------------------------------------------------------------------------------------- libretro-wasm4.mk 2bf43ca3129328daf0028a9659075692908685c9 # Version: Commits on Jun 11, 2025 --------------------------------------------------------------------------------------------- Merge pull request #809 from sulewicz/sulewicz/tank-wars tank-wars,
Continued from #19532 .
DisplayObject stores
Option<PerspectiveProjection>throughTransformso we can removeHAS_PERSPECTIVE_PROJECTION_STUBflag from display objects.The test
from_shumway/avm2/flash/geom/perspectiveprojectionpasses now.Limitation
PerspectiveProjection is stored in Transform, but it's not used in rendering at all. (Hence, we cannot remove
stub_setters)