[Add] Change dimensions from commandline.
This commit is contained in:
parent
0815682bfc
commit
54cd8f90a1
12
src/conf.c
12
src/conf.c
@ -63,6 +63,8 @@ static void print_usage(char** argv) {
|
|||||||
LOG(" -f, --fullscreen - Fullscreen");
|
LOG(" -f, --fullscreen - Fullscreen");
|
||||||
LOG(" -F, --fps - Limit frames per second");
|
LOG(" -F, --fps - Limit frames per second");
|
||||||
LOG(" -d s, --data s - Set the data file to be s");
|
LOG(" -d s, --data s - Set the data file to be s");
|
||||||
|
LOG(" -x n - Set width to n");
|
||||||
|
LOG(" -y n - Set height to n");
|
||||||
LOG(" -j n, --joystick n - Use joystick (n)");
|
LOG(" -j n, --joystick n - Use joystick (n)");
|
||||||
LOG(" -J s, --joystick s - Use joystick whose name contains (s)");
|
LOG(" -J s, --joystick s - Use joystick whose name contains (s)");
|
||||||
LOG(" -S, --Sound - Forces sound.");
|
LOG(" -S, --Sound - Forces sound.");
|
||||||
@ -208,6 +210,8 @@ void conf_parseCLI(int argc, char** argv) {
|
|||||||
{ "data", required_argument, 0, 'd' },
|
{ "data", required_argument, 0, 'd' },
|
||||||
{ "joystick", required_argument, 0, 'j' },
|
{ "joystick", required_argument, 0, 'j' },
|
||||||
{ "Joystick", required_argument, 0, 'J' },
|
{ "Joystick", required_argument, 0, 'J' },
|
||||||
|
{ "width", required_argument, 0, 'W' },
|
||||||
|
{ "width", required_argument, 0, 'H' },
|
||||||
{ "sound", no_argument, 0, 'S' },
|
{ "sound", no_argument, 0, 'S' },
|
||||||
{ "mvol", required_argument, 0, 'm' },
|
{ "mvol", required_argument, 0, 'm' },
|
||||||
{ "svol", required_argument, 0, 's' },
|
{ "svol", required_argument, 0, 's' },
|
||||||
@ -218,7 +222,7 @@ void conf_parseCLI(int argc, char** argv) {
|
|||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
|
|
||||||
while((c = getopt_long(argc, argv, "fF:d:J:MSm:s:hv",
|
while((c = getopt_long(argc, argv, "fF:d:j:J:W:H:MSm:s:hv",
|
||||||
long_options, &option_index)) != -1) {
|
long_options, &option_index)) != -1) {
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'f':
|
case 'f':
|
||||||
@ -236,6 +240,12 @@ void conf_parseCLI(int argc, char** argv) {
|
|||||||
case 'J':
|
case 'J':
|
||||||
namjoystick = strdup(optarg);
|
namjoystick = strdup(optarg);
|
||||||
break;
|
break;
|
||||||
|
case 'W':
|
||||||
|
gl_screen.w = atoi(optarg);
|
||||||
|
break;
|
||||||
|
case 'H':
|
||||||
|
gl_screen.h = atoi(optarg);
|
||||||
|
break;
|
||||||
case 'M':
|
case 'M':
|
||||||
nosound = 1;
|
nosound = 1;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user