From 973055c1f54d834bbe7868b06d1c9cca64501edc Mon Sep 17 00:00:00 2001 From: vittorioromeo Date: Mon, 24 Apr 2023 01:42:53 +0200 Subject: [PATCH] Implement 'getFullscreenModes' more concisely --- src/SFML/Window/Android/VideoModeImpl.cpp | 7 ++----- src/SFML/Window/iOS/VideoModeImpl.mm | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/SFML/Window/Android/VideoModeImpl.cpp b/src/SFML/Window/Android/VideoModeImpl.cpp index 1828f463..b66ab10f 100644 --- a/src/SFML/Window/Android/VideoModeImpl.cpp +++ b/src/SFML/Window/Android/VideoModeImpl.cpp @@ -37,13 +37,10 @@ namespace sf::priv //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() { - VideoMode desktop = getDesktopMode(); + const VideoMode desktop = getDesktopMode(); // Return both portrait and landscape resolutions - std::vector modes; - modes.push_back(desktop); - modes.emplace_back(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel); - return modes; + return {desktop, VideoMode(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel)}; } diff --git a/src/SFML/Window/iOS/VideoModeImpl.mm b/src/SFML/Window/iOS/VideoModeImpl.mm index 58d9bba7..4bff95bc 100644 --- a/src/SFML/Window/iOS/VideoModeImpl.mm +++ b/src/SFML/Window/iOS/VideoModeImpl.mm @@ -35,13 +35,10 @@ namespace sf::priv //////////////////////////////////////////////////////////// std::vector VideoModeImpl::getFullscreenModes() { - VideoMode desktop = getDesktopMode(); + const VideoMode desktop = getDesktopMode(); // Return both portrait and landscape resolutions - std::vector modes; - modes.push_back(desktop); - modes.emplace_back(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel); - return modes; + return {desktop, VideoMode(Vector2u(desktop.size.y, desktop.size.x), desktop.bitsPerPixel)}; }