From: Toni Wilen Date: Tue, 15 May 2018 17:23:24 +0000 (+0300) Subject: Optional disable windowed mode resize. X-Git-Tag: 4000~54 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=5d6e58df29638d01dbb17264cd039b19ebab0084;p=francis%2Fwinuae.git Optional disable windowed mode resize. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index b5a6b414..5a7bfd81 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -1901,14 +1901,15 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) cfgfile_write_str (f, _T("gfx_display_friendlyname_rtg"), target_get_display_name (p->gfx_apmode[APMODE_RTG].gfx_display, true)); cfgfile_write_str (f, _T("gfx_display_name_rtg"), target_get_display_name (p->gfx_apmode[APMODE_RTG].gfx_display, false)); - cfgfile_write (f, _T("gfx_framerate"), _T("%d"), p->gfx_framerate); - write_resolution (f, _T("gfx_width"), _T("gfx_height"), &p->gfx_monitor[0].gfx_size_win); /* compatibility with old versions */ + cfgfile_write(f, _T("gfx_framerate"), _T("%d"), p->gfx_framerate); + write_resolution(f, _T("gfx_width"), _T("gfx_height"), &p->gfx_monitor[0].gfx_size_win); /* compatibility with old versions */ cfgfile_write (f, _T("gfx_top_windowed"), _T("%d"), p->gfx_monitor[0].gfx_size_win.x); - cfgfile_write (f, _T("gfx_left_windowed"), _T("%d"), p->gfx_monitor[0].gfx_size_win.y); - write_resolution (f, _T("gfx_width_windowed"), _T("gfx_height_windowed"), &p->gfx_monitor[0].gfx_size_win); - write_resolution (f, _T("gfx_width_fullscreen"), _T("gfx_height_fullscreen"), &p->gfx_monitor[0].gfx_size_fs); - cfgfile_write (f, _T("gfx_refreshrate"), _T("%d"), p->gfx_apmode[0].gfx_refreshrate); - cfgfile_dwrite (f, _T("gfx_refreshrate_rtg"), _T("%d"), p->gfx_apmode[1].gfx_refreshrate); + cfgfile_write(f, _T("gfx_left_windowed"), _T("%d"), p->gfx_monitor[0].gfx_size_win.y); + cfgfile_dwrite_bool(f, _T("gfx_resize_windowed"), p->gfx_windowed_resize); + write_resolution(f, _T("gfx_width_windowed"), _T("gfx_height_windowed"), &p->gfx_monitor[0].gfx_size_win); + write_resolution(f, _T("gfx_width_fullscreen"), _T("gfx_height_fullscreen"), &p->gfx_monitor[0].gfx_size_fs); + cfgfile_write(f, _T("gfx_refreshrate"), _T("%d"), p->gfx_apmode[0].gfx_refreshrate); + cfgfile_dwrite(f, _T("gfx_refreshrate_rtg"), _T("%d"), p->gfx_apmode[1].gfx_refreshrate); cfgfile_write (f, _T("gfx_autoresolution"), _T("%d"), p->gfx_autoresolution); cfgfile_dwrite (f, _T("gfx_autoresolution_delay"), _T("%d"), p->gfx_autoresolution_delay); @@ -3030,16 +3031,17 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) || cfgfile_intval(option, value, _T("gfx_frame_slices"), &p->gfx_display_sections, 1) || cfgfile_intval(option, value, _T("gfx_framerate"), &p->gfx_framerate, 1) - || cfgfile_intval (option, value, _T("gfx_top_windowed"), &p->gfx_monitor[0].gfx_size_win.x, 1) - || cfgfile_intval (option, value, _T("gfx_left_windowed"), &p->gfx_monitor[0].gfx_size_win.y, 1) - || cfgfile_intval (option, value, _T("gfx_refreshrate"), &p->gfx_apmode[APMODE_NATIVE].gfx_refreshrate, 1) - || cfgfile_intval (option, value, _T("gfx_refreshrate_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_refreshrate, 1) - || cfgfile_intval (option, value, _T("gfx_autoresolution_delay"), &p->gfx_autoresolution_delay, 1) - || cfgfile_intval (option, value, _T("gfx_backbuffers"), &p->gfx_apmode[APMODE_NATIVE].gfx_backbuffers, 1) - || cfgfile_intval (option, value, _T("gfx_backbuffers_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_backbuffers, 1) - || cfgfile_yesno (option, value, _T("gfx_interlace"), &p->gfx_apmode[APMODE_NATIVE].gfx_interlaced) + || cfgfile_intval(option, value, _T("gfx_top_windowed"), &p->gfx_monitor[0].gfx_size_win.x, 1) + || cfgfile_intval(option, value, _T("gfx_left_windowed"), &p->gfx_monitor[0].gfx_size_win.y, 1) + || cfgfile_intval(option, value, _T("gfx_refreshrate"), &p->gfx_apmode[APMODE_NATIVE].gfx_refreshrate, 1) + || cfgfile_intval(option, value, _T("gfx_refreshrate_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_refreshrate, 1) + || cfgfile_intval(option, value, _T("gfx_autoresolution_delay"), &p->gfx_autoresolution_delay, 1) + || cfgfile_intval(option, value, _T("gfx_backbuffers"), &p->gfx_apmode[APMODE_NATIVE].gfx_backbuffers, 1) + || cfgfile_intval(option, value, _T("gfx_backbuffers_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_backbuffers, 1) + || cfgfile_yesno(option, value, _T("gfx_interlace"), &p->gfx_apmode[APMODE_NATIVE].gfx_interlaced) || cfgfile_yesno(option, value, _T("gfx_interlace_rtg"), &p->gfx_apmode[APMODE_RTG].gfx_interlaced) || cfgfile_yesno(option, value, _T("gfx_vrr_monitor"), &p->gfx_variable_sync) + || cfgfile_yesno(option, value, _T("gfx_resize_windowed"), &p->gfx_windowed_resize) || cfgfile_intval(option, value, _T("gfx_black_frame_insertion_ratio"), &p->lightboost_strobo_ratio, 1) || cfgfile_intval (option, value, _T("gfx_center_horizontal_position"), &p->gfx_xcenter_pos, 1) @@ -7434,6 +7436,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->gfx_apmode[1].gfx_backbuffers = 1; p->gfx_display_sections = 4; p->gfx_variable_sync = 0; + p->gfx_windowed_resize = true; p->immediate_blits = 0; p->waiting_blits = 0; diff --git a/include/options.h b/include/options.h index 0f49f3be..99718c2a 100644 --- a/include/options.h +++ b/include/options.h @@ -527,6 +527,7 @@ struct uae_prefs { int lightpen_offset[2]; int gfx_display_sections; int gfx_variable_sync; + bool gfx_windowed_resize; struct gfx_filterdata gf[2]; diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 67d15df2..8effcb65 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -2304,6 +2304,7 @@ int check_prefs_changed_gfx (void) c |= currprefs.gfx_display_sections != changed_prefs.gfx_display_sections ? (512) : 0; c |= currprefs.gfx_variable_sync != changed_prefs.gfx_variable_sync ? 1 : 0; + c |= currprefs.gfx_windowed_resize != changed_prefs.gfx_windowed_resize ? 1 : 0; c |= currprefs.gfx_apmode[APMODE_NATIVE].gfx_display != changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display ? (2|4|8) : 0; c |= currprefs.gfx_apmode[APMODE_RTG].gfx_display != changed_prefs.gfx_apmode[APMODE_RTG].gfx_display ? (2|4|8) : 0; @@ -2404,6 +2405,7 @@ int check_prefs_changed_gfx (void) currprefs.gfx_display_sections = changed_prefs.gfx_display_sections; currprefs.gfx_variable_sync = changed_prefs.gfx_variable_sync; + currprefs.gfx_windowed_resize = changed_prefs.gfx_windowed_resize; currprefs.gfx_apmode[APMODE_NATIVE].gfx_display = changed_prefs.gfx_apmode[APMODE_NATIVE].gfx_display; currprefs.gfx_apmode[APMODE_RTG].gfx_display = changed_prefs.gfx_apmode[APMODE_RTG].gfx_display; diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 1a5733af..e6359ead 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -7417,6 +7417,7 @@ static void values_to_displaydlg (HWND hDlg) SendDlgItemMessage (hDlg, IDC_DISPLAY_BUFFERCNT, CB_SETCURSEL, workprefs.gfx_apmode[0].gfx_backbuffers - 1, 0); CheckDlgButton(hDlg, IDC_DISPLAY_VARSYNC, workprefs.gfx_variable_sync != 0); + CheckDlgButton(hDlg, IDC_DISPLAY_RESIZE, workprefs.gfx_windowed_resize != 0); init_da (hDlg); } @@ -7671,6 +7672,7 @@ static void values_from_displaydlg (HWND hDlg, UINT msg, WPARAM wParam, LPARAM l workprefs.gfx_xcenter = ischecked (hDlg, IDC_XCENTER) ? 2 : 0; /* Smart centering */ workprefs.gfx_ycenter = ischecked (hDlg, IDC_YCENTER) ? 2 : 0; /* Smart centering */ workprefs.gfx_variable_sync = ischecked(hDlg, IDC_DISPLAY_VARSYNC) ? 1 : 0; + workprefs.gfx_windowed_resize = ischecked(hDlg, IDC_DISPLAY_RESIZE); LRESULT posn1 = SendDlgItemMessage (hDlg, IDC_AUTORESOLUTIONSELECT, CB_GETCURSEL, 0, 0); if (posn1 != CB_ERR) {