| Index: cfgmgr/ReadMe.txt |
| — | — | @@ -1,6 +1,6 @@ |
| 2 | 2 | Struct DXGLCFG
|
| 3 | 3 | Member scaler
|
| 4 | | -REG_DWORD HKCU\DXGL\<app>\ScalingMode
|
| | 4 | +REG_DWORD HKCU\DXGL\Profiles\<app>\ScalingMode
|
| 5 | 5 | Determines the method of scaling full screen modes.
|
| 6 | 6 | Valid settings:
|
| 7 | 7 | 0 - Change display mode to match requested mode.
|
| — | — | @@ -13,7 +13,7 @@ |
| 14 | 14 | 7 - Crop output to desktop, preserving aspect ratio
|
| 15 | 15 |
|
| 16 | 16 | Member fullmode
|
| 17 | | -REG_DWORD HKCU\DXGL\<app>\FullscreenWindowMode
|
| | 17 | +REG_DWORD HKCU\DXGL\Profiles\<app>\FullscreenWindowMode
|
| 18 | 18 | Determines how to handle fullscreen modes.
|
| 19 | 19 | Valid settings:
|
| 20 | 20 | 0 - Use exclusive fullscreen
|
| — | — | @@ -23,19 +23,40 @@ |
| 24 | 24 | 4 - Use a borderless, non-resizable window, called windowed borderless in industry
|
| 25 | 25 |
|
| 26 | 26 | Member colormode
|
| 27 | | -REG_DWORD HKCU\DXGL\<app>\ChangeColorDepth
|
| | 27 | +REG_DWORD HKCU\DXGL\Profiles\<app>\ChangeColorDepth
|
| 28 | 28 | If nonzero, switches screen color depth if requested by the application.
|
| 29 | 29 | Recommended setting is off. DXGL handles color depth conversion internally.
|
| 30 | 30 |
|
| | 31 | +Member firstscalefilter
|
| | 32 | +REG_DWORD HKCU\DXGL\Profiles\<app>\FirstScaleFilter
|
| | 33 | +Filter to use for the optional first pass display scaling.
|
| | 34 | +Valid settings:
|
| | 35 | +0 - Nearest-neighbor stretching
|
| | 36 | +1 - Bilinear interpolation
|
| | 37 | +
|
| | 38 | +Member firstscalex
|
| | 39 | +REG_DWORD HKCU\DXGL\Profiles\<app>\FirstScaleX
|
| | 40 | +Amount to stretch the display in the X direction for the first pass.
|
| | 41 | +If either X or Y is set to 0 or less than 0.25, automatically choose
|
| | 42 | +2x or 2x1 scaling for certain low resolutions.
|
| | 43 | +Stored as a 32-bit float encoded as a DWORD.
|
| | 44 | +
|
| | 45 | +Member firstscaley
|
| | 46 | +REG_DWORD HKCU\DXGL\Profiles\<app>\FirstScaley
|
| | 47 | +Amount to stretch the display in the Y direction for the first pass.
|
| | 48 | +If either X or Y is set to 0 or less than 0.25, automatically choose
|
| | 49 | +2x or 2x1 scaling for certain low resolutions.
|
| | 50 | +Stored as a 32-bit float encoded as a DWORD.
|
| | 51 | +
|
| 31 | 52 | Member scalingfilter
|
| 32 | | -REG_DWORD HKCU\DXGL\<app>\ScalingFilter
|
| 33 | | -Filter to use for stretched 2D blits.
|
| | 53 | +REG_DWORD HKCU\DXGL\Profiles\<app>\ScalingFilter
|
| | 54 | +Filter to use for stretched 2D blits and the final display scaling.
|
| 34 | 55 | Valid settings:
|
| 35 | 56 | 0 - Nearest-neighbor stretching
|
| 36 | 57 | 1 - Bilinear interpolation
|
| 37 | 58 |
|
| 38 | 59 | Member primaryscale
|
| 39 | | -REG_DWORD HKCU\DXGL\<app>\AdjustPrimaryResolution
|
| | 60 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AdjustPrimaryResolution
|
| 40 | 61 | Changes primary resolution to match desktop resolution.
|
| 41 | 62 | May cause glitches
|
| 42 | 63 | Valid settings:
|
| — | — | @@ -50,19 +71,19 @@ |
| 51 | 72 | 8 - Use custom scale.
|
| 52 | 73 |
|
| 53 | 74 | Member primaryscalex
|
| 54 | | -REG_DWORD HKCU\DXGL\<app>\PrimaryScaleX
|
| | 75 | +REG_DWORD HKCU\DXGL\Profiles\<app>\PrimaryScaleX
|
| 55 | 76 | Custom X scale for primary scaling.
|
| 56 | 77 | Stored as a 32-bit float encoded as a DWORD.
|
| 57 | 78 | If zero, negative, or an invalid value, set to 1.
|
| 58 | 79 |
|
| 59 | 80 | Member primaryscaley
|
| 60 | | -REG_DWORD HKCU\DXGL\<app>\PrimaryScaleY
|
| | 81 | +REG_DWORD HKCU\DXGL\Profiles\<app>\PrimaryScaleY
|
| 61 | 82 | Custom X scale for primary scaling.
|
| 62 | 83 | Stored as a 32-bit float encoded as a DWORD.
|
| 63 | 84 | If zero, negative, or an invalid value, set to 1.
|
| 64 | 85 |
|
| 65 | 86 | Member texfilter
|
| 66 | | -REG_DWORD HKCU\DXGL\<app>\TextureFilter
|
| | 87 | +REG_DWORD HKCU\DXGL\Profiles\<app>\TextureFilter
|
| 67 | 88 | Filter for 3D textured polygons
|
| 68 | 89 | Valid settings:
|
| 69 | 90 | 0 - Use application settings
|
| — | — | @@ -74,7 +95,7 @@ |
| 75 | 96 | 6 - GL_LINEAR_MIPMAP_LINEAR (Trilinear filtering)
|
| 76 | 97 |
|
| 77 | 98 | Member anisotropic
|
| 78 | | -REG_DWORD HKCU\DXGL\<app>\AnisotropicFiltering
|
| | 99 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AnisotropicFiltering
|
| 79 | 100 | Anisotropic filter level, may decrese performance on slower GPUs.
|
| 80 | 101 | Valid settings:
|
| 81 | 102 | 0 - Application default
|
| — | — | @@ -82,7 +103,7 @@ |
| 83 | 104 | Larger numbers enable anisotropic filtering, maximum determined by GPU driver.
|
| 84 | 105 |
|
| 85 | 106 | member msaa
|
| 86 | | -REG_DWORD HKCU\DXGL\<app>\Antialiasing
|
| | 107 | +REG_DWORD HKCU\DXGL\Profiles\<app>\Antialiasing
|
| 87 | 108 | Level of Full Screen Antialiasing. May considerably decrease performance on
|
| 88 | 109 | slower GPUs.
|
| 89 | 110 | Valid settings:
|
| — | — | @@ -94,7 +115,7 @@ |
| 95 | 116 | Example: 16 coverage, 8 color = 0x8010
|
| 96 | 117 |
|
| 97 | 118 | Member aspect3d
|
| 98 | | -REG_DWORD HKCU\DXGL\<app>\AdjustAspectRatio
|
| | 119 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AdjustAspectRatio
|
| 99 | 120 | If the scaler is 1 or 4, adjust 3D projection to correct aspect ratio. Does
|
| 100 | 121 | not affect 2D blits or similar operations.
|
| 101 | 122 | Valid settings:
|
| — | — | @@ -103,15 +124,15 @@ |
| 104 | 125 | 2 - Crop to viewable area. May cause graphics to get cut off.
|
| 105 | 126 |
|
| 106 | 127 | Member EnableShader
|
| 107 | | -REG_DWORD HKCU\DXGL\<app>\EnableShader
|
| | 128 | +REG_DWORD HKCU\DXGL\Profiles\<app>\EnableShader
|
| 108 | 129 | If nonzero, enables post-process shaders.
|
| 109 | 130 |
|
| 110 | 131 | Member shaderfile
|
| 111 | | -REG_SZ HKCU\DXGL\<app>\ShaderFile
|
| | 132 | +REG_SZ HKCU\DXGL\Profiles\<app>\ShaderFile
|
| 112 | 133 | Full path to file containing a post-process shader script.
|
| 113 | 134 |
|
| 114 | 135 | Member SortModes
|
| 115 | | -REG_DWORD HKCU\DXGL\<app>\SortModes
|
| | 136 | +REG_DWORD HKCU\DXGL\Profiles\<app>\SortModes
|
| 116 | 137 | Sort display modes
|
| 117 | 138 | Valid settings:
|
| 118 | 139 | 0 - As reported by system
|
| — | — | @@ -119,7 +140,7 @@ |
| 120 | 141 | 2 - Group by resolution
|
| 121 | 142 |
|
| 122 | 143 | Member AllColorDepths
|
| 123 | | -REG_DWORD HKCU\DXGL\<app>\AllColorDepths
|
| | 144 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AllColorDepths
|
| 124 | 145 | [DEPRECATED]Enable all color depths, even if unsupported by the system
|
| 125 | 146 | Valid settings:
|
| 126 | 147 | 0 - Off
|
| — | — | @@ -126,7 +147,7 @@ |
| 127 | 148 | 1 - On
|
| 128 | 149 |
|
| 129 | 150 | Member AddColorDepths
|
| 130 | | -REG_DWORD HKCU\DXGL\<app>\AddColorDepths
|
| | 151 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AddColorDepths
|
| 131 | 152 | Adds color depths, even if unsupported by the system
|
| 132 | 153 | Bit-mapped variable
|
| 133 | 154 | Valid settings, OR'ed to combine settings:
|
| — | — | @@ -138,7 +159,7 @@ |
| 139 | 160 | 16 - Add 32-bit modes
|
| 140 | 161 |
|
| 141 | 162 | Member ExtraModes
|
| 142 | | -REG_DWORD HKCU\DXGL\<app>\ExtraModes
|
| | 163 | +REG_DWORD HKCU\DXGL\Profiles\<app>\ExtraModes
|
| 143 | 164 | [DEPRECATED]Enable extra video modes, even if unsupported by the system
|
| 144 | 165 | Valid settings:
|
| 145 | 166 | 0 - Off
|
| — | — | @@ -145,7 +166,7 @@ |
| 146 | 167 | 1 - On
|
| 147 | 168 |
|
| 148 | 169 | member AddModes
|
| 149 | | -REG_DWORD HKCU\DXGL\<app>\AddModes
|
| | 170 | +REG_DWORD HKCU\DXGL\Profiles\<app>\AddModes
|
| 150 | 171 | Adds additional video modes, even if unsupported by the system
|
| 151 | 172 | Bit-mapped variable
|
| 152 | 173 | Valid settings, OR'ed to combine settings:
|
| — | — | @@ -155,19 +176,19 @@ |
| 156 | 177 | 4 - Add higher resolution modes
|
| 157 | 178 |
|
| 158 | 179 | Member vsync
|
| 159 | | -REG_DWORD HKCU\DXGL\<app>\VSync
|
| | 180 | +REG_DWORD HKCU\DXGL\Profiles\<app>\VSync
|
| 160 | 181 | Vertical retrace control
|
| 161 | 182 | Valid settings:
|
| 162 | 183 | 0 - Determined by application
|
| 163 | 184 |
|
| 164 | 185 | Member TextureFormat
|
| 165 | | -REG_DWORD HKCU\DXGL\<app>\TextureFormat
|
| | 186 | +REG_DWORD HKCU\DXGL\Profiles\<app>\TextureFormat
|
| 166 | 187 | Texture format
|
| 167 | 188 | Valid settings:
|
| 168 | 189 | 0 - Automatic
|
| 169 | 190 |
|
| 170 | 191 | Member TexUpload
|
| 171 | | -REG_DWORD HKCU\DXGL\<app>\TexUpload
|
| | 192 | +REG_DWORD HKCU\DXGL\Profiles\<app>\TexUpload
|
| 172 | 193 | Method used to upload textures
|
| 173 | 194 | Valid settings:
|
| 174 | 195 | 0 - Automatic
|
| — | — | @@ -174,7 +195,7 @@ |
| 175 | 196 | 1 - OpenGL Standard
|
| 176 | 197 |
|
| 177 | 198 | Member DPIScale
|
| 178 | | -REG_DWORD HKCU\DXGL\<app>\DPIScale
|
| | 199 | +REG_DWORD HKCU\DXGL\Profiles\<app>\DPIScale
|
| 179 | 200 | Enable DPI scaling fix
|
| 180 | 201 | The program may be restarted if the Windows AppCompat method is enabled or
|
| 181 | 202 | disabled.
|
| — | — | @@ -184,7 +205,7 @@ |
| 185 | 206 | 2 - Use Windows AppCompat
|
| 186 | 207 |
|
| 187 | 208 | Member aspect
|
| 188 | | -REG_DWORD HKCU\DXGL\<app>\ScreenAspect
|
| | 209 | +REG_DWORD HKCU\DXGL\Profiles\<app>\ScreenAspect
|
| 189 | 210 | Screen aspect ratio to simulate, if the scaler is 1 or 5.
|
| 190 | 211 | Stored as a 32-bit float encoded as a DWORD.
|
| 191 | 212 | If zero, negative, or an invalid value, use automatic ratio based on square pixels.
|
| Index: cfgmgr/cfgmgr.c |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2016 William Feely
|
| | 3 | +// Copyright (C) 2011-2017 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -458,6 +458,9 @@ |
| 459 | 459 | cfg->scaler = ReadDWORD(hKey, cfg->scaler, &cfgmask->scaler, _T("ScalingMode"));
|
| 460 | 460 | cfg->fullmode = ReadDWORD(hKey, cfg->fullmode, &cfgmask->fullmode, _T("FullscreenWindowMode"));
|
| 461 | 461 | cfg->colormode = ReadBool(hKey,cfg->colormode,&cfgmask->colormode,_T("ChangeColorDepth"));
|
| | 462 | + cfg->firstscalefilter = ReadDWORD(hKey, cfg->firstscalefilter, &cfgmask->firstscalefilter, _T("FirstScaleFilter"));
|
| | 463 | + cfg->firstscalex = ReadFloat(hKey, cfg->firstscalex, &cfgmask->firstscalex, _T("FirstScaleX"));
|
| | 464 | + cfg->firstscaley = ReadFloat(hKey, cfg->firstscaley, &cfgmask->firstscaley, _T("FirstScaleY"));
|
| 462 | 465 | cfg->scalingfilter = ReadDWORD(hKey,cfg->scalingfilter,&cfgmask->scalingfilter,_T("ScalingFilter"));
|
| 463 | 466 | cfg->texfilter = ReadDWORD(hKey,cfg->texfilter,&cfgmask->texfilter,_T("TextureFilter"));
|
| 464 | 467 | cfg->anisotropic = ReadDWORD(hKey,cfg->anisotropic,&cfgmask->anisotropic,_T("AnisotropicFiltering"));
|
| — | — | @@ -530,6 +533,9 @@ |
| 531 | 534 | WriteDWORD(hKey,cfg->scaler,cfgmask->scaler,_T("ScalingMode"));
|
| 532 | 535 | WriteDWORD(hKey, cfg->fullmode, cfgmask->fullmode, _T("FullscreenWindowMode"));
|
| 533 | 536 | WriteBool(hKey,cfg->colormode,cfgmask->colormode,_T("ChangeColorDepth"));
|
| | 537 | + WriteDWORD(hKey, cfg->firstscalefilter, cfgmask->firstscalefilter, _T("FirstScaleFilter"));
|
| | 538 | + WriteFloat(hKey, cfg->firstscalex, cfgmask->firstscalex, _T("FirstScaleX"));
|
| | 539 | + WriteFloat(hKey, cfg->firstscalex, cfgmask->firstscalex, _T("FirstScaleY"));
|
| 534 | 540 | WriteDWORD(hKey,cfg->scalingfilter,cfgmask->scalingfilter,_T("ScalingFilter"));
|
| 535 | 541 | WriteDWORD(hKey,cfg->texfilter,cfgmask->texfilter,_T("TextureFilter"));
|
| 536 | 542 | WriteDWORD(hKey,cfg->anisotropic,cfgmask->anisotropic,_T("AnisotropicFiltering"));
|
| Index: cfgmgr/cfgmgr.h |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2016 William Feely
|
| | 3 | +// Copyright (C) 2011-2017 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -28,6 +28,9 @@ |
| 29 | 29 | DWORD scaler;
|
| 30 | 30 | DWORD fullmode;
|
| 31 | 31 | BOOL colormode;
|
| | 32 | + DWORD firstscalefilter;
|
| | 33 | + float firstscalex;
|
| | 34 | + float firstscaley;
|
| 32 | 35 | DWORD scalingfilter;
|
| 33 | 36 | DWORD texfilter;
|
| 34 | 37 | DWORD anisotropic;
|
| Index: dxglcfg/dxglcfg.c |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2016 William Feely
|
| | 3 | +// Copyright (C) 2011-2017 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -227,7 +227,7 @@ |
| 228 | 228 | float fract;
|
| 229 | 229 | TCHAR denominator[5];
|
| 230 | 230 | int i;
|
| 231 | | - if (_isnan(f)) f = 0; //Handle NAN condition
|
| | 231 | + if (_isnan(f)) f = 0.0f; //Handle NAN condition
|
| 232 | 232 | if (f >= 1000.0f) // Clamp ridiculously wide aspects
|
| 233 | 233 | {
|
| 234 | 234 | _tcscpy(aspect, _T("1000:1"));
|
| — | — | @@ -285,11 +285,42 @@ |
| 286 | 286 | }
|
| 287 | 287 | // Cannot find a reasonable fractional aspect, so display as decimal.
|
| 288 | 288 | #ifdef _UNICODE
|
| 289 | | - swprintf(aspect, 31, L"%.6f", f);
|
| | 289 | + swprintf(aspect, 31, L"%.6g", f);
|
| 290 | 290 | #else
|
| 291 | | - sprintf(aspect,"%.6f", f);
|
| | 291 | + sprintf(aspect,"%.6g", f);
|
| 292 | 292 | #endif
|
| | 293 | +}
|
| 293 | 294 |
|
| | 295 | +void FloatToScale(float x, float y, LPTSTR scale)
|
| | 296 | +{
|
| | 297 | + TCHAR numberx[8];
|
| | 298 | + TCHAR numbery[8];
|
| | 299 | + if (_isnan(x)) x = 0.0f; //Handle NAN condition
|
| | 300 | + if (_isnan(y)) y = 0.0f;
|
| | 301 | + // Too low number, round to "Auto"
|
| | 302 | + if (x < 0.25f) x = 0.0f;
|
| | 303 | + if (y < 0.25f) y = 0.0f;
|
| | 304 | + // Too high number, round to 16
|
| | 305 | + if (x > 16.0f) x = 16.0f;
|
| | 306 | + if (y > 16.0f) y = 16.0f;
|
| | 307 | + // Test if either scale is zero
|
| | 308 | + if ((x == 0) || (y == 0))
|
| | 309 | + {
|
| | 310 | + _tcscpy(scale, _T("Auto"));
|
| | 311 | + return;
|
| | 312 | + }
|
| | 313 | + // Write numbers
|
| | 314 | +#ifdef _UNICODE
|
| | 315 | + swprintf(numberx, 7, L"%.4g", x);
|
| | 316 | + swprintf(numbery, 7, L"%.4g", y);
|
| | 317 | +#else
|
| | 318 | + sprintf(numberx, ".4g", x);
|
| | 319 | + sprintf(numbery, ".4g", y);
|
| | 320 | +#endif
|
| | 321 | + // Fill out string
|
| | 322 | + _tcscpy(scale, numberx);
|
| | 323 | + _tcscat(scale, _T("x"));
|
| | 324 | + if (x != y) _tcscat(scale, numbery);
|
| 294 | 325 | }
|
| 295 | 326 |
|
| 296 | 327 | void SetCheck(HWND hWnd, int DlgItem, BOOL value, BOOL mask, BOOL tristate)
|
| — | — | @@ -325,7 +356,21 @@ |
| 326 | 357 | SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)buffer), 0);
|
| 327 | 358 | SetDlgItemText(hWnd, DlgItem, buffer);
|
| 328 | 359 | }
|
| | 360 | +}
|
| 329 | 361 |
|
| | 362 | +void Set1stScaleCombo(HWND hWnd, int DlgItem, float x, float y, DWORD maskx, DWORD masky, BOOL tristate)
|
| | 363 | +{
|
| | 364 | + TCHAR buffer[32];
|
| | 365 | + if (tristate && !maskx && !masky)
|
| | 366 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
|
| | 367 | + SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| | 368 | + else
|
| | 369 | + {
|
| | 370 | + FloatToScale(x, y, buffer);
|
| | 371 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
|
| | 372 | + SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)buffer), 0);
|
| | 373 | + SetDlgItemText(hWnd, DlgItem, buffer);
|
| | 374 | + }
|
| 330 | 375 | }
|
| 331 | 376 |
|
| 332 | 377 | void SetText(HWND hWnd, int DlgItem, TCHAR *value, TCHAR *mask, BOOL tristate)
|
| — | — | @@ -386,6 +431,56 @@ |
| 387 | 432 | }
|
| 388 | 433 | }
|
| 389 | 434 |
|
| | 435 | +void Get1stScaleCombo(HWND hWnd, int DlgItem, float *x, float *y, float *maskx, float *masky)
|
| | 436 | +{
|
| | 437 | + TCHAR buffer[32];
|
| | 438 | + TCHAR *ptr;
|
| | 439 | + GetDlgItemText(hWnd, DlgItem, buffer, 31);
|
| | 440 | + buffer[31] = 0;
|
| | 441 | + if (!_tcscmp(buffer, strdefault))
|
| | 442 | + {
|
| | 443 | + *maskx = 0.0f;
|
| | 444 | + *masky = 0.0f;
|
| | 445 | + *x = 0.0f;
|
| | 446 | + *y = 0.0f;
|
| | 447 | + return;
|
| | 448 | + }
|
| | 449 | + else
|
| | 450 | + {
|
| | 451 | + *maskx = 1.0f;
|
| | 452 | + *masky = 1.0f;
|
| | 453 | + // Check for Auto
|
| | 454 | + if (!_tcsicmp(buffer, _T("Auto)")))
|
| | 455 | + {
|
| | 456 | + *x = 0.0f;
|
| | 457 | + *y = 0.0f;
|
| | 458 | + return;
|
| | 459 | + }
|
| | 460 | + else
|
| | 461 | + {
|
| | 462 | + // Check for certain characters
|
| | 463 | + ptr = _tcsstr(buffer, _T("x"));
|
| | 464 | + if (!ptr) ptr = _tcsstr(buffer, _T("X"));
|
| | 465 | + if (!ptr) ptr = _tcsstr(buffer, _T(","));
|
| | 466 | + if (!ptr) ptr = _tcsstr(buffer, _T("-"));
|
| | 467 | + if (!ptr) ptr = _tcsstr(buffer, _T(":"));
|
| | 468 | + if (ptr)
|
| | 469 | + {
|
| | 470 | + *ptr = 0;
|
| | 471 | + *x = _ttof(buffer);
|
| | 472 | + *y = _ttof(ptr + 1);
|
| | 473 | + return;
|
| | 474 | + }
|
| | 475 | + else
|
| | 476 | + {
|
| | 477 | + *x = _ttof(buffer);
|
| | 478 | + *y = _ttof(buffer);
|
| | 479 | + return;
|
| | 480 | + }
|
| | 481 | + }
|
| | 482 | + }
|
| | 483 | +}
|
| | 484 | +
|
| 390 | 485 | float GetAspectCombo(HWND hWnd, int DlgItem, float *mask)
|
| 391 | 486 | {
|
| 392 | 487 | TCHAR buffer[32];
|
| — | — | @@ -392,15 +487,16 @@ |
| 393 | 488 | TCHAR *ptr;
|
| 394 | 489 | float numerator, denominator;
|
| 395 | 490 | GetDlgItemText(hWnd, DlgItem, buffer, 31);
|
| | 491 | + buffer[31] = 0;
|
| 396 | 492 | if (!_tcscmp(buffer, strdefault))
|
| 397 | 493 | {
|
| 398 | 494 | *mask = 0.0f;
|
| 399 | | - return 0;
|
| | 495 | + return 0.0f;
|
| 400 | 496 | }
|
| 401 | 497 | else
|
| 402 | 498 | {
|
| 403 | 499 | *mask = 1.0f;
|
| 404 | | - if (!_tcscmp(buffer, _T("Default"))) return 0.0f;
|
| | 500 | + if (!_tcsicmp(buffer, _T("Default"))) return 0.0f;
|
| 405 | 501 | else
|
| 406 | 502 | {
|
| 407 | 503 | // Check for colon
|
| — | — | @@ -582,7 +678,7 @@ |
| 583 | 679 | SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 584 | 680 | _tcscpy(buffer, _T("Bilinear"));
|
| 585 | 681 | SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
|
| 586 | | - SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_SETCURSEL, cfg->scalingfilter, 0);
|
| | 682 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_SETCURSEL, cfg->firstscalefilter, 0);
|
| 587 | 683 | // first scaling sizes
|
| 588 | 684 | _tcscpy(buffer, _T("Auto"));
|
| 589 | 685 | SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| — | — | @@ -596,6 +692,8 @@ |
| 597 | 693 | SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 598 | 694 | _tcscpy(buffer, _T("4x"));
|
| 599 | 695 | SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| | 696 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 697 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| 600 | 698 | // final scaling filter
|
| 601 | 699 | _tcscpy(buffer,_T("Nearest"));
|
| 602 | 700 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)buffer);
|
| — | — | @@ -613,8 +711,7 @@ |
| 614 | 712 | SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
|
| 615 | 713 | _tcscpy(buffer,_T("5:4"));
|
| 616 | 714 | SendDlgItemMessage(hWnd,IDC_ASPECT,CB_ADDSTRING,0,(LPARAM)buffer);
|
| 617 | | - SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
|
| 618 | | -
|
| | 715 | + SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
|
| 619 | 716 | // highres
|
| 620 | 717 | if(cfg->primaryscale) SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_CHECKED,0);
|
| 621 | 718 | else SendDlgItemMessage(hWnd,IDC_HIGHRES,BM_SETCHECK,BST_UNCHECKED,0);
|
| — | — | @@ -1026,6 +1123,8 @@ |
| 1027 | 1124 | tristate = TRUE;
|
| 1028 | 1125 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1029 | 1126 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| | 1127 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| | 1128 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 1030 | 1129 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1031 | 1130 | //SendDlgItemMessage(hWnd,IDC_VSYNC,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1032 | 1131 | SendDlgItemMessage(hWnd, IDC_FULLMODE, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| — | — | @@ -1049,6 +1148,10 @@ |
| 1050 | 1149 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| 1051 | 1150 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_DELETESTRING,
|
| 1052 | 1151 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| | 1152 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_DELETESTRING,
|
| | 1153 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| | 1154 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_DELETESTRING,
|
| | 1155 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| 1053 | 1156 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_DELETESTRING,
|
| 1054 | 1157 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| 1055 | 1158 | /* SendDlgItemMessage(hWnd,IDC_VSYNC,CB_DELETESTRING,
|
| — | — | @@ -1079,6 +1182,7 @@ |
| 1080 | 1183 | // Read settings into controls
|
| 1081 | 1184 | SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
|
| 1082 | 1185 | SetCombo(hWnd,IDC_SORTMODES,cfg->SortModes,cfgmask->SortModes,tristate);
|
| | 1186 | + SetCombo(hWnd,IDC_PRESCALE,cfg->firstscalefilter,cfgmask->firstscalefilter,tristate);
|
| 1083 | 1187 | SetCombo(hWnd,IDC_SCALE,cfg->scalingfilter,cfgmask->scalingfilter,tristate);
|
| 1084 | 1188 | //SetCombo(hWnd,IDC_VSYNC,cfg->vsync,cfgmask->vsync,tristate);
|
| 1085 | 1189 | SetCombo(hWnd,IDC_FULLMODE,cfg->fullmode,cfgmask->fullmode,tristate);
|
| — | — | @@ -1093,6 +1197,8 @@ |
| 1094 | 1198 | SetCombo(hWnd,IDC_TEXUPLOAD,cfg->TexUpload,cfgmask->TexUpload,tristate);
|
| 1095 | 1199 | SetCheck(hWnd,IDC_EXTRAMODES,cfg->AddModes,cfgmask->AddModes,tristate);
|
| 1096 | 1200 | SetCombo(hWnd, IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
|
| | 1201 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 1202 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| 1097 | 1203 | SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);
|
| 1098 | 1204 | }
|
| 1099 | 1205 | break;
|
| — | — | @@ -1106,6 +1212,11 @@ |
| 1107 | 1213 | EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| 1108 | 1214 | *dirty = TRUE;
|
| 1109 | 1215 | break;
|
| | 1216 | + case IDC_PRESCALE:
|
| | 1217 | + cfg->firstscalefilter = GetCombo(hWnd,IDC_PRESCALE,&cfgmask->firstscalefilter);
|
| | 1218 | + EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| | 1219 | + *dirty = TRUE;
|
| | 1220 | + break;
|
| 1110 | 1221 | case IDC_SCALE:
|
| 1111 | 1222 | cfg->scalingfilter = GetCombo(hWnd,IDC_SCALE,&cfgmask->scalingfilter);
|
| 1112 | 1223 | EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| — | — | @@ -1176,6 +1287,24 @@ |
| 1177 | 1288 | EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| 1178 | 1289 | *dirty = TRUE;
|
| 1179 | 1290 | break;
|
| | 1291 | + case IDC_PRESCALESIZE:
|
| | 1292 | + if (HIWORD(wParam) == CBN_KILLFOCUS)
|
| | 1293 | + {
|
| | 1294 | + Get1stScaleCombo(hWnd, IDC_PRESCALESIZE, &cfg->firstscalex, &cfg->firstscaley,
|
| | 1295 | + &cfgmask->firstscalex, &cfgmask->firstscaley);
|
| | 1296 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 1297 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| | 1298 | + EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| | 1299 | + *dirty = TRUE;
|
| | 1300 | + }
|
| | 1301 | + else if (HIWORD(wParam) == CBN_SELCHANGE)
|
| | 1302 | + {
|
| | 1303 | + Get1stScaleCombo(hWnd, IDC_PRESCALESIZE, &cfg->firstscalex, &cfg->firstscaley,
|
| | 1304 | + &cfgmask->firstscalex, &cfgmask->firstscaley);
|
| | 1305 | + EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| | 1306 | + *dirty = TRUE;
|
| | 1307 | + }
|
| | 1308 | + break;
|
| 1180 | 1309 | case IDC_ASPECT:
|
| 1181 | 1310 | if (HIWORD(wParam) == CBN_KILLFOCUS)
|
| 1182 | 1311 | {
|
| Index: dxglcfg2/dxglcfg2.c |
| — | — | @@ -1,5 +1,5 @@ |
| 2 | 2 | // DXGL
|
| 3 | | -// Copyright (C) 2011-2016 William Feely
|
| | 3 | +// Copyright (C) 2011-2017 William Feely
|
| 4 | 4 |
|
| 5 | 5 | // This library is free software; you can redistribute it and/or
|
| 6 | 6 | // modify it under the terms of the GNU Lesser General Public
|
| — | — | @@ -275,7 +275,7 @@ |
| 276 | 276 | float fract;
|
| 277 | 277 | TCHAR denominator[5];
|
| 278 | 278 | int i;
|
| 279 | | - if (_isnan(f)) f = 0; //Handle NAN condition
|
| | 279 | + if (_isnan(f)) f = 0.0f; //Handle NAN condition
|
| 280 | 280 | if (f >= 1000.0f) // Clamp ridiculously wide aspects
|
| 281 | 281 | {
|
| 282 | 282 | _tcscpy(aspect, _T("1000:1"));
|
| — | — | @@ -333,11 +333,42 @@ |
| 334 | 334 | }
|
| 335 | 335 | // Cannot find a reasonable fractional aspect, so display as decimal.
|
| 336 | 336 | #ifdef _UNICODE
|
| 337 | | - swprintf(aspect, 31, L"%.6f", f);
|
| | 337 | + swprintf(aspect, 31, L"%.6g", f);
|
| 338 | 338 | #else
|
| 339 | | - sprintf(aspect,"%.6f", f);
|
| | 339 | + sprintf(aspect,"%.6g", f);
|
| 340 | 340 | #endif
|
| | 341 | +}
|
| 341 | 342 |
|
| | 343 | +void FloatToScale(float x, float y, LPTSTR scale)
|
| | 344 | +{
|
| | 345 | + TCHAR numberx[8];
|
| | 346 | + TCHAR numbery[8];
|
| | 347 | + if (_isnan(x)) x = 0.0f; //Handle NAN condition
|
| | 348 | + if (_isnan(y)) y = 0.0f;
|
| | 349 | + // Too low number, round to "Auto"
|
| | 350 | + if (x < 0.25f) x = 0.0f;
|
| | 351 | + if (y < 0.25f) y = 0.0f;
|
| | 352 | + // Too high number, round to 16
|
| | 353 | + if (x > 16.0f) x = 16.0f;
|
| | 354 | + if (y > 16.0f) y = 16.0f;
|
| | 355 | + // Test if either scale is zero
|
| | 356 | + if ((x == 0) || (y == 0))
|
| | 357 | + {
|
| | 358 | + _tcscpy(scale, _T("Auto"));
|
| | 359 | + return;
|
| | 360 | + }
|
| | 361 | + // Write numbers
|
| | 362 | +#ifdef _UNICODE
|
| | 363 | + swprintf(numberx, 7, L"%.4g", x);
|
| | 364 | + swprintf(numbery, 7, L"%.4g", y);
|
| | 365 | +#else
|
| | 366 | + sprintf(numberx, ".4g", x);
|
| | 367 | + sprintf(numbery, ".4g", y);
|
| | 368 | +#endif
|
| | 369 | + // Fill out string
|
| | 370 | + _tcscpy(scale, numberx);
|
| | 371 | + _tcscat(scale, _T("x"));
|
| | 372 | + if (x != y) _tcscat(scale, numbery);
|
| 342 | 373 | }
|
| 343 | 374 |
|
| 344 | 375 | void SetCheck(HWND hWnd, int DlgItem, BOOL value, BOOL mask, BOOL tristate)
|
| — | — | @@ -397,7 +428,21 @@ |
| 398 | 429 | SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)buffer), 0);
|
| 399 | 430 | SetDlgItemText(hWnd, DlgItem, buffer);
|
| 400 | 431 | }
|
| | 432 | +}
|
| 401 | 433 |
|
| | 434 | +void Set1stScaleCombo(HWND hWnd, int DlgItem, float x, float y, DWORD maskx, DWORD masky, BOOL tristate)
|
| | 435 | +{
|
| | 436 | + TCHAR buffer[32];
|
| | 437 | + if (tristate && !maskx && !masky)
|
| | 438 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
|
| | 439 | + SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| | 440 | + else
|
| | 441 | + {
|
| | 442 | + FloatToScale(x, y, buffer);
|
| | 443 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
|
| | 444 | + SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)buffer), 0);
|
| | 445 | + SetDlgItemText(hWnd, DlgItem, buffer);
|
| | 446 | + }
|
| 402 | 447 | }
|
| 403 | 448 |
|
| 404 | 449 | void SetText(HWND hWnd, int DlgItem, TCHAR *value, TCHAR *mask, BOOL tristate)
|
| — | — | @@ -440,6 +485,56 @@ |
| 441 | 486 | }
|
| 442 | 487 | }
|
| 443 | 488 |
|
| | 489 | +void Get1stScaleCombo(HWND hWnd, int DlgItem, float *x, float *y, float *maskx, float *masky)
|
| | 490 | +{
|
| | 491 | + TCHAR buffer[32];
|
| | 492 | + TCHAR *ptr;
|
| | 493 | + GetDlgItemText(hWnd, DlgItem, buffer, 31);
|
| | 494 | + buffer[31] = 0;
|
| | 495 | + if (!_tcscmp(buffer, strdefault))
|
| | 496 | + {
|
| | 497 | + *maskx = 0.0f;
|
| | 498 | + *masky = 0.0f;
|
| | 499 | + *x = 0.0f;
|
| | 500 | + *y = 0.0f;
|
| | 501 | + return;
|
| | 502 | + }
|
| | 503 | + else
|
| | 504 | + {
|
| | 505 | + *maskx = 1.0f;
|
| | 506 | + *masky = 1.0f;
|
| | 507 | + // Check for Auto
|
| | 508 | + if (!_tcsicmp(buffer, _T("Auto)")))
|
| | 509 | + {
|
| | 510 | + *x = 0.0f;
|
| | 511 | + *y = 0.0f;
|
| | 512 | + return;
|
| | 513 | + }
|
| | 514 | + else
|
| | 515 | + {
|
| | 516 | + // Check for certain characters
|
| | 517 | + ptr = _tcsstr(buffer, _T("x"));
|
| | 518 | + if (!ptr) ptr = _tcsstr(buffer, _T("X"));
|
| | 519 | + if (!ptr) ptr = _tcsstr(buffer, _T(","));
|
| | 520 | + if (!ptr) ptr = _tcsstr(buffer, _T("-"));
|
| | 521 | + if (!ptr) ptr = _tcsstr(buffer, _T(":"));
|
| | 522 | + if (ptr)
|
| | 523 | + {
|
| | 524 | + *ptr = 0;
|
| | 525 | + *x = _ttof(buffer);
|
| | 526 | + *y = _ttof(ptr + 1);
|
| | 527 | + return;
|
| | 528 | + }
|
| | 529 | + else
|
| | 530 | + {
|
| | 531 | + *x = _ttof(buffer);
|
| | 532 | + *y = _ttof(buffer);
|
| | 533 | + return;
|
| | 534 | + }
|
| | 535 | + }
|
| | 536 | + }
|
| | 537 | +}
|
| | 538 | +
|
| 444 | 539 | float GetAspectCombo(HWND hWnd, int DlgItem, float *mask)
|
| 445 | 540 | {
|
| 446 | 541 | TCHAR buffer[32];
|
| — | — | @@ -446,15 +541,16 @@ |
| 447 | 542 | TCHAR *ptr;
|
| 448 | 543 | float numerator, denominator;
|
| 449 | 544 | GetDlgItemText(hWnd, DlgItem, buffer, 31);
|
| | 545 | + buffer[31] = 0;
|
| 450 | 546 | if (!_tcscmp(buffer, strdefault))
|
| 451 | 547 | {
|
| 452 | 548 | *mask = 0.0f;
|
| 453 | | - return 0;
|
| | 549 | + return 0.0f;
|
| 454 | 550 | }
|
| 455 | 551 | else
|
| 456 | 552 | {
|
| 457 | 553 | *mask = 1.0f;
|
| 458 | | - if (!_tcscmp(buffer, _T("Default"))) return 0.0f;
|
| | 554 | + if (!_tcsicmp(buffer, _T("Default"))) return 0.0f;
|
| 459 | 555 | else
|
| 460 | 556 | {
|
| 461 | 557 | // Check for colon
|
| — | — | @@ -814,7 +910,7 @@ |
| 815 | 911 | SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 816 | 912 | _tcscpy(buffer, _T("Bilinear"));
|
| 817 | 913 | SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_ADDSTRING, 1, (LPARAM)buffer);
|
| 818 | | - SendDlgItemMessage(hTabs[0], IDC_PRESCALE, CB_SETCURSEL, cfg->scalingfilter, 0);
|
| | 914 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_SETCURSEL, cfg->firstscalefilter, 0);
|
| 819 | 915 | // first scaling sizes
|
| 820 | 916 | _tcscpy(buffer, _T("Auto"));
|
| 821 | 917 | SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| — | — | @@ -828,6 +924,8 @@ |
| 829 | 925 | SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 830 | 926 | _tcscpy(buffer, _T("4x"));
|
| 831 | 927 | SendDlgItemMessage(hTabs[0], IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| | 928 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 929 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| 832 | 930 | // final scaling filter
|
| 833 | 931 | _tcscpy(buffer,_T("Nearest"));
|
| 834 | 932 | SendDlgItemMessage(hTabs[0], IDC_SCALE, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| — | — | @@ -1305,6 +1403,8 @@ |
| 1306 | 1404 | tristate = TRUE;
|
| 1307 | 1405 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1308 | 1406 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| | 1407 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| | 1408 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 1309 | 1409 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1310 | 1410 | SendDlgItemMessage(hWnd,IDC_VSYNC,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 1311 | 1411 | SendDlgItemMessage(hWnd,IDC_MSAA,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| — | — | @@ -1327,6 +1427,10 @@ |
| 1328 | 1428 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| 1329 | 1429 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_DELETESTRING,
|
| 1330 | 1430 | SendDlgItemMessage(hWnd,IDC_SORTMODES,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| | 1431 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_DELETESTRING,
|
| | 1432 | + SendDlgItemMessage(hWnd, IDC_PRESCALE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| | 1433 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_DELETESTRING,
|
| | 1434 | + SendDlgItemMessage(hWnd, IDC_PRESCALESIZE, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| 1331 | 1435 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_DELETESTRING,
|
| 1332 | 1436 | SendDlgItemMessage(hWnd,IDC_SCALE,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| 1333 | 1437 | SendDlgItemMessage(hWnd,IDC_VSYNC,CB_DELETESTRING,
|
| — | — | @@ -1355,6 +1459,7 @@ |
| 1356 | 1460 | // Read settings into controls
|
| 1357 | 1461 | SetCombo(hWnd,IDC_VIDMODE,cfg->scaler,cfgmask->scaler,tristate);
|
| 1358 | 1462 | SetCombo(hWnd,IDC_SORTMODES,cfg->SortModes,cfgmask->SortModes,tristate);
|
| | 1463 | + SetCombo(hWnd,IDC_PRESCALE,cfg->firstscalefilter,cfgmask->firstscalefilter,tristate);
|
| 1359 | 1464 | SetCombo(hWnd,IDC_SCALE,cfg->scalingfilter,cfgmask->scalingfilter,tristate);
|
| 1360 | 1465 | SetCombo(hWnd,IDC_VSYNC,cfg->vsync,cfgmask->vsync,tristate);
|
| 1361 | 1466 | SetCombo(hWnd,IDC_MSAA,cfg->msaa,cfgmask->msaa,tristate);
|
| — | — | @@ -1369,6 +1474,8 @@ |
| 1370 | 1475 | SetCheck(hWnd,IDC_EXTRAMODES,cfg->ExtraModes,cfgmask->ExtraModes,tristate);
|
| 1371 | 1476 | SetText(hWnd,IDC_SHADER,cfg->shaderfile,cfgmask->shaderfile,tristate);
|
| 1372 | 1477 | SetCombo(hWnd, IDC_DPISCALE, cfg->DPIScale, cfgmask->DPIScale, tristate);
|
| | 1478 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 1479 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| 1373 | 1480 | SetAspectCombo(hWnd, IDC_ASPECT, cfg->aspect, cfgmask->aspect, tristate);*/
|
| 1374 | 1481 | }
|
| 1375 | 1482 | break;
|
| — | — | @@ -1382,6 +1489,11 @@ |
| 1383 | 1490 | EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| 1384 | 1491 | *dirty = TRUE;
|
| 1385 | 1492 | break;
|
| | 1493 | + case IDC_PRESCALE:
|
| | 1494 | + cfg->firstscalefilter = GetCombo(hWnd,IDC_PRESCALE,&cfgmask->firstscalefilter);
|
| | 1495 | + EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| | 1496 | + *dirty = TRUE;
|
| | 1497 | + break;
|
| 1386 | 1498 | case IDC_SCALE:
|
| 1387 | 1499 | cfg->scalingfilter = GetCombo(hWnd,IDC_SCALE,&cfgmask->scalingfilter);
|
| 1388 | 1500 | EnableWindow(GetDlgItem(hWnd,IDC_APPLY),TRUE);
|
| — | — | @@ -1447,6 +1559,24 @@ |
| 1448 | 1560 | EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| 1449 | 1561 | *dirty = TRUE;
|
| 1450 | 1562 | break;
|
| | 1563 | + case IDC_PRESCALESIZE:
|
| | 1564 | + if (HIWORD(wParam) == CBN_KILLFOCUS)
|
| | 1565 | + {
|
| | 1566 | + Get1stScaleCombo(hWnd, IDC_PRESCALESIZE, &cfg->firstscalex, &cfg->firstscaley,
|
| | 1567 | + &cfgmask->firstscalex, &cfgmask->firstscaley);
|
| | 1568 | + Set1stScaleCombo(hWnd, IDC_PRESCALESIZE, cfg->firstscalex, cfg->firstscaley,
|
| | 1569 | + cfgmask->firstscalex, cfgmask->firstscaley, tristate);
|
| | 1570 | + EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| | 1571 | + *dirty = TRUE;
|
| | 1572 | + }
|
| | 1573 | + else if (HIWORD(wParam) == CBN_SELCHANGE)
|
| | 1574 | + {
|
| | 1575 | + Get1stScaleCombo(hWnd, IDC_PRESCALESIZE, &cfg->firstscalex, &cfg->firstscaley,
|
| | 1576 | + &cfgmask->firstscalex, &cfgmask->firstscaley);
|
| | 1577 | + EnableWindow(GetDlgItem(hWnd, IDC_APPLY), TRUE);
|
| | 1578 | + *dirty = TRUE;
|
| | 1579 | + }
|
| | 1580 | + break;
|
| 1451 | 1581 | case IDC_SHADER:
|
| 1452 | 1582 | if(HIWORD(wParam) == EN_CHANGE)
|
| 1453 | 1583 | {
|