This repository was archived by the owner on Apr 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5454 <Compile Include =" Utilities\FrameUtilities.cs" />
5555 <Compile Include =" Utilities\GIFBuilder.cs" />
5656 </ItemGroup >
57- <ItemGroup >
58- <Folder Include =" Utilities\DataStructures\" />
59- </ItemGroup >
57+ <ItemGroup />
6058 <ItemGroup >
6159 <None Include =" packages.config" />
6260 </ItemGroup >
Original file line number Diff line number Diff line change @@ -14,7 +14,9 @@ public class TextureGIF
1414
1515 public bool IsPaused { get ; private set ; }
1616
17- public bool HasEnded => FrameIndex >= Frames . Length && FrameTick >= TicksPerFrame ;
17+ public bool HasEnded => FrameIndex >= Frames . Length && FrameTick >= TicksPerFrame && ! ShouldLoop ;
18+
19+ public bool ShouldLoop { get ; set ; }
1820
1921 public int TicksPerFrame { get ; set ; }
2022
@@ -60,6 +62,7 @@ public void Stop()
6062 // This essentially sets HasEnded to true.
6163 FrameTick = Frames . Length - 1 ;
6264 FrameTick = TicksPerFrame ;
65+ ShouldLoop = false ;
6366 }
6467
6568 /// <summary>
@@ -139,6 +142,8 @@ public void ForwardTicks(int tickAmount)
139142
140143 if ( FrameIndex < Frames . Length - 1 )
141144 FrameIndex ++ ;
145+ else if ( ShouldLoop )
146+ FrameIndex = 0 ;
142147 }
143148 }
144149 }
You can’t perform that action at this time.
0 commit comments