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. * a boolean.
*/ */
final void removeInput(Input inp) { final void removeInput(Input inp) {
FThreads.assertExecutedByEdt(false);
Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop(); Input topMostInput = inputStack.isEmpty() ? null : inputStack.pop();
if( topMostInput != inp ) if( topMostInput != inp )
throw new RuntimeException("Cannot remove input " + inp.getClass().getSimpleName() + " because it's not on top of stack. Stack = " + inputStack ); 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() { public final boolean isEmpty() {

View File

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