Add support for integer scale factor for display

This is mainly useful if you want an authentic pixellated look with 1x
rendering (or software) and nearest display filter. It'll simply round
down the auto-scaled sized to the nearest integer scale factor,
configuring exactly which one isn't that interesting since they all are
gonna look good.

Fixes #17093
This commit is contained in:
Henrik Rydgård
2023-04-02 18:29:57 +02:00
parent f1165bd2ae
commit 2fa93982ea
48 changed files with 66 additions and 9 deletions
+10 -3
View File
@@ -241,14 +241,19 @@ void DisplayLayoutScreen::CreateViews() {
if (!IsVREnabled()) {
auto stretch = new CheckBox(&g_Config.bDisplayStretch, gr->T("Stretch"));
stretch->SetDisabledPtr(&g_Config.bDisplayIntegerScale);
rightColumn->Add(stretch);
PopupSliderChoiceFloat *aspectRatio = new PopupSliderChoiceFloat(&g_Config.fDisplayAspectRatio, 0.5f, 2.0f, gr->T("Aspect Ratio"), screenManager());
rightColumn->Add(aspectRatio);
aspectRatio->SetDisabledPtr(&g_Config.bDisplayStretch);
aspectRatio->SetEnabledFunc([]() {
return !g_Config.bDisplayStretch && !g_Config.bDisplayIntegerScale;
});
aspectRatio->SetHasDropShadow(false);
aspectRatio->SetLiveUpdate(true);
rightColumn->Add(new CheckBox(&g_Config.bDisplayIntegerScale, gr->T("Integer scale factor")));
#if PPSSPP_PLATFORM(ANDROID)
// Hide insets option if no insets, or OS too old.
if (System_GetPropertyInt(SYSPROP_SYSTEMVERSION) >= 28 &&
@@ -295,8 +300,10 @@ void DisplayLayoutScreen::CreateViews() {
leftColumn->Add(new Spacer(24.0f));
}
static const char *bufFilters[] = { "Linear", "Nearest", };
leftColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager()));
if (!IsVREnabled()) {
static const char *bufFilters[] = { "Linear", "Nearest", };
leftColumn->Add(new PopupMultiChoice(&g_Config.iBufFilter, gr->T("Screen Scaling Filter"), bufFilters, 1, ARRAY_SIZE(bufFilters), gr->GetName(), screenManager()));
}
Draw::DrawContext *draw = screenManager()->getDrawContext();