Changes

Line 478: Line 478:  
IRawTextureData image = this.Helper.ModContent.Load<IRawTextureData>("assets/image.png");
 
IRawTextureData image = this.Helper.ModContent.Load<IRawTextureData>("assets/image.png");
   −
for (int i = 0; i < image.Data.Length; i++)
+
int pixelCount = image.Width * image.Height;
 +
for (int i = 0; i < pixelCount; i++)
 
{
 
{
 
     Color color = image.Data[i];
 
     Color color = image.Data[i];
Line 488: Line 489:  
}
 
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
(Note: while SMAPI's implementation of IRawTextureData is exactly as long as it needs to be, this may not be the case for implementations of IRawTextureData from mods.)
    
===Compare asset names===
 
===Compare asset names===
528

edits