mirror of
https://github.com/SashLilac/cambridge.git
synced 2024-11-21 18:59:02 -06:00
Re-add clamp for backgrounds beyond the limit
This commit is contained in:
parent
6fb583e463
commit
50410958f0
@ -8,7 +8,7 @@ image_formats = {".png", ".jpg"}
|
|||||||
bgpath = "res/backgrounds/"
|
bgpath = "res/backgrounds/"
|
||||||
dir = love.filesystem.getDirectoryItems(bgpath)
|
dir = love.filesystem.getDirectoryItems(bgpath)
|
||||||
|
|
||||||
local backgrounds = {}
|
backgrounds = {}
|
||||||
|
|
||||||
local function loadExtendedBgs()
|
local function loadExtendedBgs()
|
||||||
extended_bgs = require("res.backgrounds.extend_section_bg")
|
extended_bgs = require("res.backgrounds.extend_section_bg")
|
||||||
|
@ -980,7 +980,7 @@ end
|
|||||||
|
|
||||||
function GameMode:drawBackground()
|
function GameMode:drawBackground()
|
||||||
local id = self:getBackground()
|
local id = self:getBackground()
|
||||||
-- if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
|
if type(id) == "number" then id = clamp(id, 0, #backgrounds) end
|
||||||
love.graphics.setColor(1, 1, 1, 1)
|
love.graphics.setColor(1, 1, 1, 1)
|
||||||
drawBackground(id)
|
drawBackground(id)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user