Index: cfgmgr/ReadMe.txt |
— | — | @@ -10,6 +10,7 @@ |
11 | 11 | 4 - Change display mode, stretch if matching mode not found
|
12 | 12 | 5 - Change display mode, aspect corrected stretch if matching mode not found
|
13 | 13 | 6 - Change display mode, center if matching mode not found
|
| 14 | +7 - Crop output to desktop, preserving aspect ratio
|
14 | 15 |
|
15 | 16 | Member colormode
|
16 | 17 | REG_DWORD HKCU\DXGL\<app>\ChangeColorDepth
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -1360,7 +1360,7 @@ |
1361 | 1361 | SetTextureStageState(0,D3DTSS_MAGFILTER,D3DTFG_POINT);
|
1362 | 1362 | break;
|
1363 | 1363 | case D3DFILTER_LINEAR:
|
1364 | | - SetTextureStageState(0,D3DTSS_MINFILTER,D3DTFG_POINT);
|
| 1364 | + SetTextureStageState(0,D3DTSS_MAGFILTER,D3DTFG_LINEAR);
|
1365 | 1365 | }
|
1366 | 1366 | break;
|
1367 | 1367 | case D3DRENDERSTATE_TEXTUREMIN:
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -1807,6 +1807,51 @@ |
1808 | 1808 | break;
|
1809 | 1809 | }
|
1810 | 1810 | break;
|
| 1811 | + case 7: // Crop to screen, aspect corrected
|
| 1812 | + primaryx = dwWidth;
|
| 1813 | + screenx = currmode.dmPelsWidth;
|
| 1814 | + primaryy = dwHeight;
|
| 1815 | + screeny = currmode.dmPelsHeight;
|
| 1816 | + if (_isnan(dxglcfg.aspect) || dxglcfg.aspect <= 0)
|
| 1817 | + {
|
| 1818 | + aspect = (float)dwWidth / (float)dwHeight;
|
| 1819 | + xmul = (float)screenx / (float)dwWidth;
|
| 1820 | + ymul = (float)screeny / (float)dwHeight;
|
| 1821 | + if ((float)dwWidth*(float)ymul < (float)screenx)
|
| 1822 | + {
|
| 1823 | + internalx = (DWORD)((float)dwWidth * (float)xmul);
|
| 1824 | + internaly = (DWORD)((float)dwHeight * (float)xmul);
|
| 1825 | + }
|
| 1826 | + else
|
| 1827 | + {
|
| 1828 | + internalx = (DWORD)((float)dwWidth * (float)ymul);
|
| 1829 | + internaly = (DWORD)((float)dwHeight * (float)ymul);
|
| 1830 | + }
|
| 1831 | + }
|
| 1832 | + else
|
| 1833 | + {
|
| 1834 | + aspect = dxglcfg.aspect;
|
| 1835 | + if (screenx/aspect < screeny)
|
| 1836 | + {
|
| 1837 | + internalx = (DWORD)((float)screeny * (float)aspect);
|
| 1838 | + internaly = screeny;
|
| 1839 | + }
|
| 1840 | + else
|
| 1841 | + {
|
| 1842 | + internalx = screenx;
|
| 1843 | + internaly = (DWORD)((float)screenx / (float)aspect);
|
| 1844 | + }
|
| 1845 | + }
|
| 1846 | + if(dxglcfg.colormode) internalbpp = screenbpp = dwBPP;
|
| 1847 | + else internalbpp = screenbpp = currmode.dmBitsPerPel;
|
| 1848 | + if (dwRefreshRate) internalrefresh = primaryrefresh = screenrefresh = dwRefreshRate;
|
| 1849 | + else internalrefresh = primaryrefresh = screenrefresh = currmode.dmDisplayFrequency;
|
| 1850 | + primarybpp = dwBPP;
|
| 1851 | + InitGL(screenx,screeny,screenbpp,true,internalrefresh,hWnd,this,devwnd);
|
| 1852 | + primarylost = true;
|
| 1853 | + TRACE_EXIT(23,DD_OK);
|
| 1854 | + return DD_OK;
|
| 1855 | + break;
|
1811 | 1856 | }
|
1812 | 1857 | TRACE_EXIT(23,DDERR_GENERIC);
|
1813 | 1858 | ERR(DDERR_GENERIC);
|
Index: dxglcfg/dxglcfg.c |
— | — | @@ -531,6 +531,8 @@ |
532 | 532 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,5,(LPARAM)buffer);
|
533 | 533 | _tcscpy(buffer,_T("Center if mode not found"));
|
534 | 534 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,6,(LPARAM)buffer);
|
| 535 | + _tcscpy(buffer,_T("Crop to screen (experimental)"));
|
| 536 | + SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_ADDSTRING,7,(LPARAM)buffer);
|
535 | 537 | SendDlgItemMessage(hWnd,IDC_VIDMODE,CB_SETCURSEL,cfg->scaler,0);
|
536 | 538 | // colormode
|
537 | 539 | if(cfg->colormode) SendDlgItemMessage(hWnd,IDC_COLOR,BM_SETCHECK,BST_CHECKED,0);
|