v2.4.0: cleaned up various allocations that occurred every frame
This commit is contained in:
@@ -62,6 +62,10 @@ public class KeyEvent {
|
||||
}
|
||||
|
||||
public static synchronized void processKeyEvents(){
|
||||
if (keyEvents.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (KeyEvent k : keyEvents){
|
||||
if (KeyBindings.getActionForKey(k) == GameAction.LEFT_CLICK){
|
||||
Game.inputHandler.emulateTouch(ControllerHandler.CONTROLLER_POINTER_ID, PointerEvent.LEFT, k.pressed);
|
||||
|
||||
@@ -136,6 +136,10 @@ public class PointerEvent {
|
||||
public static boolean clearKeyboardThisPress = true;
|
||||
|
||||
public static synchronized void processPointerEvents(){
|
||||
if (pointerEvents.isEmpty()){
|
||||
return;
|
||||
}
|
||||
|
||||
//handle any hover events separately first as we may need to add drag events
|
||||
boolean hovered = false;
|
||||
for (PointerEvent p : pointerEvents){
|
||||
|
||||
@@ -62,6 +62,10 @@ public class ScrollEvent {
|
||||
}
|
||||
|
||||
public static synchronized void processScrollEvents(){
|
||||
if (scrollEvents.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (ScrollEvent k : scrollEvents){
|
||||
scrollSignal.dispatch(k);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user