From 94d39cafb131bc591285fa9695e8598e47c8c1e0 Mon Sep 17 00:00:00 2001 From: mat ess Date: Sun, 11 Sep 2022 00:38:08 -0400 Subject: [PATCH] Reorganize some config --- ants/conf.lua | 4 ++++ ants/main.lua | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 ants/conf.lua diff --git a/ants/conf.lua b/ants/conf.lua new file mode 100644 index 0000000..5b1e8fc --- /dev/null +++ b/ants/conf.lua @@ -0,0 +1,4 @@ +function love.conf(t) + t.window.highdpi = false + t.window.title = "ants" +end diff --git a/ants/main.lua b/ants/main.lua index 8276ad4..2b4b4f0 100644 --- a/ants/main.lua +++ b/ants/main.lua @@ -41,8 +41,8 @@ local function initColors(rules) end end -local function initScreen(width, height) - love.window.setMode(width, height, { highdpi = true }) +local function initScreen() + local width, height = love.graphics.getDimensions() WIDTH, HEIGHT = round2even(width), round2even(height) CANVAS = love.graphics.newCanvas(WIDTH, HEIGHT) CANVAS:renderTo(function() @@ -79,11 +79,9 @@ local function initGrid() end function love.load(args) - local width = args[1] or 800 - local height = args[2] or 600 - local rules = args[3] or "RL" + local rules = args[1] or "RL" initColors(rules) - initScreen(width, height) + initScreen() initAnt() initGrid() end