move gammacorrect, renderers, and excluderenderers love.conf options to a new t.graphics table.

This commit is contained in:
Sasha Szpakowski
2024-12-20 20:40:53 -04:00
parent 8ca321b7d3
commit b61b35d5fb
3 changed files with 33 additions and 12 deletions
+30 -9
View File
@@ -181,6 +181,11 @@ function love.init()
centered = true,
usedpiscale = true,
},
graphics = {
gammacorrect = false,
renderers = nil,
excluderenderers = nil,
},
modules = {
data = true,
event = true,
@@ -210,10 +215,10 @@ function love.init()
identity = false,
appendidentity = false,
externalstorage = false, -- Only relevant for Android.
gammacorrect = false,
gammacorrect = nil, -- Moved to t.graphics.
highdpi = false,
renderers = nil,
excluderenderers = nil,
renderers = nil, -- Moved to t.graphics.
excluderenderers = nil, -- Moved to t.graphics.
}
-- Console hack, part 1.
@@ -243,18 +248,26 @@ function love.init()
end
if love._setGammaCorrect then
local gammacorrect = false
if type(c.graphics) == "table" then
gammacorrect = c.graphics.gammacorrect
end
if c.gammacorrect ~= nil then
love.markDeprecated(2, "t.gammacorrect in love.conf", "field", "replaced", "t.graphics.gammacorrect")
gammacorrect = c.gammacorrect
end
love._setGammaCorrect(c.gammacorrect)
end
if love._setRenderers then
local renderers = love._getDefaultRenderers()
if type(c.renderers) == "table" then
renderers = {}
for i,v in ipairs(c.renderers) do
renderers[i] = v
end
love.markDeprecated(2, "t.renderers in love.conf", "field", "replaced", "t.graphics.renderers")
renderers = c.renderers
end
if type(c.graphics) == "table" and type(c.graphics.renderers) == "table" then
renderers = c.graphics.renderers
end
if love.arg.options.renderers.set then
local renderersstr = love.arg.options.renderers.arg[1]
renderers = {}
@@ -262,7 +275,15 @@ function love.init()
table.insert(renderers, r)
end
end
local excluderenderers = c.excluderenderers
local excluderenderers = nil
if type(c.excluderenderers) == "table" then
love.markDeprecated(2, "t.excluderenderers in love.conf", "field", "replaced", "t.graphics.excluderenderers")
excluderenderers = c.excluderenderers
end
if type(c.graphics) == "table" and type(c.graphics.excluderenderers) == "table" then
excluderenderers = c.graphics.excluderenderers
end
if love.arg.options.excluderenderers.set then
local excludestr = love.arg.options.excluderenderers.arg[1]
excluderenderers = {}
+1 -1
View File
@@ -3271,7 +3271,7 @@ function love.nogame()
function love.conf(t)
t.title = "L\195\150VE " .. love._version .. " (" .. love._version_codename .. ")"
t.gammacorrect = true
t.graphics.gammacorrect = true
t.modules.audio = false
t.modules.sound = false
t.modules.joystick = false
+2 -2
View File
@@ -12107,8 +12107,8 @@ const unsigned char nogame_lua[] =
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x20, 0x28, 0x22, 0x20, 0x2e, 0x2e,
0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64,
0x65, 0x6e, 0x61, 0x6d, 0x65, 0x20, 0x2e, 0x2e, 0x20, 0x22, 0x29, 0x22, 0x0a,
0x09, 0x09, 0x74, 0x2e, 0x67, 0x61, 0x6d, 0x6d, 0x61, 0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x20, 0x3d,
0x20, 0x74, 0x72, 0x75, 0x65, 0x0a,
0x09, 0x09, 0x74, 0x2e, 0x67, 0x72, 0x61, 0x70, 0x68, 0x69, 0x63, 0x73, 0x2e, 0x67, 0x61, 0x6d, 0x6d, 0x61,
0x63, 0x6f, 0x72, 0x72, 0x65, 0x63, 0x74, 0x20, 0x3d, 0x20, 0x74, 0x72, 0x75, 0x65, 0x0a,
0x09, 0x09, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x61, 0x75, 0x64, 0x69, 0x6f, 0x20,
0x3d, 0x20, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x0a,
0x09, 0x09, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x73, 0x2e, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x20,