|
@@ -18,7 +18,7 @@ class MainEvent {
|
|
function new(f, p) {
|
|
function new(f, p) {
|
|
this.f = f;
|
|
this.f = f;
|
|
this.priority = p;
|
|
this.priority = p;
|
|
- nextRun = -1;
|
|
|
|
|
|
+ nextRun = Math.NEGATIVE_INFINITY;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -26,7 +26,7 @@ class MainEvent {
|
|
If t is null, the event will be run at tick() time.
|
|
If t is null, the event will be run at tick() time.
|
|
**/
|
|
**/
|
|
public function delay(t:Null<Float>) {
|
|
public function delay(t:Null<Float>) {
|
|
- nextRun = t == null ? -1 : haxe.Timer.stamp() + t;
|
|
|
|
|
|
+ nextRun = t == null ? Math.NEGATIVE_INFINITY : haxe.Timer.stamp() + t;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -169,7 +169,7 @@ class MainLoop {
|
|
while (e != null) {
|
|
while (e != null) {
|
|
var next = e.next;
|
|
var next = e.next;
|
|
var wt = e.nextRun - now;
|
|
var wt = e.nextRun - now;
|
|
- if (e.nextRun < 0 || wt <= 0) {
|
|
|
|
|
|
+ if (wt <= 0) {
|
|
wait = 0;
|
|
wait = 0;
|
|
e.call();
|
|
e.call();
|
|
} else if (wait > wt)
|
|
} else if (wait > wt)
|