Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calinou add ultrawidescreen adjust from 16 9 #2816

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ struct Config
aStretch = 0,
a43 = 1,
a169 = 2,
aAdjust = 3,
aTotal = 4
aAdjust43 = 3,
aAdjust169 = 4,
aTotal = 5
};

enum CopyToRDRAM {
Expand Down
11 changes: 10 additions & 1 deletion src/DisplayWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void DisplayWindow::_setBufferSize()
m_height = m_screenHeight;
}
break;
case Config::aAdjust: // adjust
case Config::aAdjust43: // adjust
m_width = m_screenWidth;
m_height = m_screenHeight;
if (m_screenWidth * 3 / 4 > m_screenHeight) {
Expand All @@ -183,6 +183,15 @@ void DisplayWindow::_setBufferSize()
m_bAdjustScreen = true;
}
break;
case Config::aAdjust169: // adjust
m_width = m_screenWidth;
m_height = m_screenHeight;
if (m_screenWidth * 9 / 16 > m_screenHeight) {
f32 width169 = m_screenHeight * 16.0f / 9.0f;
m_adjustScale = width169 / m_screenWidth;
m_bAdjustScreen = true;
}
break;
default:
assert(false && "Unknown aspect ratio");
m_width = m_screenWidth;
Expand Down
5 changes: 3 additions & 2 deletions src/GLideNUI-wtl/Language.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ void LoadDefaultStrings(void)
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_WINDOWED_RESOLUTION, "Windowed resolution:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_WINDOWED_RESOLUTION_TOOLTIP, "This option selects the resolution for windowed mode. You can also type in a custom window size.\n\n[Recommended: 640 x 480, 800 x 600, 1024 x 768, 1280 x 960]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_RATIO, "Aspect ratio:"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_RATIO_TOOLTIP, "This setting adjusts the aspect ratio of the video output. All N64 games support 4:3. Some games support 16:9 within game settings. Use Stretch to fill the screen without pillar or letterboxing.\n\nTry to adjust game to fit tries to adjust the viewing space to fit without stretching. Many games work well adjusted, but some don't."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_RATIO_TOOLTIP, "This setting adjusts the aspect ratio of the video output. All N64 games support 4:3. Some games support 16:9 within game settings. Use Stretch to fill the screen without pillar or letterboxing.\n\nTry to adjust 4:3 game to fit (also known as \"widescreen hack\") tries to adjust the viewing space to fit a game designed for 4:3 without stretching. Many games work well adjusted, but some don't.\n\nTry to adjust 16:9 game to fit</span> (also known as \"ultrawidescreen hack\") tries to adjust the viewing space to fit a game designed for 16:9 without stretching. Many games work well adjusted, but some don't. For games offering native 16:9 options, this is generally preferable for ultrawide aspect ratios as it'll lead to fewer rendering issues."));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_4_3, "4:3 (recommended)"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_16_19, "16:9"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_STRETCH, "Stretch"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_ADJUST, "Try to adjust game to fit"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_ADJUST, "Try to adjust 4:3 game to fit"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_ASPECT_ADJUST, "Try to adjust 16:9 game to fit"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_VSYNC, "Enable VSync"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_VSYNC_TOOLTIP, "Vertical sync, or VSync, can improve the image by syncing the game's frame rate to your monitor's refresh rate. This prevents image tearing, but may cause performance problems.\n\n[Recommended: Usually off, on if you have image tearing problems]"));
g_defaultStrings.insert(LANG_STRINGS::value_type(VIDEO_THREADED_VIDEO, "Enable threaded video"));
Expand Down
6 changes: 4 additions & 2 deletions src/GLideNUI-wtl/config-video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,8 @@ void CVideoTab::LoadSettings(bool /*blockCustomSettings*/) {
case Config::aStretch: aspectComboBox.SetCurSel(2); break;
case Config::a43: aspectComboBox.SetCurSel(0); break;
case Config::a169: aspectComboBox.SetCurSel(1); break;
case Config::aAdjust: aspectComboBox.SetCurSel(3); break;
case Config::aAdjust43: aspectComboBox.SetCurSel(3); break;
case Config::aAdjust169: aspectComboBox.SetCurSel(4); break;
}

