Skip to content

Commit a516d8b

Browse files
committed
Automatic merge of T1.5.1-799-gb02a6e5d3 and 14 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at a055bca: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #897 at 42f1dd9: feat: Improved system information collection - Pull request #899 at 1a49cc4: Duplex steam engines - Booster Engine addition - Pull request #903 at 6c9da3f: Downloading route content (Github, zip) - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - Pull request #908 at 4b4afe3: feat: supports switching adhesion precisions - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR
16 parents 573c251 + b02a6e5 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + 1a49cc4 + 6c9da3f + 9b0b04f + 4b4afe3 + 6834af0 commit a516d8b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Source/ORTS.Common/SystemInfo.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
using System.Collections.Generic;
2525
using System.Globalization;
2626
using System.Diagnostics;
27+
using SharpDX.DXGI;
2728

2829
namespace ORTS.Common
2930
{
@@ -87,13 +88,16 @@ static SystemInfo()
8788
Trace.WriteLine(error);
8889
}
8990

91+
// The WMI data for AdapterRAM is unreliable, so we have to use DXGI to get the real numbers.
92+
// Alas, DXGI doesn't give us the manufacturer name for the adapter, so we combine it with WMI.
93+
var descriptions = new Factory1().Adapters.Select(adapter => adapter.Description).ToArray();
9094
try
9195
{
9296
GPUs = new ManagementClass("Win32_VideoController").GetInstances().Cast<ManagementObject>().Select(adapter => new GPU
9397
{
9498
Name = (string)adapter["Name"],
9599
Manufacturer = (string)adapter["AdapterCompatibility"],
96-
MemoryMB = (uint?)adapter["AdapterRAM"] / 1024 / 1024 ?? 0,
100+
MemoryMB = (uint)((long)descriptions.FirstOrDefault(desc => desc.Description == (string)adapter["Name"]).DedicatedVideoMemory / 1024 / 1024),
97101
}).ToList();
98102
}
99103
catch (ManagementException error)

0 commit comments

Comments
 (0)