-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nogame bundle; CMake zips and concats nogame;
- Loading branch information
1 parent
daea902
commit c969d43
Showing
6 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
function lovr.arg(arg) | ||
local options = { | ||
_help = { short = '-h', long = '--help', help = 'Show help and exit' }, | ||
_version = { short = '-v', long = '--version', help = 'Show version and exit' }, | ||
debug = { long = '--debug', help = 'Enable debugging checks and logging' } | ||
} | ||
|
||
local shift | ||
|
||
for i, argument in ipairs(arg) do | ||
if argument:match('^%-') then | ||
for name, option in pairs(options) do | ||
if argument == option.short or argument == option.long then | ||
arg[name] = true | ||
break | ||
end | ||
end | ||
else | ||
shift = i | ||
break | ||
end | ||
end | ||
|
||
shift = shift or (#arg + 1) | ||
|
||
for i = 0, #arg do | ||
arg[i - shift], arg[i] = arg[i], nil | ||
end | ||
|
||
if arg._help then | ||
local message = {} | ||
|
||
local list = {} | ||
for name, option in pairs(options) do | ||
option.name = name | ||
table.insert(list, option) | ||
end | ||
|
||
table.sort(list, function(a, b) return a.name < b.name end) | ||
|
||
for i, option in ipairs(list) do | ||
if option.short and option.long then | ||
table.insert(message, (' %s, %s\t\t%s'):format(option.short, option.long, option.help)) | ||
else | ||
table.insert(message, (' %s\t\t%s'):format(option.long or option.short, option.help)) | ||
end | ||
end | ||
|
||
table.insert(message, 1, 'usage: lovr [options] [<source>]\n') | ||
table.insert(message, 2, 'options:') | ||
table.insert(message, '\n<source> can be a Lua file, a folder, or a zip archive') | ||
print(table.concat(message, '\n')) | ||
os.exit(0) | ||
end | ||
|
||
if arg._version then | ||
print(('LOVR %d.%d.%d'):format(lovr.getVersion())) | ||
os.exit(0) | ||
end | ||
|
||
return function(conf) | ||
if arg.debug then | ||
conf.graphics.debug = true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function lovr.conf(t) | ||
t.headset.supersample = true | ||
t.modules.audio = false | ||
t.modules.physics = false | ||
t.modules.thread = false | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters