remove input call won't update the input queue.

it will get updated anyway - by unlock for instance
This commit is contained in:
Maxmtg
2013-05-28 05:02:21 +00:00
parent be6d217591
commit 68f861db0e
2 changed files with 4 additions and 13 deletions

View File

@@ -85,13 +85,10 @@ public class InputQueue extends MyObservable implements java.io.Serializable {
* a boolean.
*/
final void removeInput(Input inp) {
FThreads.assertExecutedByEdt(false);
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
if( topMostInput != inp )
throw new RuntimeException("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack );
this.updateObservers();
}
public final boolean isEmpty() {

View File

@@ -31,15 +31,9 @@ public abstract class InputSyncronizedBase extends InputBase implements InputSyn
// ensure input won't accept any user actions.
FThreads.invokeInEdtNowOrLater(new Runnable() { @Override public void run() { setFinished(); } });
// this will update input proxy, so there might be anything happening in the thread
getQueue().invokeGameAction( new Runnable() {
@Override
public void run() {
// this will update input proxy, so there might be anything happening in the thread
getQueue().removeInput(InputSyncronizedBase.this);
cdlDone.countDown();
}
});
// thread irrelevant
getQueue().removeInput(InputSyncronizedBase.this);
cdlDone.countDown();
}
@Override