Revert hotswapping controller code for now.

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent e05a25fc80
commit c911caef80
  1. 2
      Java/scripts/md5
  2. 11
      src/sig/RabiClone.java

@ -1,4 +1,4 @@
build.sh:22308eae5fd9c88aa16fef54cf03ae21 - build.sh:bd24d92a5b7f9fa42e98478e5e945b26 -
clean.sh:668a2f9b568c55f6a044a509315032f6 - clean.sh:668a2f9b568c55f6a044a509315032f6 -
commit.sh:5e4448db9ad48e72ec3a1ff4f5763b41 - commit.sh:5e4448db9ad48e72ec3a1ff4f5763b41 -
jar.sh:343cf505530401fb696296bc25a9b090 - jar.sh:343cf505530401fb696296bc25a9b090 -

@ -1,12 +1,19 @@
package sig; package sig;
import javax.sound.midi.ControllerEventListener;
import javax.sound.midi.ShortMessage;
import javax.swing.JFrame; import javax.swing.JFrame;
import net.java.games.input.Component; import net.java.games.input.Component;
import net.java.games.input.Controller; import net.java.games.input.Controller;
import net.java.games.input.ControllerEnvironment; import net.java.games.input.ControllerEnvironment;
import net.java.games.input.ControllerEvent;
import net.java.games.input.ControllerListener;
import net.java.games.input.DirectAndRawInputEnvironmentPlugin;
import net.java.games.input.DirectInputEnvironmentPlugin;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import sig.engine.Panel; import sig.engine.Panel;
@ -33,7 +40,6 @@ public class RabiClone{
public static JFrame f; public static JFrame f;
public static List<Object> OBJ = new ArrayList<Object>(); public static List<Object> OBJ = new ArrayList<Object>();
boolean newSizeSet=false;
public static int BASE_WIDTH=512; public static int BASE_WIDTH=512;
public static int BASE_HEIGHT=288; public static int BASE_HEIGHT=288;
@ -47,6 +53,8 @@ public class RabiClone{
public static Maps CURRENT_MAP = Maps.WORLD1; public static Maps CURRENT_MAP = Maps.WORLD1;
public static Controller[] CONTROLLERS = new Controller[]{}; public static Controller[] CONTROLLERS = new Controller[]{};
public static long lastControllerScan = System.currentTimeMillis();
public static void main(String[] args) { public static void main(String[] args) {
Key.InitializeKeyConversionMap(); Key.InitializeKeyConversionMap();
@ -83,6 +91,7 @@ public class RabiClone{
double updateMult = Math.min(1/60d,timePassed/1000000000d); double updateMult = Math.min(1/60d,timePassed/1000000000d);
CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().getControllers(); CONTROLLERS = ControllerEnvironment.getDefaultEnvironment().getControllers();
//System.out.println(CONTROLLERS.length);
for (int i=0;i<CONTROLLERS.length;i++) { for (int i=0;i<CONTROLLERS.length;i++) {
if (CONTROLLERS[i].poll()) { if (CONTROLLERS[i].poll()) {
//System.out.println(CONTROLLERS[i].getPortType()+" // "+CONTROLLERS[i].getType()); //System.out.println(CONTROLLERS[i].getPortType()+" // "+CONTROLLERS[i].getType());

Loading…
Cancel
Save