lazydevyo / PSVitaPlay

A Streaming app which let's you plug and play your PSVita to your PC without hassle.
100 stars 11 forks source link

Add option for correct Aspect Ratio #11

Open MyFilippo94 opened 5 years ago

MyFilippo94 commented 5 years ago

I have a 21:9 screen and a 16:10 one, the app is unable to display the correct screen ratio in either of these screens, with fullscreen enabled. Please add an option to choose between stretch and keep ratio, it's really needed to enjoy this application in fullscreen.

I saw a reported issue that was describing the same problem, it's marked as closed. It isn't fixed unfortunately.

Maybe a quick solution might be, the file https://github.com/lazydevyo/PSVitaDock/blob/master/Assets/Script/VitaCaptureU.cs, to add at line 208 some code like this, to get as a result a forced correct aspect ratio:

float PSVratio = 960f/544f
bool isWider = (ResScreen_w/ResScreen_h >= PSVratio);
float tempres_w = 0f;
float tempres_h = 0f;
if (isWider) {
    tempres_w = ResScreen_h*PSVratio;
    tempres_h = ResScreen_h;
} else {
    tempres_w = ResScreen_w;
    tempres_h = ResScreen_w*(1/PSVratio);
}

This assumes that the fullscreen mode is Borderless Window, and probably it'd work even if the resolution is not in the driver's database.

I have not the possibility to install Unity now and look at your source code to provide a better patch unfortunately, probably it'd be better just to force to aspect ratio the rendered texture itself, but that's the best I can suggest for now.