Add a TODO and fix a smol cleanup.

This commit is contained in:
Colin McMillen 2020-03-05 17:39:30 -05:00
parent 3c4e63ada0
commit 53083818c0

View File

@ -64,6 +64,7 @@ namespace SemiColinGames {
child.SelectToken("frame.y").Value<int>(), child.SelectToken("frame.y").Value<int>(),
child.SelectToken("frame.w").Value<int>(), child.SelectToken("frame.w").Value<int>(),
child.SelectToken("frame.h").Value<int>()); child.SelectToken("frame.h").Value<int>());
// TODO: convert all durations to floats.
int durationMs = child.SelectToken("duration").Value<int>(); int durationMs = child.SelectToken("duration").Value<int>();
frames.Add(new Frame(source, durationMs)); frames.Add(new Frame(source, durationMs));
} }
@ -75,7 +76,7 @@ namespace SemiColinGames {
int end = child.SelectToken("to").Value<int>(); int end = child.SelectToken("to").Value<int>();
string directionString = child.SelectToken("direction").Value<string>(); string directionString = child.SelectToken("direction").Value<string>();
AnimationDirection direction = directionString == "pingpong" ? AnimationDirection direction = directionString == "pingpong" ?
AnimationDirection.PingPong: AnimationDirection.Forward; AnimationDirection.PingPong : AnimationDirection.Forward;
int durationMs = 0; int durationMs = 0;
for (int i = start; i <= end; i++) { for (int i = start; i <= end; i++) {
durationMs += frames[i].DurationMs; durationMs += frames[i].DurationMs;