Added Config.ForcePlatform

This commit is contained in:
Garry Newman 2016-10-26 15:28:33 +01:00
parent 79bc9ffe24
commit 9756d15468
2 changed files with 37 additions and 15 deletions

View File

@ -18,5 +18,17 @@ public static class Config
/// </summary>
public static bool UseThisCall { get; set; } = true;
/// <summary>
/// You can force the platform to a particular one here.
/// This is useful if you're on OSX because some versions of mono don't have a way
/// to tell which platform we're running
/// </summary>
public static void ForcePlatform( SteamNative.OperatingSystem os, SteamNative.Architecture arch )
{
SteamNative.Platform.Os = os;
SteamNative.Platform.Arch = arch;
}
}
}

View File

@ -3,9 +3,7 @@
namespace SteamNative
{
internal static partial class Platform
{
internal enum OperatingSystem
public enum OperatingSystem
{
Unset,
Windows,
@ -13,13 +11,15 @@ internal enum OperatingSystem
Osx,
}
internal enum Architecture
public enum Architecture
{
Unset,
x86,
x64
}
internal static partial class Platform
{
private static OperatingSystem _os;
private static Architecture _arch;
@ -49,6 +49,11 @@ internal static OperatingSystem Os
return _os;
}
set
{
_os = value;
}
}
internal static Architecture Arch
@ -70,6 +75,11 @@ internal static Architecture Arch
return _arch;
}
set
{
_arch = value;
}
}
public static bool IsWindows64 { get { return Arch == Architecture.x64 && Os == OperatingSystem.Windows; } }