diff --git a/desmume/src/NDSSystem.h b/desmume/src/NDSSystem.h index e13970b8a..0cdec23ab 100755 --- a/desmume/src/NDSSystem.h +++ b/desmume/src/NDSSystem.h @@ -533,8 +533,8 @@ extern struct TCommonSettings , GFX3D_LineHack(true) , GFX3D_Renderer_Multisample(false) , GFX3D_Renderer_TextureScalingFactor(1) // Possible values: 1, 2, 4 - , GFX3D_Renderer_AntiAliasingSamples(16) // Possible values: 4, 8, 16 - , GFX3D_Renderer_AntiAliasingForce(false) + , GFX3D_Renderer_AntiAliasingSamples(8) // Possible values: 2, 4, 8 + , GFX3D_Renderer_AntiAliasingLimit(false) , GFX3D_Renderer_TextureDeposterize(false) , GFX3D_Renderer_TextureSmoothing(false) , GFX3D_TXTHack(false) @@ -594,8 +594,8 @@ extern struct TCommonSettings bool GFX3D_LineHack; bool GFX3D_Renderer_Multisample; int GFX3D_Renderer_TextureScalingFactor; //must be one of {1,2,4} - int GFX3D_Renderer_AntiAliasingSamples; //must be one of {4,8,16} - bool GFX3D_Renderer_AntiAliasingForce; + int GFX3D_Renderer_AntiAliasingSamples; //must be one of {2,4,8} + bool GFX3D_Renderer_AntiAliasingLimit; bool GFX3D_Renderer_TextureDeposterize; bool GFX3D_Renderer_TextureSmoothing; bool GFX3D_TXTHack; diff --git a/desmume/src/OGLRender.cpp b/desmume/src/OGLRender.cpp index ed027e34f..0860abb71 100755 --- a/desmume/src/OGLRender.cpp +++ b/desmume/src/OGLRender.cpp @@ -1481,24 +1481,25 @@ GLsizei OpenGLRenderer::GetLimitedMultisampleSize() const GLsizei maxMultisamples = OGLMaxMultisamples_Tier1; if ( (this->_framebufferWidth <= GPU_FRAMEBUFFER_NATIVE_WIDTH * OGLMaxMultisamplesScaleLimit_Tier1) && - (this->_framebufferHeight <= GPU_FRAMEBUFFER_NATIVE_HEIGHT * OGLMaxMultisamplesScaleLimit_Tier1) && CommonSettings.GFX3D_Renderer_AntiAliasingForce == false ) + (this->_framebufferHeight <= GPU_FRAMEBUFFER_NATIVE_HEIGHT * OGLMaxMultisamplesScaleLimit_Tier1) && CommonSettings.GFX3D_Renderer_AntiAliasingLimit == false ) { maxMultisamples = OGLMaxMultisamples_Tier1; } else if ( (this->_framebufferWidth <= GPU_FRAMEBUFFER_NATIVE_WIDTH * OGLMaxMultisamplesScaleLimit_Tier2) && - (this->_framebufferHeight <= GPU_FRAMEBUFFER_NATIVE_HEIGHT * OGLMaxMultisamplesScaleLimit_Tier2) && - ((CommonSettings.GFX3D_Renderer_AntiAliasingForce && CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 16) || - CommonSettings.GFX3D_Renderer_AntiAliasingForce == false) ) + (this->_framebufferHeight <= GPU_FRAMEBUFFER_NATIVE_HEIGHT * OGLMaxMultisamplesScaleLimit_Tier2) && CommonSettings.GFX3D_Renderer_AntiAliasingLimit == false ) { maxMultisamples = OGLMaxMultisamples_Tier2; } else if ( (this->_framebufferWidth <= GPU_FRAMEBUFFER_NATIVE_WIDTH * OGLMaxMultisamplesScaleLimit_Tier3) && (this->_framebufferHeight <= GPU_FRAMEBUFFER_NATIVE_HEIGHT * OGLMaxMultisamplesScaleLimit_Tier3) && - ((CommonSettings.GFX3D_Renderer_AntiAliasingForce && CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 8) || - CommonSettings.GFX3D_Renderer_AntiAliasingForce == false) ) + ((CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 8) || CommonSettings.GFX3D_Renderer_AntiAliasingLimit == false) ) { maxMultisamples = OGLMaxMultisamples_Tier3; } + else if (CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 2) + { + maxMultisamples = 2; // Only used when manually limiting. + } else { maxMultisamples = OGLMaxMultisamples_Tier4; diff --git a/desmume/src/OGLRender.h b/desmume/src/OGLRender.h index 9d095a581..9fde221b4 100755 --- a/desmume/src/OGLRender.h +++ b/desmume/src/OGLRender.h @@ -287,7 +287,7 @@ enum OGLMaxMultisamples OGLMaxMultisamples_Tier1 = 32, OGLMaxMultisamples_Tier2 = 16, OGLMaxMultisamples_Tier3 = 8, - OGLMaxMultisamples_Tier4 = 4, + OGLMaxMultisamples_Tier4 = 4 }; enum OGLMaxMultisamplesScaleLimit diff --git a/desmume/src/frontend/windows/main.cpp b/desmume/src/frontend/windows/main.cpp index cf343ff8e..607308675 100755 --- a/desmume/src/frontend/windows/main.cpp +++ b/desmume/src/frontend/windows/main.cpp @@ -2374,8 +2374,8 @@ int _main() CommonSettings.GFX3D_Texture = GetPrivateProfileBool("3D", "EnableTexture", 1, IniName); CommonSettings.GFX3D_LineHack = GetPrivateProfileBool("3D", "EnableLineHack", 1, IniName); CommonSettings.GFX3D_Renderer_Multisample = GetPrivateProfileBool("3D", "EnableAntiAliasing", 0, IniName); - CommonSettings.GFX3D_Renderer_AntiAliasingForce = GetPrivateProfileBool("3D", "AntiAliasingForce", 0, IniName); - CommonSettings.GFX3D_Renderer_AntiAliasingSamples = GetPrivateProfileInt("3D", "AntiAliasingSamples", 16, IniName); + CommonSettings.GFX3D_Renderer_AntiAliasingLimit = GetPrivateProfileBool("3D", "AntiAliasingLimit", 0, IniName); + CommonSettings.GFX3D_Renderer_AntiAliasingSamples = GetPrivateProfileInt("3D", "AntiAliasingSamples", 8, IniName); CommonSettings.GFX3D_TXTHack = GetPrivateProfileBool("3D", "EnableTXTHack", 0, IniName); //default is off. Change3DCoreWithFallbackAndSave(cur3DCore); @@ -5669,10 +5669,10 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) CheckDlgButton(hw,IDC_3DSETTINGS_TEXTURE,CommonSettings.GFX3D_Texture); CheckDlgButton(hw,IDC_3DSETTINGS_LINEHACK, CommonSettings.GFX3D_LineHack); CheckDlgButton(hw,IDC_3DSETTINGS_ANTIALIASING, CommonSettings.GFX3D_Renderer_Multisample); - CheckDlgButton(hw,IDC_MSAA_FORCE, CommonSettings.GFX3D_Renderer_AntiAliasingForce); - CheckDlgButton(hw,IDC_MSAA_SAMPLES_4, CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 4); + CheckDlgButton(hw,IDC_MSAA_LIMIT, CommonSettings.GFX3D_Renderer_AntiAliasingLimit); CheckDlgButton(hw,IDC_MSAA_SAMPLES_8, CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 8); - CheckDlgButton(hw,IDC_MSAA_SAMPLES_16, CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 16); + CheckDlgButton(hw,IDC_MSAA_SAMPLES_4, CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 4); + CheckDlgButton(hw,IDC_MSAA_SAMPLES_2, CommonSettings.GFX3D_Renderer_AntiAliasingSamples == 2); CheckDlgButton(hw,IDC_TXTHACK, CommonSettings.GFX3D_TXTHack); CheckDlgButton(hw,IDC_TEXSCALE_1, CommonSettings.GFX3D_Renderer_TextureScalingFactor == 1); @@ -5688,22 +5688,22 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) if(CommonSettings.GFX3D_Renderer_Multisample == false) { - cur = GetDlgItem(hw, IDC_MSAA_FORCE); - EnableWindow(cur, FALSE); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); + cur = GetDlgItem(hw, IDC_MSAA_LIMIT); EnableWindow(cur, FALSE); cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_8); EnableWindow(cur, FALSE); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_16); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); + EnableWindow(cur, FALSE); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_2); EnableWindow(cur, FALSE); } - else if(CommonSettings.GFX3D_Renderer_Multisample && CommonSettings.GFX3D_Renderer_AntiAliasingForce == false) + else if(CommonSettings.GFX3D_Renderer_Multisample && CommonSettings.GFX3D_Renderer_AntiAliasingLimit == false) { - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); - EnableWindow(cur, FALSE); cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_8); EnableWindow(cur, FALSE); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_16); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); + EnableWindow(cur, FALSE); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_2); EnableWindow(cur, FALSE); } @@ -5730,7 +5730,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) CommonSettings.GFX3D_Texture = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_TEXTURE); CommonSettings.GFX3D_LineHack = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_LINEHACK); CommonSettings.GFX3D_Renderer_Multisample = IsDlgCheckboxChecked(hw,IDC_3DSETTINGS_ANTIALIASING); - CommonSettings.GFX3D_Renderer_AntiAliasingForce = IsDlgCheckboxChecked(hw,IDC_MSAA_FORCE); + CommonSettings.GFX3D_Renderer_AntiAliasingLimit = IsDlgCheckboxChecked(hw,IDC_MSAA_LIMIT); CommonSettings.GFX3D_TXTHack = IsDlgCheckboxChecked(hw,IDC_TXTHACK); int newPrescaleHD = video.prescaleHD; @@ -5740,9 +5740,9 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) newPrescaleHD = LOWORD(scaleResult); } - if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_4)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 4; - else if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_8)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 8; - else if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_16)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 16; + if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_8)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 8; + else if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_4)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 4; + else if(IsDlgCheckboxChecked(hw,IDC_MSAA_SAMPLES_2)) CommonSettings.GFX3D_Renderer_AntiAliasingSamples = 2; if(IsDlgCheckboxChecked(hw,IDC_TEXSCALE_1)) CommonSettings.GFX3D_Renderer_TextureScalingFactor = 1; else if(IsDlgCheckboxChecked(hw,IDC_TEXSCALE_2)) CommonSettings.GFX3D_Renderer_TextureScalingFactor = 2; @@ -5779,7 +5779,7 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) WritePrivateProfileInt ("3D", "EnableLineHack", CommonSettings.GFX3D_LineHack, IniName); WritePrivateProfileInt ("3D", "EnableAntiAliasing", CommonSettings.GFX3D_Renderer_Multisample, IniName); WritePrivateProfileInt ("3D", "AntiAliasingSamples", CommonSettings.GFX3D_Renderer_AntiAliasingSamples, IniName); - WritePrivateProfileBool("3D", "AntiAliasingForce", CommonSettings.GFX3D_Renderer_AntiAliasingForce, IniName); + WritePrivateProfileBool("3D", "AntiAliasingLimit", CommonSettings.GFX3D_Renderer_AntiAliasingLimit, IniName); WritePrivateProfileInt ("3D", "EnableTXTHack", CommonSettings.GFX3D_TXTHack, IniName); WritePrivateProfileInt ("3D", "PrescaleHD", video.prescaleHD, IniName); WritePrivateProfileInt ("3D", "TextureScalingFactor", CommonSettings.GFX3D_Renderer_TextureScalingFactor, IniName); @@ -5797,29 +5797,29 @@ LRESULT CALLBACK GFX3DSettingsDlgProc(HWND hw, UINT msg, WPARAM wp, LPARAM lp) HWND cur; BOOL enable = IsDlgButtonChecked(hw, IDC_3DSETTINGS_ANTIALIASING); - cur = GetDlgItem(hw, IDC_MSAA_FORCE); + cur = GetDlgItem(hw, IDC_MSAA_LIMIT); EnableWindow(cur, enable); - if (CommonSettings.GFX3D_Renderer_AntiAliasingForce) + if (CommonSettings.GFX3D_Renderer_AntiAliasingLimit) { - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); - EnableWindow(cur, enable); cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_8); EnableWindow(cur, enable); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_16); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); + EnableWindow(cur, enable); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_2); EnableWindow(cur, enable); } } return TRUE; - case IDC_MSAA_FORCE: + case IDC_MSAA_LIMIT: { HWND cur; - BOOL enable = IsDlgButtonChecked(hw, IDC_MSAA_FORCE); + BOOL enable = IsDlgButtonChecked(hw, IDC_MSAA_LIMIT); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); - EnableWindow(cur, enable); cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_8); EnableWindow(cur, enable); - cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_16); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_4); + EnableWindow(cur, enable); + cur = GetDlgItem(hw, IDC_MSAA_SAMPLES_2); EnableWindow(cur, enable); } return TRUE; diff --git a/desmume/src/frontend/windows/resource.h b/desmume/src/frontend/windows/resource.h index b50c27b07..b5ad3e761 100644 --- a/desmume/src/frontend/windows/resource.h +++ b/desmume/src/frontend/windows/resource.h @@ -504,10 +504,10 @@ #define IDC_S4X 1091 #define IDC_S8X 1092 #define IDC_S16X 1093 -#define IDC_MSAA_SAMPLES_4 1094 -#define IDC_MSAA_SAMPLES_8 1095 -#define IDC_MSAA_SAMPLES_16 1096 -#define IDC_MSAA_FORCE 1097 +#define IDC_MSAA_SAMPLES_2 1094 +#define IDC_MSAA_SAMPLES_4 1095 +#define IDC_MSAA_SAMPLES_8 1096 +#define IDC_MSAA_LIMIT 1097 #define IDM_FIRMSETTINGS 1100 #define IDD_FIRMSETTINGS 1101 #define IDC_EDIT1 1102 diff --git a/desmume/src/frontend/windows/resources.rc b/desmume/src/frontend/windows/resources.rc index 3bdd54bc3..ecf532721 100644 --- a/desmume/src/frontend/windows/resources.rc +++ b/desmume/src/frontend/windows/resources.rc @@ -123,10 +123,10 @@ BEGIN CONTROL "Enable Textures",IDC_3DSETTINGS_TEXTURE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,200,140,67,10 CONTROL "Enable Multisample Antialiasing",IDC_3DSETTINGS_ANTIALIASING, "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,151,114,10 - CONTROL "Force Max MSAA Samples",IDC_MSAA_FORCE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,161,99,10 - CONTROL "4x Max Samples",IDC_MSAA_SAMPLES_4,"Button",BS_AUTORADIOBUTTON,13,171,79,10 - CONTROL "8x Max Samples",IDC_MSAA_SAMPLES_8,"Button",BS_AUTORADIOBUTTON,13,180,79,10 - CONTROL "16x Max Samples",IDC_MSAA_SAMPLES_16,"Button",BS_AUTORADIOBUTTON,13,190,79,10 + CONTROL "Limit MSAA Samples",IDC_MSAA_LIMIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,161,90,10 + CONTROL "8x Samples",IDC_MSAA_SAMPLES_8,"Button",BS_AUTORADIOBUTTON,13,171,74,10 + CONTROL "4x Samples",IDC_MSAA_SAMPLES_4,"Button",BS_AUTORADIOBUTTON,13,180,74,10 + CONTROL "2x Samples",IDC_MSAA_SAMPLES_2,"Button",BS_AUTORADIOBUTTON,13,190,74,10 EDITTEXT IDC_TEXT_PRESCALEHD,267,16,20,14,ES_AUTOHSCROLL CONTROL "",IDC_NUD_PRESCALEHD,"msctls_updown32",UDS_SETBUDDYINT | UDS_AUTOBUDDY | UDS_ARROWKEYS,286,16,11,14 PUSHBUTTON "Default",IDC_DEFAULT,196,195,50,14,BS_VCENTER