Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avm2: Implement Matrix3D with 2D support only #18888

Merged

Conversation

cookie-s
Copy link
Contributor

@cookie-s cookie-s commented Dec 7, 2024

Retry #18810 .
Partially resolves #8033 .

#18810 (comment)

To be merged again, it will need a test + the patch posted by me above + 2D/3D switch

Commits

@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch from 7473740 to ac547ca Compare December 7, 2024 00:35
@cookie-s cookie-s changed the title Matrix3d transformation with 2d only avm2: Implement Matrix3D with 2D support only Dec 7, 2024
@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player labels Dec 7, 2024
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This log is taken from Adobe Flash Player 32.

tests/tests/swfs/avm2/geom_transform/output.expected.png Outdated Show resolved Hide resolved
@cookie-s cookie-s marked this pull request as ready for review December 7, 2024 01:03
@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch from ac547ca to 69f6554 Compare December 10, 2024 01:37
@cookie-s
Copy link
Contributor Author

#18908 produced Git conflict with this PR and it actually implemented a kind of "2D/3D switch" inside DisplayObject. Rebased and followed its design now.

@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch 3 times, most recently from a3a3018 to 6417e5f Compare December 14, 2024 00:00
@cookie-s
Copy link
Contributor Author

cookie-s commented Dec 14, 2024

Rebased. Thanks to #18911 , this PR gets much more slim.

@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch from 796ced1 to 35413ad Compare December 21, 2024 00:35
@danielhjacobs danielhjacobs added the waiting-on-review Waiting on review from a Ruffle team member label Dec 26, 2024
@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch from 35413ad to 236c1cb Compare December 27, 2024 03:05
@cookie-s
Copy link
Contributor Author

Rebased.

@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch 2 times, most recently from f17cb03 to 019476d Compare December 28, 2024 01:38
@cookie-s cookie-s requested a review from kjarosh December 28, 2024 02:00
@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch from 019476d to af60217 Compare December 29, 2024 23:52
@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch 2 times, most recently from 84492b1 to 04ea44d Compare January 15, 2025 03:12
@cookie-s
Copy link
Contributor Author

Rebased to resolve git conflict.

.expect("rawData is not a Vector");
let raw_data: Vec<f64> = (0..16)
.map(|i| -> Result<f64, Error<'gc>> {
raw_data.get(i, activation)?.coerce_to_number(activation)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of coerce_to_number(activation), this could use as_f64()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I just fixed it at 80c77e5

@cookie-s cookie-s force-pushed the matrix3d-transformation-with-2d-only branch 2 times, most recently from a223d93 to cc432fc Compare January 18, 2025 13:40
@kjarosh kjarosh force-pushed the matrix3d-transformation-with-2d-only branch from cc432fc to 2f1a130 Compare January 18, 2025 18:30
cookie-s and others added 6 commits January 18, 2025 19:31
Replace stubs for flash.geom.Transform.matrix3D getter/setter with an
actual implementation of Matrix3D with limited support.

This implementation is just a proxy to the existing 2D matrix
implementation. Therefore transformations beyond 2D transformation works
differently from the expected result.
.matrix = A, .matrix = null, then .matrix3D has the info of the matrix A.
.matrix3D = A, .matrix3D = null, then .matrix is reset to the identity.
@kjarosh kjarosh force-pushed the matrix3d-transformation-with-2d-only branch from 2f1a130 to a21946e Compare January 18, 2025 18:31
Copy link
Member

@kjarosh kjarosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, shuffled some commits around so that tests always pass, thank you!

@kjarosh kjarosh enabled auto-merge (rebase) January 18, 2025 18:43
@kjarosh kjarosh merged commit 505b18c into ruffle-rs:master Jan 18, 2025
22 checks passed
@cookie-s cookie-s deleted the matrix3d-transformation-with-2d-only branch January 18, 2025 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) T-compat Type: Compatibility with Flash Player waiting-on-review Waiting on review from a Ruffle team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants