From b5a35c0300d9a3c4b97836a313cc17815f1db75c Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 1 Aug 2017 02:34:36 +0200 Subject: displayLoads now correctly handles fullscreen or windowed modes --- not/Settings.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/not/Settings.lua b/not/Settings.lua index f2919ea..358aa79 100644 --- a/not/Settings.lua +++ b/not/Settings.lua @@ -48,9 +48,21 @@ local function controllerLoad () end local function displayLoad () - local width, height = 320, 180 - love.window.setFullscreen(false) - love.window.setMode(width*2, height*2) + local width, height, flags = love.window.getMode() + if Settings.current.display == "fullscreen" then + if not flags.fullscreen then + love.window.setFullscreen(true, "desktop") + end + else + local scale = tonumber(Settings.current.display) or 1 + local expectedWidth, expectedHeight = 320 * scale, 180 * scale + if flags.fullscreen then + love.window.setFullscreen(false) + end + if width ~= expectedWidth or height ~= expectedHeight then + love.window.setMode(expectedWidth, expectedHeight) + end + end end function Settings.load () -- cgit v1.1