Aspect ratio handling

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Aspect ratio handling

Re: Aspect ratio handling

by Graf Zahl » Mon Sep 12, 2016 12:39 pm

Added, although I only superficially reviewed it. This needs to get some exposure to find problems that might lurk in here somewhere.
Please note that this cannot be merged with GZDoom unless a companion PR is ready.

Re: Aspect ratio handling

by dpJudas » Mon Sep 12, 2016 10:45 am

Ah yes, that might be. When I saw intellisense indicate it was a template I thought it was one of zdoom's own. Committed the change to fabs instead.

Re: Aspect ratio handling

by Graf Zahl » Mon Sep 12, 2016 10:26 am

This PR uses 'abs' with floating point values in the SBARINFO code. Does this work? Or would it be better to use 'fabs' here?


I remember having seen bug reports about this. If I understand this correctly, 'abs' for floats in the global namespace may not exist for all platforms. I believe only 'fabs' and 'std::abs' do.

Aspect ratio handling

by dpJudas » Mon Sep 12, 2016 8:18 am

Pull request: https://github.com/rheit/zdoom/pull/798

This PR adds new functions for dealing with aspect ratio as floats instead of the enum returned by CheckRatio and replaces the BaseRatioSizes table with calculated sizes for any ratio. This allows the software renderer to use any aspect ratio.

Last, but not least, the windowed mode automatically uses the aspect ratio of the window. As illustrated by this 3544x1360 (2.6 ratio) window:
Image

Top