summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-20 19:52:52 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-20 19:52:52 -0500
commiteff29d94fbf41f0992ffac7bb5a04a08b71f3453 (patch)
treecd326427f12660a4389c4defac30c55960013a5d
parent2cc786907b2a6cd62691ba2d6514f45a7b46c03c (diff)
downloadSMAPI-eff29d94fbf41f0992ffac7bb5a04a08b71f3453.tar.gz
SMAPI-eff29d94fbf41f0992ffac7bb5a04a08b71f3453.tar.bz2
SMAPI-eff29d94fbf41f0992ffac7bb5a04a08b71f3453.zip
don't premultiply fully opaque pixels
-rw-r--r--docs/release-notes.md1
-rw-r--r--src/SMAPI/Framework/ContentManagers/ModContentManager.cs4
2 files changed, 3 insertions, 2 deletions
diff --git a/docs/release-notes.md b/docs/release-notes.md
index f4067226..ea1f0bfb 100644
--- a/docs/release-notes.md
+++ b/docs/release-notes.md
@@ -3,6 +3,7 @@
# Release notes
## Upcoming release
* For players:
+ * Improved performance for mods which load a large number of images.
* Reduced network traffic for mod broadcasts to players who can't process them.
* Fixed update-check errors for recent versions of SMAPI on Android.
* Updated compatibility list.
diff --git a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
index 6b463424..7d274eb7 100644
--- a/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
+++ b/src/SMAPI/Framework/ContentManagers/ModContentManager.cs
@@ -253,8 +253,8 @@ namespace StardewModdingAPI.Framework.ContentManagers
texture.GetData(data);
for (int i = 0; i < data.Length; i++)
{
- if (data[i].A == 0)
- continue; // no need to change fully transparent pixels
+ if (data[i].A == byte.MinValue || data[i].A == byte.MaxValue)
+ continue; // no need to change fully transparent/opaque pixels
data[i] = Color.FromNonPremultiplied(data[i].ToVector4());
}