Suppressing update/render when state is inactive

Inactive state should not be updated/rendered

[patch]

Index: src/core/com/jme3/app/state/AppStateManager.java

===================================================================

— src/core/com/jme3/app/state/AppStateManager.java (revision 6302)

+++ src/core/com/jme3/app/state/AppStateManager.java (working copy)

@@ -139,7 +139,9 @@

if (!state.isInitialized())

state.initialize(this, app);


  •            state.update(tpf);<br />
    
  •            if (state.isActive()) {<br />
    
  •            	state.update(tpf);<br />
    
  •            }<br />
    

}

}

}

@@ -156,7 +158,9 @@

if (!state.isInitialized())

state.initialize(this, app);


  •            state.render(rm);<br />
    
  •            if (state.isActive()) {<br />
    
  •            	state.render(rm);<br />
    
  •            }<br />
    

}

}

}

@@ -173,7 +177,9 @@

if (!state.isInitialized())

state.initialize(this, app);


  •            state.postRender();<br />
    
  •            if (state.isActive()) {<br />
    
  •            	state.postRender();<br />
    
  •            }<br />
    

}

}

}

[/patch]

1 Like

Hum! Interesting…

Thank you Mulova, I applied the patch and committed to last revision