SDK core : Initialized the audioRenderer for the FakeApplication thread so one can play sounds in the scene composer
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10451 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
76de5e345e
commit
9f2582e4dd
sdk/jme3-core/src/com/jme3/gde/core/scene
@ -36,6 +36,7 @@ import com.jme3.app.SimpleApplication;
|
||||
import com.jme3.app.state.AppState;
|
||||
import com.jme3.app.state.AppStateManager;
|
||||
import com.jme3.asset.AssetManager;
|
||||
import com.jme3.audio.AudioContext;
|
||||
import com.jme3.audio.AudioRenderer;
|
||||
import com.jme3.audio.Listener;
|
||||
import com.jme3.gde.core.appstates.AppStateManagerNode;
|
||||
@ -102,6 +103,10 @@ public class FakeApplication extends SimpleApplication {
|
||||
this.appStateManager = new FakeAppStateManager(this);
|
||||
}
|
||||
|
||||
public void setAudioRenderer(AudioRenderer audioRenderer){
|
||||
this.audioRenderer = audioRenderer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createCanvas() {
|
||||
defaultFakeError(true);
|
||||
@ -487,6 +492,7 @@ public class FakeApplication extends SimpleApplication {
|
||||
public boolean updateFake(final float tpf) {
|
||||
Future fut = fakeAppThread.submit(new Callable<Void>() {
|
||||
public Void call() throws Exception {
|
||||
AudioContext.setAudioRenderer(audioRenderer);
|
||||
appStateManager.update(tpf);
|
||||
return null;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ package com.jme3.gde.core.scene;
|
||||
import com.jme3.app.Application;
|
||||
import com.jme3.app.StatsView;
|
||||
import com.jme3.asset.AssetManager;
|
||||
import com.jme3.audio.AudioContext;
|
||||
import com.jme3.bullet.BulletAppState;
|
||||
import com.jme3.font.BitmapFont;
|
||||
import com.jme3.font.BitmapText;
|
||||
@ -223,6 +224,7 @@ public class SceneApplication extends Application implements LookupProvider {
|
||||
try {
|
||||
super.initialize();
|
||||
thread = Thread.currentThread();
|
||||
fakeApp.setAudioRenderer(audioRenderer);
|
||||
fakeApp.startFakeApp();
|
||||
{
|
||||
overlayView = getRenderManager().createMainView("Overlay", cam);
|
||||
|
Loading…
x
Reference in New Issue
Block a user