fixed -r option and made it more powerful: -f1 -r 0, -f1 -r XxYxF, -f0 -r .9x.9, -f0 -r 1000x1000

This commit is contained in:
Zeno Rogue 2021-09-18 01:55:55 +02:00
parent 3ece943c9f
commit 2377ccb434
1 changed files with 22 additions and 5 deletions

View File

@ -3057,11 +3057,28 @@ EX int read_config_args() {
else if(argis("-r")) {
PHASEFROM(2);
shift();
int clWidth=0, clHeight=0, clFont=0;
sscanf(argcs(), "%dx%dx%d", &clWidth, &clHeight, &clFont);
if(clWidth) vid.xres = clWidth;
if(clHeight) vid.yres = clHeight;
if(clFont) vid.abs_fsize = clFont, vid.relative_font = true;
if(vid.want_fullscreen) {
int clWidth=0, clHeight=0, clFont=0;
sscanf(argcs(), "%dx%dx%d", &clWidth, &clHeight, &clFont);
vid.change_fullscr = clWidth;
if(clWidth) vid.fullscreen_x = clWidth;
if(clHeight) vid.fullscreen_y = clHeight;
if(clFont) vid.abs_fsize = clFont, vid.relative_font = true;
}
else if(args().find(".") != string::npos) {
vid.relative_window_size = true;
ld dWidth=0, dHeight=0;
sscanf(argcs(), "%lfx%lf", &dWidth, &dHeight);
if(dWidth) vid.window_rel_x = dWidth;
if(dHeight) vid.window_rel_y = dHeight;
}
else {
vid.want_fullscreen = false;
vid.relative_window_size = false;
int clFont=0;
sscanf(argcs(), "%dx%dx%d", &vid.window_x, &vid.window_y, &clFont);
if(clFont) vid.abs_fsize = clFont, vid.relative_font = true;
}
}
else if(argis("-msm")) {
PHASEFROM(2); memory_saving_mode = true;