diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-10-09 22:10:42 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2018-10-09 22:10:42 -0400 |
commit | 5940f3283e7b06acae1873963d583f0d43487f94 (patch) | |
tree | 1665b940f9bf95b0f30f1998ad7bf8704fd3ad08 /src/SMAPI/Framework/Content/AssetDataForImage.cs | |
parent | 4814d11488132ba0b938abe3854afb314c9194e7 (diff) | |
download | SMAPI-5940f3283e7b06acae1873963d583f0d43487f94.tar.gz SMAPI-5940f3283e7b06acae1873963d583f0d43487f94.tar.bz2 SMAPI-5940f3283e7b06acae1873963d583f0d43487f94.zip |
fix compile error on Linux/Mac
Diffstat (limited to 'src/SMAPI/Framework/Content/AssetDataForImage.cs')
-rw-r--r-- | src/SMAPI/Framework/Content/AssetDataForImage.cs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/Content/AssetDataForImage.cs b/src/SMAPI/Framework/Content/AssetDataForImage.cs index a8ec79a8..f970762a 100644 --- a/src/SMAPI/Framework/Content/AssetDataForImage.cs +++ b/src/SMAPI/Framework/Content/AssetDataForImage.cs @@ -86,12 +86,14 @@ namespace StardewModdingAPI.Framework.Content // This performs a conventional alpha blend for the pixels, which are already // premultiplied by the content pipeline. The formula is derived from // https://blogs.msdn.microsoft.com/shawnhar/2009/11/06/premultiplied-alpha/. + // Note: don't use named arguments here since they're different between + // Linux/Mac and Windows. float alphaBelow = 1 - (above.A / 255f); newData[i] = new Color( - r: (int)(above.R + (below.R * alphaBelow)), - g: (int)(above.G + (below.G * alphaBelow)), - b: (int)(above.B + (below.B * alphaBelow)), - a: Math.Max(above.A, below.A) + (int)(above.R + (below.R * alphaBelow)), // r + (int)(above.G + (below.G * alphaBelow)), // g + (int)(above.B + (below.B * alphaBelow)), // b + Math.Max(above.A, below.A) // a ); } sourceData = newData; |