Skip to content

Commit 12f0c5f

Browse files
committed
Sort resolutions descending ignoring aspect ratio
Closes #1542
1 parent 08cfc38 commit 12f0c5f

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

libs/s25main/desktops/dskOptions.cpp

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -664,25 +664,10 @@ void dskOptions::Msg_MsgBoxResult(const unsigned msgbox_id, const MsgboxResult /
664664

665665
static bool cmpVideoModes(const VideoMode& left, const VideoMode& right)
666666
{
667-
if(left == right)
668-
return false;
669-
VideoMode leftRatio = getAspectRatio(left);
670-
VideoMode rightRatio = getAspectRatio(right);
671-
// Cmp ratios descending (so 16:9 is above 4:3 as wider ones are more commonly used)
672-
if(leftRatio.width == rightRatio.width)
673-
{
674-
if(leftRatio.height == rightRatio.height)
675-
{
676-
// Same ratios -> cmp width/height
677-
if(left.width == right.width)
678-
return left.height < right.height;
679-
else
680-
return left.width < right.width;
681-
682-
} else
683-
return leftRatio.height > rightRatio.height;
684-
} else
685-
return leftRatio.width > rightRatio.width;
667+
if(left.width == right.width)
668+
return left.height > right.height;
669+
else
670+
return left.width > right.width;
686671
}
687672

688673
void dskOptions::loadVideoModes()

0 commit comments

Comments
 (0)