Helped the scene manager to depart from the scene. The viewer and editor

applications really need to deal directly with the scene repository. The
display part of the MISO code doesn't need a scene manager, per se,
because it is simply told to visualize a particular scene and scene
management happens entirely externally. This is in preparation for making
the MISO code work and place nicely with the Whirled code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@246 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2001-08-15 00:00:52 +00:00
parent 3eea4dcaad
commit d26dc0372e
7 changed files with 49 additions and 101 deletions
@@ -1,11 +1,10 @@
//
// $Id: MisoContext.java,v 1.2 2001/07/21 01:51:10 shaper Exp $
// $Id: MisoContext.java,v 1.3 2001/08/15 00:00:51 mdb Exp $
package com.threerings.miso.util;
import com.samskivert.util.Context;
import com.threerings.miso.tile.TileManager;
import com.threerings.miso.scene.SceneManager;
public interface MisoContext extends Context
{
@@ -14,10 +13,4 @@ public interface MisoContext extends Context
* for the lifetime of the application.
*/
public TileManager getTileManager ();
/**
* Return a reference to the SceneManager. This reference is
* valid for the lifetime of the application.
*/
public SceneManager getSceneManager ();
}
+13 -14
View File
@@ -1,5 +1,5 @@
//
// $Id: MisoUtil.java,v 1.5 2001/08/13 15:00:24 shaper Exp $
// $Id: MisoUtil.java,v 1.6 2001/08/15 00:00:51 mdb Exp $
package com.threerings.miso.util;
@@ -33,27 +33,26 @@ public class MisoUtil
}
/**
* Create a <code>SceneManager</code> object, reading the class
* name to instantiate from the config object.
* Create an <code>XMLFileSceneRepository</code> object, reading the
* name of the class to instantiate from the config object.
*
* @param config the <code>Config</code> object.
*
* @return the new scene manager object or null if an error occurred.
* @return the new scene repository object or null if an error
* occurred.
*/
public static SceneManager
createSceneManager (Config config, TileManager tilemgr)
public static XMLFileSceneRepository createSceneRepository (
Config config, TileManager tilemgr)
{
try {
SceneRepositoryImpl scenerepo = (SceneRepositoryImpl)
XMLFileSceneRepository scenerepo = (XMLFileSceneRepository)
config.instantiateValue("miso.scenerepo", DEF_SCENEREPO);
scenerepo.init(config, tilemgr);
SceneManager scenemgr = new SceneManager(scenerepo);
return scenemgr;
return scenerepo;
} catch (Exception e) {
Log.warning("Failed to instantiate scene manager [e=" + e + "].");
Log.warning("Failed to instantiate scene repository " +
"[e=" + e + "].");
return null;
}
}
@@ -106,8 +105,8 @@ public class MisoUtil
*
* @return the new tileset manager object or null if an error occurred.
*/
protected static TileSetManager
createTileSetManager (Config config, ImageManager imgmgr)
protected static TileSetManager createTileSetManager (
Config config, ImageManager imgmgr)
{
TileSetManagerImpl tilesetmgr = null;
try {