summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <nthirtyone@gmail.com>2017-08-01 02:34:36 +0200
committerAki <nthirtyone@gmail.com>2017-08-01 02:34:36 +0200
commitb5a35c0300d9a3c4b97836a313cc17815f1db75c (patch)
tree5bf47bb2455a45432a097b9053a96ddae5e040ce
parent9aa820bf100845da2024bf3af9e802c90b3a6b51 (diff)
downloadroflnauts-b5a35c0300d9a3c4b97836a313cc17815f1db75c.zip
roflnauts-b5a35c0300d9a3c4b97836a313cc17815f1db75c.tar.gz
roflnauts-b5a35c0300d9a3c4b97836a313cc17815f1db75c.tar.bz2
displayLoads now correctly handles fullscreen or windowed modes
-rw-r--r--not/Settings.lua18
1 files 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 ()