mirror of
https://github.com/love2d/love.git
synced 2026-08-14 10:13:46 +02:00
Reverted module selection feature. This is not really desired.
Users (or lovers) do not get to choose which implementation of a module they would like to use. The abstraction is for dealing with portability issues, not for giving people the ability to choose an alternative (inferior) backend. The best choice for any platform/situation should at all times be the *default* for that platform/situation. If this is not the case; it's a bug (that is easily fixed). Any module should provide the functionality promised in the docs. The lover (or user) should not care how, and if [s]he does, [s]he does still not get to choose. Also, a related note: duplication of wrapper code is something I especially wanted to avoid when I first (or should I say ... "eventually") formed the current architecture. --HG-- branch : minor
This commit is contained in:
+2
-21
@@ -187,7 +187,7 @@ function love.boot()
|
||||
|
||||
-- This is absolutely needed.
|
||||
require("love")
|
||||
require("love.filesystem.physfs")
|
||||
require("love.filesystem")
|
||||
|
||||
love.arg.parse_options()
|
||||
|
||||
@@ -275,29 +275,10 @@ function love.init()
|
||||
c.console = true
|
||||
end
|
||||
|
||||
local defaultmodules = {
|
||||
audio = "openal",
|
||||
event = "sdl",
|
||||
filesystem = "physfs",
|
||||
font = "freetype",
|
||||
graphics = "opengl",
|
||||
image = "devil",
|
||||
joystick = "sdl",
|
||||
keyboard = "sdl",
|
||||
mouse = "sdl",
|
||||
physics = "box2d",
|
||||
sound = "lullaby",
|
||||
timer = "sdl",
|
||||
thread = "sdl"
|
||||
}
|
||||
|
||||
-- Gets desired modules.
|
||||
for k,v in pairs(c.modules) do
|
||||
if v then
|
||||
if type(v) ~= "string" then
|
||||
v = defaultmodules[k]
|
||||
end
|
||||
require((v and "love.%s.%s" or "love.%s"):format(k, v))
|
||||
require("love." .. k)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user