From: John Tsiombikas Date: Tue, 7 Dec 2021 06:44:17 +0000 (+0200) Subject: resolution commandline argument X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dos_imgv;a=commitdiff_plain;h=773592751bbdef2f304725b24f620f89c9d4a5eb resolution commandline argument --- diff --git a/src/main.c b/src/main.c index e7d464b..9367eca 100644 --- a/src/main.c +++ b/src/main.c @@ -30,6 +30,7 @@ static struct video_mode *vmlist; static int vmlist_size, cur_vm = -1; static void *backbuf; +static int opt_width, opt_height; static int opt_bpp = 16; static const char *opt_fname; @@ -100,7 +101,11 @@ int main(int argc, char **argv) init_mouse(); - modeidx = find_best_mode(img.width, img.height); + if(!opt_width) { + opt_width = img.width; + opt_height = img.height; + } + modeidx = find_best_mode(opt_width, opt_height); if(switch_mode(modeidx) == -1) { goto end; } @@ -339,12 +344,19 @@ int parse_args(int argc, char **argv) int i; static const char *usage_fmt = "Usage: %s [options] \n" "Options:\n" + " -s : choose screen resolution if available\n" " -bpp : video mode color depth (8, 15, 16, 24, 32)\n" " -h,-help: print usage information and exit\n"; for(i=1; i