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

Implement BitmapData.copyPixels() #2488

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

torokati44
Copy link
Member

This adds the main content (left-scrolling foreground image) to z0r.de/7463, solving another third of #2073.
This should also help with #2240, although other missing features seem to block this from making any difference there.

I tried to test this implementation with a variety of different parameter sets, using this test script: BitmapCopyPixels.as

Which produces this image in the Adobe player:

image

There is at most 1 value of difference from this in any channel of any pixel when run in Ruffle, as shown in this exaggerated difference image:

image

These are most likely rounding errors or other slight imprecisions. I don't find these to be too big of an issue.
The output is visually exactly the same, at least to my eyes.

@Toad06
Copy link
Member

Toad06 commented Jan 14, 2021

Also fixes graphics in Super Chick Sisters, making the game playable. 👍

@torokati44
Copy link
Member Author

Now that I'm looking more closely, some subpixels might differ by more than 1. Oh well, it's still not noticeable.

@Herschel
Copy link
Member

Thanks! Accuracy could be improved later.

@Herschel Herschel merged commit a01ea70 into ruffle-rs:master Jan 14, 2021
@actinetwork
Copy link

This is a case for copyPixels() function that does not render the same result in a game.
Link to the SWF: https://files.acticdn.com/278374/2678/2678.swf
I have almost the same issue in this game too: https://files.acticdn.com/278374/2889/2889.swf

The screenshot from Flash Player:
2678-flashplayer

The screenshot from Ruffle:
2678-rufflejs

Hope this help you.

@torokati44
Copy link
Member Author

torokati44 commented Sep 28, 2021

Playing 2678.swf I see a gigantic batch of BitmapData.draw - not yet implemented warnings on startup. This is a more likely cause of the missing graphics. The bitmaps serving as source for copyPixels are probably left empty instead of being drawn upon.
See: #290, and related: #2240, #3193, #3721

And checking in Flash Player what 2889.swf is supposed to look like, it appears to be because of the missing blend mode support. See: #58, and related:#929, #3061

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants