mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 14:32:08 +00:00
Switch from abs to fabs
This commit is contained in:
parent
4e58e6626c
commit
01b1efe9ee
2 changed files with 4 additions and 4 deletions
|
@ -1949,10 +1949,10 @@ class CommandAspectRatio : public SBarInfoCommandFlowControl
|
|||
};
|
||||
|
||||
int ratio = ratioTypes[0].second;
|
||||
float distance = abs(ratioTypes[0].first - aspect);
|
||||
float distance = fabs(ratioTypes[0].first - aspect);
|
||||
for (int i = 1; ratioTypes[i].first != 0.0f; i++)
|
||||
{
|
||||
float d = abs(ratioTypes[i].first - aspect);
|
||||
float d = fabs(ratioTypes[i].first - aspect);
|
||||
if (d < distance)
|
||||
{
|
||||
ratio = ratioTypes[i].second;
|
||||
|
|
|
@ -1681,10 +1681,10 @@ int CheckRatio (int width, int height, int *trueratio)
|
|||
};
|
||||
|
||||
int ratio = ratioTypes[0].second;
|
||||
float distance = abs(ratioTypes[0].first - aspect);
|
||||
float distance = fabs(ratioTypes[0].first - aspect);
|
||||
for (int i = 1; ratioTypes[i].first != 0.0f; i++)
|
||||
{
|
||||
float d = abs(ratioTypes[i].first - aspect);
|
||||
float d = fabs(ratioTypes[i].first - aspect);
|
||||
if (d < distance)
|
||||
{
|
||||
ratio = ratioTypes[i].second;
|
||||
|
|
Loading…
Reference in a new issue