CComboBox(GetDlgItem(IDC_CMB_PATTERN)).SetCurSel(config.generalEmulation.rdramImageDitheringMode);
Expand Down Expand Up @@ -522,7 +523,8 @@ void CVideoTab::SaveSettings()
if (AspectIndx == 2) { config.frameBufferEmulation.aspect = Config::aStretch; }
else if (AspectIndx == 0) { config.frameBufferEmulation.aspect = Config::a43; }
else if (AspectIndx == 1) { config.frameBufferEmulation.aspect = Config::a169; }
else if (AspectIndx == 3) { config.frameBufferEmulation.aspect = Config::aAdjust; }
else if (AspectIndx == 3) { config.frameBufferEmulation.aspect = Config::aAdjust43; }
else if (AspectIndx == 4) { config.frameBufferEmulation.aspect = Config::aAdjust169; }

config.video.verticalSync = CButton(GetDlgItem(IDC_CHK_VERTICAL_SYNC)).GetCheck() == BST_CHECKED;
config.video.threadedVideo = CButton(GetDlgItem(IDC_CHK_THREADED_VIDEO)).GetCheck() == BST_CHECKED;
Expand Down
9 changes: 7 additions & 2 deletions src/GLideNUI/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,12 @@ void ConfigDialog::_init(bool reInit, bool blockCustomSettings)
case Config::a169:
ui->aspectComboBox->setCurrentIndex(1);
break;
case Config::aAdjust:
case Config::aAdjust43:
ui->aspectComboBox->setCurrentIndex(3);
break;
case Config::aAdjust169:
ui->aspectComboBox->setCurrentIndex(4);
break;
}

ui->resolutionFactorSpinBox->valueChanged(2);
Expand Down Expand Up @@ -649,7 +652,9 @@ void ConfigDialog::accept(bool justSave) {
else if (ui->aspectComboBox->currentIndex() == 1)
config.frameBufferEmulation.aspect = Config::a169;
else if (ui->aspectComboBox->currentIndex() == 3)
config.frameBufferEmulation.aspect = Config::aAdjust;
config.frameBufferEmulation.aspect = Config::aAdjust43;
else if (ui->aspectComboBox->currentIndex() == 4)
config.frameBufferEmulation.aspect = Config::aAdjust169;

if (ui->factor0xRadioButton->isChecked())
config.frameBufferEmulation.nativeResFactor = 0;
Expand Down
9 changes: 7 additions & 2 deletions src/GLideNUI/configDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
<item>
<widget class="QFrame" name="aspectFrame">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This setting adjusts the aspect ratio of the video output. All N64 games support &lt;span style=&quot; font-weight:600;&quot;&gt;4:3&lt;/span&gt;. Some games support &lt;span style=&quot; font-weight:600;&quot;&gt;16:9&lt;/span&gt; within game settings. Use &lt;span style=&quot; font-weight:600;&quot;&gt;Stretch&lt;/span&gt; to fill the screen without pillar or letterboxing.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Try to adjust game to fit&lt;/span&gt; tries to adjust the viewing space to fit without stretching. Many games work well adjusted, but some don't.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This setting adjusts the aspect ratio of the video output. All N64 games support &lt;span style=&quot; font-weight:600;&quot;&gt;4:3&lt;/span&gt;. Some games support &lt;span style=&quot; font-weight:600;&quot;&gt;16:9&lt;/span&gt; within game settings. Use &lt;span style=&quot; font-weight:600;&quot;&gt;Stretch&lt;/span&gt; to fill the screen without pillar or letterboxing.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Try to adjust 4:3 game to fit&lt;/span&gt; (also known as &quot;widescreen hack&quot;) tries to adjust the viewing space to fit a game designed for 4:3 without stretching. Many games work well adjusted, but some don't.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Try to adjust 16:9 game to fit&lt;/span&gt; (also known as &quot;ultrawidescreen hack&quot;) tries to adjust the viewing space to fit a game designed for 16:9 without stretching. Many games work well adjusted, but some don't. For games offering native 16:9 options, this is generally preferable for ultrawide aspect ratios as it'll lead to fewer rendering issues.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
<property name="spacing">
Expand Down Expand Up @@ -212,7 +212,12 @@
</item>
<item>
<property name="text">
<string extracomment="This option activates a widescreen hack. The language &quot;Try to&quot; implies it may it may not work and the language &quot;adjust game&quot; implies the emulation will be inaccurate.">Try to adjust game to fit</string>
<string extracomment="This option activates a widescreen hack. The language &quot;Try to&quot; implies it may it may not work and the language &quot;adjust 4:3 game&quot; implies the emulation will be inaccurate.">Try to adjust 4:3 game to fit</string>
</property>
</item>
<item>
<property name="text">
<string extracomment="This option activates a widescreen hack. The language &quot;Try to&quot; implies it may it may not work and the language &quot;adjust 16:9 game&quot; implies the emulation will be inaccurate.">Try to adjust 16:9 game to fit</string>
</property>
</item>
</widget>
Expand Down
Loading