]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Optional disable windowed mode resize.
authorToni Wilen <twilen@winuae.net>
Tue, 15 May 2018 17:23:24 +0000 (20:23 +0300)
committerToni Wilen <twilen@winuae.net>
Tue, 15 May 2018 17:23:24 +0000 (20:23 +0300)
cfgfile.cpp
include/options.h
od-win32/win32gfx.cpp
od-win32/win32gui.cpp

index b5a6b414324594c5dab842d6a1e8667ad02577e4..5a7bfd8199d46c029dbf2a97307cd7a40b59ffa8 100644 (file)
@@ -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;
index 0f49f3be72bcd89caa55e2435f59fb094a401ffb..99718c2adc76742e86cbf657936de0882fb0299e 100644 (file)
@@ -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];
 
index 67d15df28a43ddd59103bc44dbaf19f412fd6fe3..8effcb65118ae11d545ae7dd695af9882655db18 100644 (file)
@@ -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;
index 1a5733afc163ad27a6c03fae6d36b1d7152a97ea..e6359eadcb1dfeabc5aa6e2cdc012385619f95f0 100644 (file)
@@ -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) {