mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-12-01 08:31:45 +00:00
GL aspect ratio adjustments
This commit is contained in:
parent
7070bded77
commit
7bdbaaff22
2 changed files with 4 additions and 10 deletions
|
@ -120,7 +120,7 @@ angle_t FGLRenderer::FrustumAngle()
|
||||||
|
|
||||||
// ok, this is a gross hack that barely works...
|
// ok, this is a gross hack that barely works...
|
||||||
// but at least it doesn't overestimate too much...
|
// but at least it doesn't overestimate too much...
|
||||||
double floatangle=2.0+(45.0+((tilt/1.9)))*mCurrentFoV*48.0/BaseRatioSizes[WidescreenRatio][3]/90.0;
|
double floatangle=2.0+(45.0+((tilt/1.9)))*mCurrentFoV*48.0/AspectMultiplier(WidescreenRatio)/90.0;
|
||||||
angle_t a1 = DAngle(floatangle).BAMs();
|
angle_t a1 = DAngle(floatangle).BAMs();
|
||||||
if (a1>=ANGLE_180) return 0xffffffff;
|
if (a1>=ANGLE_180) return 0xffffffff;
|
||||||
return a1;
|
return a1;
|
||||||
|
@ -917,14 +917,10 @@ void FGLRenderer::RenderView (player_t* player)
|
||||||
NoInterpolateView = saved_niv;
|
NoInterpolateView = saved_niv;
|
||||||
|
|
||||||
|
|
||||||
// I stopped using BaseRatioSizes here because the information there wasn't well presented.
|
|
||||||
// 4:3 16:9 16:10 17:10 5:4
|
|
||||||
static float ratios[]={1.333333f, 1.777777f, 1.6f, 1.7f, 1.25f, 1.7f, 2.333333f};
|
|
||||||
|
|
||||||
// now render the main view
|
// now render the main view
|
||||||
float fovratio;
|
float fovratio;
|
||||||
float ratio = ratios[WidescreenRatio];
|
float ratio = WidescreenRatio;
|
||||||
if (! Is54Aspect(WidescreenRatio))
|
if (WidescreenRatio >= 1.3f)
|
||||||
{
|
{
|
||||||
fovratio = 1.333333f;
|
fovratio = 1.333333f;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,8 +81,6 @@ void FGLRenderer::DrawPSprite (player_t * player,DPSprite *psp, float sx, float
|
||||||
float scale;
|
float scale;
|
||||||
float scalex;
|
float scalex;
|
||||||
float ftexturemid;
|
float ftexturemid;
|
||||||
// 4:3 16:9 16:10 17:10 5:4 17:10 21:9
|
|
||||||
static float xratio[] = {1.f, 3.f/4, 5.f/6, 40.f/51, 1.f, 40.f/51, 4.f/7};
|
|
||||||
|
|
||||||
// [BB] In the HUD model step we just render the model and break out.
|
// [BB] In the HUD model step we just render the model and break out.
|
||||||
if ( hudModelStep )
|
if ( hudModelStep )
|
||||||
|
@ -108,7 +106,7 @@ void FGLRenderer::DrawPSprite (player_t * player,DPSprite *psp, float sx, float
|
||||||
tex->GetSpriteRect(&r);
|
tex->GetSpriteRect(&r);
|
||||||
|
|
||||||
// calculate edges of the shape
|
// calculate edges of the shape
|
||||||
scalex = xratio[WidescreenRatio] * vw / 320;
|
scalex = (320.0f / (240.0f * WidescreenRatio)) * vw / 320;
|
||||||
|
|
||||||
tx = sx - (160 - r.left);
|
tx = sx - (160 - r.left);
|
||||||
x1 = tx * scalex + vw/2;
|
x1 = tx * scalex + vw/2;
|
||||||
|
|
Loading…
Reference in a new issue