-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunch
75 lines (72 loc) · 2.06 KB
/
launch
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
-----------------------------------
-- VeritaLib builder launch file --
-----------------------------------
local run_main = true
local compile_vlib = false
local run_tests = false
local out_folder = "build/src"
local config_file = "vlib_conf.lua"
for i, arg in ipairs(lstg.args) do
if arg == "--compile-vlib" then
compile_vlib = true
end
if arg == "--run-tests" then
compile_vlib = true
run_tests = true
run_main = false
out_folder = "test/src"
config_file = "test/vlib_conf.lua"
end
if arg == "--no-run" then
run_main = false
end
end
if compile_vlib then
local build = lstg.DoFile("build_vlib.lua")
build.preprocessAll("src", out_folder, config_file)
end
if run_tests or run_main then
local config_file = io.open("config.json", "r")
if config_file then
local config_json = config_file:read("*a")
local config = cjson.decode(config_json)
config_file:close()
lstg.SetWindowed(config.windowed)
lstg.SetVsync(config.vsync)
if config.windowed then
lstg.SetResolution(
config.window_size.width,
config.window_size.height,
config.refresh_rate_numerator,
config.refresh_rate_denominator
)
else
lstg.SetResolution(
config.fullscreen_resolution.width,
config.fullscreen_resolution.height,
config.refresh_rate_numerator,
config.refresh_rate_denominator
)
end
if config.gpu ~= "" then
lstg.SetPreferenceGPU(config.gpu, config.dgpu_trick)
end
end
if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
local lua_path = os.getenv("LUA_PATH")
if lua_path then
package.path = package.path .. ";" .. lua_path
require("lldebugger").start()
end
end
else
function FrameFunc()
return true
end
end
if run_tests then
lfs.chdir("test/")
end
if run_main then
lfs.chdir("build/")
end