MSAA: Store samples in ini files.

This commit is contained in:
degasus
2015-12-12 13:00:08 +01:00
parent cc3dc05438
commit e26d9f7c35
12 changed files with 68 additions and 91 deletions

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <algorithm>
#include <map>
#include <string>
#include <utility>
@ -772,11 +773,11 @@ void VideoConfigDiag::PopulateAAList()
}
}
int selected_mode_index = vconfig.iMultisampleMode;
int selected_mode_index = 0;
// Don't go out of range
if (selected_mode_index >= aa_modes.size())
return;
auto index = std::find(aa_modes.begin(), aa_modes.end(), vconfig.iMultisamples);
if (index != aa_modes.end())
selected_mode_index = index - aa_modes.begin();
// Select one of the SSAA modes at the end of the list if SSAA is enabled
if (supports_ssaa && vconfig.bSSAA && aa_modes[selected_mode_index] != 1)
@ -787,11 +788,14 @@ void VideoConfigDiag::PopulateAAList()
void VideoConfigDiag::OnAAChanged(wxCommandEvent& ev)
{
int mode = ev.GetInt();
size_t mode = ev.GetInt();
ev.Skip();
vconfig.bSSAA = mode > m_msaa_modes;
mode -= vconfig.bSSAA * m_msaa_modes;
vconfig.iMultisampleMode = mode;
if (mode >= vconfig.backend_info.AAModes.size())
return;
vconfig.iMultisamples = vconfig.backend_info.AAModes[mode];
}