use startindex/endindex since I've already calculated those...

This commit is contained in:
atravita-mods 2022-08-22 23:44:07 -04:00 committed by Jesse Plamondon-Willard
parent c1d5d19e43
commit 09fd12ddfe
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
1 changed files with 3 additions and 4 deletions

View File

@ -207,7 +207,6 @@ namespace StardewModdingAPI.Framework.Content
// Update target rectangle // Update target rectangle
targetArea = new(targetArea.X, targetArea.Y + topoffset, targetArea.Width, bottomoffset - topoffset + 1); targetArea = new(targetArea.X, targetArea.Y + topoffset, targetArea.Width, bottomoffset - topoffset + 1);
pixelCount = targetArea.Width * targetArea.Height; pixelCount = targetArea.Width * targetArea.Height;
int sourceoffset = topoffset * sourceArea.Width; int sourceoffset = topoffset * sourceArea.Width;
@ -217,11 +216,11 @@ namespace StardewModdingAPI.Framework.Content
target.GetData(0, targetArea, mergedData, 0, pixelCount); target.GetData(0, targetArea, mergedData, 0, pixelCount);
// merge pixels // merge pixels
for (int i = 0; i < pixelCount; i++) for (int i = startIndex; i <= endIndex; i++)
{ {
// ref locals here? Not sure. // ref locals here? Not sure.
Color above = sourceData[sourceoffset + i]; Color above = sourceData[i];
Color below = mergedData[i]; Color below = mergedData[i - sourceoffset];
// shortcut transparency // shortcut transparency
if (above.A < MinOpacity) if (above.A < MinOpacity)