mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-04 06:39:09 +08:00
[libgdx] Disallow creating a timeline with 0 frames.
This commit is contained in:
parent
39063c5d37
commit
eac42ae50a
@ -883,6 +883,7 @@ public class Animation {
|
|||||||
final String[] attachmentNames;
|
final String[] attachmentNames;
|
||||||
|
|
||||||
public AttachmentTimeline (int frameCount) {
|
public AttachmentTimeline (int frameCount) {
|
||||||
|
if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount);
|
||||||
frames = new float[frameCount];
|
frames = new float[frameCount];
|
||||||
attachmentNames = new String[frameCount];
|
attachmentNames = new String[frameCount];
|
||||||
}
|
}
|
||||||
@ -1197,6 +1198,7 @@ public class Animation {
|
|||||||
private final Event[] events;
|
private final Event[] events;
|
||||||
|
|
||||||
public EventTimeline (int frameCount) {
|
public EventTimeline (int frameCount) {
|
||||||
|
if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount);
|
||||||
frames = new float[frameCount];
|
frames = new float[frameCount];
|
||||||
events = new Event[frameCount];
|
events = new Event[frameCount];
|
||||||
}
|
}
|
||||||
@ -1263,6 +1265,7 @@ public class Animation {
|
|||||||
private final int[][] drawOrders;
|
private final int[][] drawOrders;
|
||||||
|
|
||||||
public DrawOrderTimeline (int frameCount) {
|
public DrawOrderTimeline (int frameCount) {
|
||||||
|
if (frameCount <= 0) throw new IllegalArgumentException("frameCount must be > 0: " + frameCount);
|
||||||
frames = new float[frameCount];
|
frames = new float[frameCount];
|
||||||
drawOrders = new int[frameCount][];
|
drawOrders = new int[frameCount][];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user