mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- add 'vid_showcurrentscaling' ccmd, expanded output for 'vid_scaletowidth' and 'vid_scaletoheight' commands
- made the vid_scaleto____ commands less hacky - after finding out I could route the calls through screen->, found the correct screen-> commands, and do scaling based on the real screen dimensions
This commit is contained in:
parent
1656bbf9ec
commit
f2e6ca4ced
1 changed files with 9 additions and 2 deletions
|
@ -102,7 +102,9 @@ bool ViewportIsScaled43()
|
||||||
|
|
||||||
void R_ShowCurrentScaling()
|
void R_ShowCurrentScaling()
|
||||||
{
|
{
|
||||||
|
int x1 = screen->GetClientWidth(), y1 = screen->GetClientHeight(), x2 = x1 * vid_scalefactor, y2 = y1 * vid_scalefactor;
|
||||||
Printf("Current Scale: %f\n", (float)(vid_scalefactor));
|
Printf("Current Scale: %f\n", (float)(vid_scalefactor));
|
||||||
|
Printf("Real resolution: %i x %i\nEmulated resolution: %i x %i\n", x1, y1, x2, y2);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool R_CalcsShouldBeBlocked()
|
bool R_CalcsShouldBeBlocked()
|
||||||
|
@ -115,13 +117,18 @@ bool R_CalcsShouldBeBlocked()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CCMD (vid_showcurrentscaling)
|
||||||
|
{
|
||||||
|
R_ShowCurrentScaling();
|
||||||
|
}
|
||||||
|
|
||||||
CCMD (vid_scaletowidth)
|
CCMD (vid_scaletowidth)
|
||||||
{
|
{
|
||||||
if (R_CalcsShouldBeBlocked())
|
if (R_CalcsShouldBeBlocked())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (argv.argc() > 1)
|
if (argv.argc() > 1)
|
||||||
vid_scalefactor = (float)((double)vid_scalefactor * (double)atof(argv[1]) / (double)DisplayWidth);
|
vid_scalefactor = (float)((double)atof(argv[1]) / screen->GetClientWidth());
|
||||||
|
|
||||||
R_ShowCurrentScaling();
|
R_ShowCurrentScaling();
|
||||||
}
|
}
|
||||||
|
@ -132,7 +139,7 @@ CCMD (vid_scaletoheight)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (argv.argc() > 1)
|
if (argv.argc() > 1)
|
||||||
vid_scalefactor = (float)((double)vid_scalefactor * (double)atof(argv[1]) / (double)DisplayHeight);
|
vid_scalefactor = (float)((double)atof(argv[1]) / screen->GetClientHeight());
|
||||||
|
|
||||||
R_ShowCurrentScaling();
|
R_ShowCurrentScaling();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue