Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
Fix Launcher for AMD cards
Browse files Browse the repository at this point in the history
  • Loading branch information
neatodev committed Apr 10, 2022
1 parent 8a55213 commit 56f5845
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 23 deletions.
13 changes: 12 additions & 1 deletion data/GraphicsWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using NLog;
using NvAPIWrapper.Native.Exceptions;
using System;
using System.IO;

namespace BmLauncherWForm.data
{
Expand Down Expand Up @@ -29,7 +30,17 @@ public void writeAll()
setDynamicShadows();
setFogVolumes();
setFullScreen();
setHbaoPlus();
try
{
setHbaoPlus();
}
catch (FileNotFoundException e)
{
logger.Warn(
"writeAll - could not call setHbaoPlus() - This is fine if you're not using an NVIDIA GPU. Exception: {0}",
e);
}

setLensFlares();
setMaxShadowRes();
setMaxSmoothedFrames();
Expand Down
32 changes: 24 additions & 8 deletions data/GuiInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using NLog;
using NvAPIWrapper.Native.Exceptions;
using System;
using System.IO;

namespace BmLauncherWForm.data
{
Expand Down Expand Up @@ -76,7 +77,20 @@ public void init()
initMaxSmoothedFrames();
initMemoryPoolsValue();
initResolutions();
initHBAONVIDIA();
try
{
initHBAONVIDIA();
}
catch (FileNotFoundException e)
{
Program.Client.amdToolTip.Active = true;
Program.Client.amdToolTip.ShowAlways = true;
Program.Client.nvBox.Enabled = false;
logger.Warn(
"init - could not call initHBAONVIDIA() - This is fine if you're not using an NVIDIA GPU. Exception: {0}",
e);
}

logger.Info("init - initialized all values to the gui.");
}

Expand Down Expand Up @@ -314,6 +328,15 @@ private static void initResolutions()
/// </summary>
private static void initHBAONVIDIA()
{
if (!Program.Client.gpInfoLabel.Text.Contains("NVIDIA"))
{
Program.Client.amdToolTip.Active = true;
Program.Client.amdToolTip.ShowAlways = true;
Program.Client.nvBox.Enabled = false;
logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as false.");
return;
}

if (Program.Client.gpInfoLabel.Text.Contains("NVIDIA") && !WineChecker.IsWine())
{
try
Expand All @@ -336,13 +359,6 @@ private static void initHBAONVIDIA()
logger.Debug(
"initHBAONVIDIA - initialized hbao+ possibility as false. You're using an NVIDIA card on a Linux machine.");
}
else
{
Program.Client.amdToolTip.Active = true;
Program.Client.amdToolTip.ShowAlways = true;
Program.Client.nvBox.Enabled = false;
logger.Debug("initHBAONVIDIA - initialized hbao+ possibility as false.");
}
}
}
}
2 changes: 1 addition & 1 deletion infrastructure/Factory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ private void setGPUname()

if (gpu.Contains("Radeon") || gpu.Contains("AMD") || gpu.Contains("Intel"))
{
gpu = gpu + " (PhysX not recommended)";
gpu += " (PhysX not recommended)";
if (gpu.Contains("Radeon") || gpu.Contains("AMD"))
{
client.gpInfoLabel.ForeColor = Color.Red;
Expand Down
2 changes: 1 addition & 1 deletion ui/BmLauncherForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions ui/BmLauncherForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@
<metadata name="basicToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 19</value>
</metadata>
<metadata name="basicToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>14, 19</value>
</metadata>
<data name="maxSmoothTextBox.ToolTip" xml:space="preserve">
<value>Works like a framerate limiter. The value should be the refresh rate of your screen.

Expand Down Expand Up @@ -185,15 +182,6 @@ Breakable tiles, realistic paper simulation, advanced smoke effects.

</value>
</data>
<metadata name="nvidiaToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>119, 22</value>
</metadata>
<metadata name="amdToolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>238, 25</value>
</metadata>
<metadata name="criticalTooltip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>354, 25</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>79</value>
</metadata>
Expand Down

0 comments on commit 56f5845

Please sign in to comment.