Merge pull request #223 from YLahin/master

Fixed Windows x86 build crash on startup
This commit is contained in:
Garry Newman 2018-12-05 10:05:04 +00:00 committed by GitHub
commit fba1986812
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Facepunch.Steamworks
{
@ -18,6 +15,11 @@ public static void ForUnity( string platform )
//
if ( platform == "WindowsEditor" || platform == "WindowsPlayer" )
{
//
// 32bit windows unity uses a stdcall
//
if (IntPtr.Size == 4) UseThisCall = false;
ForcePlatform( OperatingSystem.Windows, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 );
}
@ -31,8 +33,6 @@ public static void ForUnity( string platform )
ForcePlatform( OperatingSystem.Linux, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 );
}
UseThisCall = true;
Console.WriteLine( "Facepunch.Steamworks Unity: " + platform );
Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os );
Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch );
@ -47,7 +47,7 @@ public static void ForUnity( string platform )
/// for releasing his shit open source under the MIT license so we can all learn and iterate.
///
/// </summary>
public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows;
public static bool UseThisCall { get; set; } = true;
/// <summary>