use invokeAndWait for update, need to test on windows
parent
077d06f564
commit
6eaaac3eb3
|
@ -288,7 +288,8 @@ public class GameController {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
public void update() {
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
//SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
invokeAndWait(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
gamePanel.updateInfo();
|
gamePanel.updateInfo();
|
||||||
gamePanel.update();
|
gamePanel.update();
|
||||||
|
@ -470,11 +471,6 @@ public class GameController {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
update();
|
update();
|
||||||
try {
|
|
||||||
Thread.sleep(10);
|
|
||||||
} catch (final Exception ex) {
|
|
||||||
System.err.println("ERROR! Exception while controller thread sleeping.");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
running.set(false);
|
running.set(false);
|
||||||
|
|
Loading…
Reference in New Issue