Android: Add MSAA to enhancements

This commit is contained in:
Connor McLaughlin 2020-11-03 15:05:21 +10:00
parent 2c8a4ff154
commit d16b5a6721
4 changed files with 40 additions and 3 deletions

View File

@ -5,6 +5,7 @@
#include "common/file_system.h"
#include "common/log.h"
#include "common/string.h"
#include "common/string_util.h"
#include "common/timestamp.h"
#include "core/bios.h"
#include "core/cheats.h"
@ -162,11 +163,20 @@ void AndroidHostInterface::SetUserDirectory()
void AndroidHostInterface::LoadSettings()
{
CommonHostInterface::LoadSettings(m_settings_interface);
LoadAndConvertSettings();
CommonHostInterface::FixIncompatibleSettings(false);
CommonHostInterface::UpdateInputMap(m_settings_interface);
}
void AndroidHostInterface::LoadAndConvertSettings()
{
CommonHostInterface::LoadSettings(m_settings_interface);
const std::string msaa_str = m_settings_interface.GetStringValue("GPU", "MSAA", "1");
g_settings.gpu_multisamples = std::max<u32>(StringUtil::FromChars<u32>(msaa_str).value_or(1), 1);
g_settings.gpu_per_sample_shading = StringUtil::EndsWith(msaa_str, "-ssaa");
}
void AndroidHostInterface::UpdateInputMap()
{
CommonHostInterface::UpdateInputMap(m_settings_interface);
@ -538,7 +548,7 @@ void AndroidHostInterface::RefreshGameList(bool invalidate_cache, bool invalidat
void AndroidHostInterface::ApplySettings(bool display_osd_messages)
{
Settings old_settings = std::move(g_settings);
CommonHostInterface::LoadSettings(m_settings_interface);
LoadAndConvertSettings();
CommonHostInterface::FixIncompatibleSettings(display_osd_messages);
// Defer renderer changes, the app really doesn't like it.

View File

@ -73,6 +73,8 @@ private:
void CreateImGuiContext();
void DestroyImGuiContext();
void LoadAndConvertSettings();
jobject m_java_object = {};
jobject m_emulation_activity_object = {};

View File

@ -245,4 +245,22 @@
<item>Controllers</item>
<item>Advanced</item>
</string-array>
<string-array name="settings_gpu_msaa_entries">
<item>Disabled</item>
<item>2x MSAA</item>
<item>4x MSAA</item>
<item>8x MSAA</item>
<item>2x SSAA</item>
<item>4x SSAA</item>
<item>8x SSAA</item>
</string-array>
<string-array name="settings_gpu_msaa_values">
<item>1</item>
<item>2</item>
<item>4</item>
<item>8</item>
<item>2-ssaa</item>
<item>4-ssaa</item>
<item>8-ssaa</item>
</string-array>
</resources>

View File

@ -39,7 +39,14 @@
app:defaultValue="1"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<ListPreference
app:key="GPU/MSAA"
app:title="Multisample Antialiasing"
app:entries="@array/settings_gpu_msaa_entries"
app:entryValues="@array/settings_gpu_msaa_values"
app:defaultValue="1"
app:useSimpleSummaryProvider="true"
app:iconSpaceReserved="false" />
<SwitchPreferenceCompat
app:key="GPU/TrueColor"
app:title="True Color Rendering (24-bit, disables dithering)"