-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.lua
144 lines (117 loc) · 3.77 KB
/
conf.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
io.stdout:setvbuf("no")
DEBUG = false
SERVER = false
DEDICATED = false
CLIENT = true
ARGUMENTS = {}
argv = {}
for _, v in ipairs(arg) do
argv[v] = true
end
if argv["-debug"] then
DEBUG = true
end
if argv["-server"] then
SERVER = true
end
if argv["-dedicated"] then
CLIENT = false
SERVER = true
DEDICATED = true
end
function love.conf(t)
t.title = "Engine"
t.version = "11.3"
t.modules.audio = not DEDICATED
t.modules.event = true
t.modules.graphics = not DEDICATED
t.modules.image = not DEDICATED
t.modules.joystick = not DEDICATED
t.modules.keyboard = true
t.modules.math = true
t.modules.mouse = true
t.modules.physics = true
t.modules.sound = not DEDICATED
t.modules.system = true
t.modules.timer = true
t.modules.touch = not DEDICATED
t.modules.video = not DEDICATED
t.modules.window = not DEDICATED
t.modules.thread = true
if not DEDICATED then
--t.window.icon = "?"
require("love.system")
if love.system.getOS() == "OS X" then
--t.window.icon = "?"
end
t.audio.mic = false -- Request and use microphone capabilities in Android (boolean)
t.audio.mixwithsystem = true -- Keep background music playing when opening LOVE (boolean, iOS and Android only)
t.window.title = "engine" -- The window title (string)
t.window.icon = nil -- Filepath to an image to use as the window's icon (string)
t.window.width = 800 -- The window width (number)
t.window.height = 680 -- The window height (number)
t.window.borderless = false -- Remove all border visuals from the window (boolean)
t.window.resizable = false -- Let the window be user-resizable (boolean)
t.window.minwidth = 1 -- Minimum window width if the window is resizable (number)
t.window.minheight = 1 -- Minimum window height if the window is resizable (number)
t.window.fullscreen = false -- Enable fullscreen (boolean)
t.window.fullscreentype = "desktop" -- Choose between "desktop" fullscreen or "exclusive" fullscreen mode (string)
t.window.vsync = 0 -- Vertical sync mode (number)
t.window.msaa = 8 -- The number of samples to use with multi-sampled antialiasing (number)
t.window.depth = nil -- The number of bits per sample in the depth buffer
t.window.stencil = nil -- The number of bits per sample in the stencil buffer
t.window.display = 1 -- Index of the monitor to show the window in (number)
t.window.highdpi = true -- Enable high-dpi mode for the window on a Retina display (boolean)
t.window.usedpiscale = true -- Enable automatic DPI scaling when highdpi is set to true as well (boolean)
t.window.x = nil -- The x-coordinate of the window's position in the specified display (number)
t.window.y = nil -- The y-coordinate of the window's position in the specified display (number)
else
require("love.system")
end
require("src.modules.init")
end
love.run = function()
math.randomseed(os.time())
local t = love.timer
local g = love.graphics
if love.load then
love.load(love.arg.parseGameArguments(arg), arg)
end
t.step()
local dt = 0.0
local acc = 0.0
return function()
if love.event then
love.event.pump()
for name, a, b, c, d, e, f in love.event.poll() do
if name == 'quit' then
if not love.quit or not love.quit() then
return a or 0
end
end
love.handlers[name](a, b, c, d, e, f)
end
end
if love.timer then
dt = t.step(); acc = math.min(acc + dt, 0.333333)
end
if love.fixedupdate then
while acc >= 0.016 do
love.fixedupdate(0.016)
acc = acc - 0.016
end
end
if love.update then
love.update(dt)
end
if g and g.isActive() then
g.origin()
g.clear(g.getBackgroundColor())
if love.render then
love.render()
end
g.present()
end
t.sleep(0.001)
end
end