Null safety, fix event log spam, increse sorting index

This commit is contained in:
Raven Szewczyk committed 2023-01-15 13:41:01 +00:00
1 parent 846be6551d
commit 717445786d
3 files changed
+13 -2

No files matched your search

@@ -10,6 +10,7 @@ class EventQueue {
private int eventCount = 0;
private int currentEventPos = -1;
private int nextEventPos = 0;
private long lastDroppedMessageMs = 0;
EventQueue(int maxEvents) {
this.maxEvents = maxEvents;
@@ -22,7 +23,11 @@ class EventQueue {
eventCount++; // increment event count
if (eventCount > maxEvents) {
eventCount = maxEvents; // cap max events
System.out.println("Dropping LWJGL input events due to not frequent enough polling");
long ms = System.currentTimeMillis();
if (ms - lastDroppedMessageMs > 1000) {
lastDroppedMessageMs = ms;
System.out.println("Dropping LWJGL input events due to not frequent enough polling");
}
}
nextEventPos++; // increment next event position