h
This commit is contained in:
parent
e926201e0a
commit
86c090c1e6
@ -594,8 +594,17 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
|||||||
lastTime = thisTime;
|
lastTime = thisTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
long sleeptime = frameInterval - (System.currentTimeMillis() - lastDraw);
|
||||||
|
if(sleeptime > 0)
|
||||||
|
try {
|
||||||
|
Thread.sleep(sleeptime);
|
||||||
|
|
||||||
|
} catch (InterruptedException e1) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e1.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
sleepTime = 0;
|
/*sleepTime = 0;
|
||||||
while(System.currentTimeMillis()-lastDraw<frameInterval){
|
while(System.currentTimeMillis()-lastDraw<frameInterval){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -605,7 +614,7 @@ public class mainThread extends JFrame implements KeyListener, ActionListener, M
|
|||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e1.printStackTrace();
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user