Skip to content

Commit

Permalink
Fixed PNG frame count calculation
Browse files Browse the repository at this point in the history
This fixes the order of operations and rounding issue, making it columns * rows.
  • Loading branch information
atlimit8 authored and Mailaender committed May 2, 2020
1 parent f03841c commit f1e8f9c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/SpriteLoaders/PngSheetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void RegionsFromSlices(Png png, out List<Rectangle> regions, out List<float2> of
if (png.EmbeddedData.ContainsKey("FrameAmount"))
frameAmount = FieldLoader.GetValue<int>("FrameAmount", png.EmbeddedData["FrameAmount"]);
else
frameAmount = png.Width / frameSize.Width * png.Height / frameSize.Height;
frameAmount = (png.Width / frameSize.Width) * (png.Height / frameSize.Height);
}
else if (png.EmbeddedData.ContainsKey("FrameAmount"))
{
Expand Down

0 comments on commit f1e8f9c

Please sign in to comment.