ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.62k stars 809 forks source link

fixed render resolution - especially for web-selfhosted #8921

Open Benman2785 opened 1 year ago

Benman2785 commented 1 year ago

Hi,

i use ruffle web-selfhosted (on nginx).

what i REALLY need is a toggleable feature to manually set render resolution.

for example: the game Sierra-7.swf link to file has the issue that when calling the swf via: embed src="swf/sierra-7.swf" height=100%-10px; width=100%-10px; scale="exactfit"; to fit the screen then it doesnt stretch the actual game but renders a black and gray border around the game. you cant really compensate this with using embed src="swf/sierra-7.swf" height="340"; width="750"; scale="exactfit"; - as here the fullscreen doesnt work (its same behaviour as 100% width/height)

so i need to FORCE ruffle to render the game in 750x340 and then use my browser to strech it

i know that there is player.style.width = "600px"; and player.style.height = "400px"; - but i dont know how to use them. ;)

EDIT: removed flashvars (that dont do anything)

Benman2785 commented 1 year ago

image here you see what i mean

Benman2785 commented 1 year ago

ok - in a super-amateur-way i got the Sierra-7.swf to work fine with 100% widht/height - all i had to do was looking into the swf to find out the devs of that game used: "ScaleMode"="noScale" // after changing those 3 values to "exactfit" it works fine now.

YET my problem is still solid - as a fixed render resolution that is resized by the browser can greatly benefit performance ;)

Benman2785 commented 1 year ago

to test it yourself: Play modded Game link to swf

n0samu commented 1 year ago

I think what's really needed is #5186.

Anyway, I just want to point out that those flashvars don't do anything. And height=100%-10px; is incorrect syntax so that doesn't work - you would have to use CSS calc to do things like that.

Benman2785 commented 1 year ago

a good scaling option is also beneficial - as it would allow many games to be played better ;)

EDIT: strange behaviour when "reload with cache disabled" // sry for mixing forks

Benman2785 commented 1 year ago

EDIT: it only happens in https://github.com/Dinnerbone/ruffle/tree/blend // sry for confusion https://youtu.be/DuI-bYpdWuE // as you can see: the game now is rendered in lower resolution and game runs better

n0samu commented 1 year ago

the game runs in 800x420 and gets resized by browser... - this results in very good performance

No, Ruffle does not do that

Benman2785 commented 1 year ago

EDIT: it only happens in https://github.com/Dinnerbone/ruffle/tree/blend // sry for confusion

so then its browser related. in that video you can see that the A in LAST is more blocky (also posted png of that behaviour on discord yesterday) - so i assume its lower resolution or no antialiasing.

here the pngs:

result of "reload with cache disabled" AA_dinnerbone org png

result of "normal F5" AA_on_dinnerbone org png