mirror of https://github.com/snes9xgit/snes9x.git
win32: use bilinear setting in core
This commit is contained in:
parent
af71ef55cd
commit
f883561d11
|
@ -335,7 +335,7 @@ bool CD3DCG::LoadShader(const TCHAR *shaderFile)
|
|||
and no filter has been set use the GUI setting
|
||||
*/
|
||||
if(pass.scaleParams.scaleTypeX==CG_SCALE_NONE && !it->filterSet) {
|
||||
pass.linearFilter = GUI.BilinearFilter;
|
||||
pass.linearFilter = Settings.BilinearFilter;
|
||||
} else {
|
||||
pass.linearFilter = it->linearFilter;
|
||||
}
|
||||
|
|
|
@ -1084,7 +1084,7 @@ bool CDirect3D::ApplyDisplayChanges(void)
|
|||
|
||||
void CDirect3D::SetFiltering()
|
||||
{
|
||||
if(GUI.BilinearFilter) {
|
||||
if(Settings.BilinearFilter) {
|
||||
pDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
|
||||
pDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
|
||||
} else {
|
||||
|
|
|
@ -375,7 +375,7 @@ bool CDirectDraw::SetDisplayMode(
|
|||
ZeroMemory (&ddsd, sizeof (ddsd));
|
||||
ddsd.dwSize = sizeof (ddsd);
|
||||
ddsd.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH;
|
||||
if(GUI.BilinearFilter)
|
||||
if(Settings.BilinearFilter)
|
||||
{
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | (GUI.LocalVidMem ? DDSCAPS_LOCALVIDMEM : DDSCAPS_NONLOCALVIDMEM);
|
||||
}
|
||||
|
@ -390,10 +390,10 @@ bool CDirectDraw::SetDisplayMode(
|
|||
if (FAILED(lpDD->CreateSurface (&ddsd, &lpDDSOffScreen, NULL)))
|
||||
{
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_VIDEOMEMORY | (GUI.LocalVidMem ? DDSCAPS_NONLOCALVIDMEM : DDSCAPS_LOCALVIDMEM);
|
||||
if(!GUI.BilinearFilter || FAILED(lpDD->CreateSurface (&ddsd, &lpDDSOffScreen, NULL)))
|
||||
if(!Settings.BilinearFilter || FAILED(lpDD->CreateSurface (&ddsd, &lpDDSOffScreen, NULL)))
|
||||
{
|
||||
ddsd.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY;
|
||||
if(!GUI.BilinearFilter || FAILED(lpDD->CreateSurface (&ddsd, &lpDDSOffScreen, NULL)))
|
||||
if(!Settings.BilinearFilter || FAILED(lpDD->CreateSurface (&ddsd, &lpDDSOffScreen, NULL)))
|
||||
{
|
||||
BLOCK = false;
|
||||
return (false);
|
||||
|
|
|
@ -339,7 +339,7 @@ bool CGLCG::LoadShader(const TCHAR *shaderFile)
|
|||
and no filter has been set use the GUI setting
|
||||
*/
|
||||
if(pass.scaleParams.scaleTypeX==CG_SCALE_NONE && !it->filterSet) {
|
||||
pass.linearFilter = GUI.BilinearFilter;
|
||||
pass.linearFilter = Settings.BilinearFilter;
|
||||
} else {
|
||||
pass.linearFilter = it->linearFilter;
|
||||
}
|
||||
|
|
|
@ -509,7 +509,7 @@ void COpenGL::Render(SSurface Src)
|
|||
}
|
||||
}
|
||||
|
||||
if(GUI.BilinearFilter) {
|
||||
if(Settings.BilinearFilter) {
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
} else {
|
||||
|
|
|
@ -265,7 +265,7 @@ void WinSetDefaultValues ()
|
|||
GUI.Stretch = false;
|
||||
GUI.FlipCounter = 0;
|
||||
GUI.NumFlipFrames = 1;
|
||||
GUI.BilinearFilter = false;
|
||||
Settings.BilinearFilter = false;
|
||||
GUI.LockDirectories = false;
|
||||
GUI.window_maximized = false;
|
||||
GUI.EmulatedFullscreen = false;
|
||||
|
@ -915,7 +915,7 @@ void WinRegisterConfigItems()
|
|||
AddBoolC("Stretch:Enabled", GUI.Stretch, true, "true to stretch the game image to fill the window or screen");
|
||||
AddBoolC("Stretch:MaintainAspectRatio", GUI.AspectRatio, true, "prevents stretching from changing the aspect ratio");
|
||||
AddUIntC("Stretch:AspectRatioBaseWidth", GUI.AspectWidth, 256, "base width for aspect ratio calculation (AR=AspectRatioBaseWidth/224), default is 256 - set to 299 for 4:3 aspect ratio");
|
||||
AddBoolC("Stretch:BilinearFilter", GUI.BilinearFilter, true, "allows bilinear filtering of stretching. Depending on your video card and the window size, this may result in a lower framerate.");
|
||||
AddBoolC("Stretch:BilinearFilter", Settings.BilinearFilter, true, "allows bilinear filtering of stretching. Depending on your video card and the window size, this may result in a lower framerate.");
|
||||
AddBoolC("Stretch:LocalVidMem", GUI.LocalVidMem, true, "determines the location of video memory in DirectDraw mode. May increase or decrease rendering performance, depending on your setup and which filter and stretching options are active.");
|
||||
AddBool("Fullscreen:Enabled", GUI.FullScreen, false);
|
||||
AddUInt("Fullscreen:Width", GUI.FullscreenMode.width, 640);
|
||||
|
|
|
@ -2220,7 +2220,7 @@ LRESULT CALLBACK WinProc(
|
|||
WinRefreshDisplay();
|
||||
break;
|
||||
case ID_WINDOW_BILINEAR:
|
||||
GUI.BilinearFilter = !GUI.BilinearFilter;
|
||||
Settings.BilinearFilter = !Settings.BilinearFilter;
|
||||
WinDisplayApplyChanges();
|
||||
WinRefreshDisplay();
|
||||
break;
|
||||
|
@ -3831,7 +3831,7 @@ static void CheckMenuStates ()
|
|||
mii.fState = GUI.Stretch ? (GUI.AspectRatio ? MFS_CHECKED : MFS_UNCHECKED) : MFS_CHECKED|MFS_DISABLED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_WINDOW_ASPECTRATIO, FALSE, &mii);
|
||||
|
||||
mii.fState = GUI.BilinearFilter ? MFS_CHECKED : MFS_UNCHECKED;
|
||||
mii.fState = Settings.BilinearFilter ? MFS_CHECKED : MFS_UNCHECKED;
|
||||
if(!GUI.Stretch)
|
||||
mii.fState |= MFS_DISABLED;
|
||||
SetMenuItemInfo (GUI.hMenu, ID_WINDOW_BILINEAR, FALSE, &mii);
|
||||
|
@ -7357,7 +7357,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
prevScaleHiRes = GUI.ScaleHiRes;
|
||||
prevPPL = GFX.RealPPL;
|
||||
prevStretch = GUI.Stretch;
|
||||
prevBilinearFilter = GUI.BilinearFilter;
|
||||
prevBilinearFilter = Settings.BilinearFilter;
|
||||
prevAspectRatio = GUI.AspectRatio;
|
||||
prevAspectWidth = GUI.AspectWidth;
|
||||
prevHeightExtend = GUI.HeightExtend;
|
||||
|
@ -7422,7 +7422,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
SendDlgItemMessage(hDlg, IDC_FULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||
if (GUI.EmulateFullscreen)
|
||||
SendDlgItemMessage(hDlg, IDC_EMUFULLSCREEN, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||
if (GUI.BilinearFilter)
|
||||
if (Settings.BilinearFilter)
|
||||
SendDlgItemMessage(hDlg, IDC_BILINEAR, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||
if (Settings.DisplayFrameRate)
|
||||
SendDlgItemMessage(hDlg, IDC_SHOWFPS, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
|
||||
|
@ -7522,7 +7522,7 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
|
||||
case IDC_BILINEAR:
|
||||
|
||||
GUI.BilinearFilter = (bool)(IsDlgButtonChecked(hDlg,IDC_BILINEAR)==BST_CHECKED);
|
||||
Settings.BilinearFilter = (bool)(IsDlgButtonChecked(hDlg,IDC_BILINEAR)==BST_CHECKED);
|
||||
|
||||
//// refresh screen, so the user can see the new stretch mode
|
||||
WinDisplayApplyChanges();
|
||||
|
@ -7766,7 +7766,7 @@ updateFilterBox2:
|
|||
case IDOK:
|
||||
bool fullscreenWanted;
|
||||
Settings.Transparency = IsDlgButtonChecked(hDlg, IDC_TRANS);
|
||||
GUI.BilinearFilter = (bool)(IsDlgButtonChecked(hDlg,IDC_BILINEAR)==BST_CHECKED);
|
||||
Settings.BilinearFilter = (bool)(IsDlgButtonChecked(hDlg,IDC_BILINEAR)==BST_CHECKED);
|
||||
if(!GUI.FullScreen || (GUI.FullscreenMode.width >= 512 && GUI.FullscreenMode.height >= 478) || GUI.Stretch)
|
||||
Settings.SupportHiRes = IsDlgButtonChecked(hDlg, IDC_HIRES);
|
||||
else
|
||||
|
@ -7848,7 +7848,7 @@ updateFilterBox2:
|
|||
GFX.RealPPL = prevPPL;
|
||||
GUI.Stretch = prevStretch;
|
||||
Settings.AutoDisplayMessages = prevAutoDisplayMessages;
|
||||
GUI.BilinearFilter = prevBilinearFilter;
|
||||
Settings.BilinearFilter = prevBilinearFilter;
|
||||
GUI.AspectRatio = prevAspectRatio;
|
||||
GUI.AspectWidth = prevAspectWidth;
|
||||
GUI.HeightExtend = prevHeightExtend;
|
||||
|
|
|
@ -331,7 +331,6 @@ struct sGUI {
|
|||
bool AlwaysCenterImage;
|
||||
bool EmulateFullscreen;
|
||||
bool EmulatedFullscreen;
|
||||
bool BilinearFilter;
|
||||
bool LocalVidMem;
|
||||
bool Vsync;
|
||||
bool ReduceInputLag;
|
||||
|
|
Loading…
Reference in New Issue