The big fat bernie revamp! Er, big fat miso revamp rather:

- Combined SceneViewPanel and IsoSceneView into one happy panel.
- Ditched the DisplayMisoScene notion; the new MisoScenePanel now manages
  resolved scene information (like base, object and fringe tiles) itself
  so that it can...
- ...support scrolling scenes by keeping blocks of resolved base, fringe
  and object information loaded only for what is potentially visible
  rather than for the whole scene.

Other things were surely cleaned up or broken in the process to keep a
keen eye out.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@2413 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2003-04-17 19:21:17 +00:00
parent 3de98670db
commit d5701962a3
38 changed files with 2943 additions and 2532 deletions
@@ -1,5 +1,5 @@
//
// $Id: ScrollingScene.java,v 1.12 2003/02/12 07:24:07 mdb Exp $
// $Id: ScrollingScene.java,v 1.13 2003/04/17 19:21:17 mdb Exp $
package com.threerings.miso.client;
@@ -18,15 +18,17 @@ import com.threerings.media.tile.Tile;
import com.threerings.media.tile.TileSet;
import com.threerings.media.tile.TileSetRepository;
import com.threerings.miso.client.util.ObjectSet;
import com.threerings.miso.data.MisoSceneModel;
import com.threerings.miso.tile.BaseTile;
import com.threerings.miso.tile.BaseTileSet;
import com.threerings.miso.util.MisoContext;
import com.threerings.miso.util.ObjectSet;
import com.threerings.miso.data.ObjectInfo;
/**
* Provides an infinite array of tiles in which to scroll.
*/
public class ScrollingScene extends VirtualDisplayMisoSceneImpl
public class ScrollingScene extends MisoSceneModel
{
public ScrollingScene (MisoContext ctx)
throws NoSuchTileSetException, NoSuchTileException, PersistenceException
@@ -60,6 +62,33 @@ public class ScrollingScene extends VirtualDisplayMisoSceneImpl
}
}
public int getBaseTileId (int x, int y)
{
return -1;
}
public boolean setBaseTile (int fqTileId, int x, int y)
{
return false;
}
public void addObject (ObjectInfo info)
{
}
public void getObjects (Rectangle region, ObjectSet set)
{
}
public void updateObject (ObjectInfo info)
{
}
public boolean removeObject (ObjectInfo info)
{
return false;
}
// documentation inherited from interface
public BaseTile getBaseTile (int x, int y)
{
@@ -1,5 +1,5 @@
//
// $Id: ScrollingTestApp.java,v 1.20 2003/02/12 07:24:07 mdb Exp $
// $Id: ScrollingTestApp.java,v 1.21 2003/04/17 19:21:17 mdb Exp $
package com.threerings.miso.client;
@@ -98,7 +98,7 @@ public class ScrollingTestApp
CharacterManager charmgr = new CharacterManager(imgr, crepo);
// create our scene view panel
_panel = new SceneViewPanel(_framemgr, new IsoSceneViewModel());
_panel = new MisoScenePanel(ctx, MisoConfig.getSceneMetrics());
_frame.setPanel(_panel);
// create our "ship" sprite
@@ -114,8 +114,8 @@ public class ScrollingTestApp
_ship.setFollowingPathAction("sailing");
_ship.setRestingAction("sailing");
_ship.setActionSequence("sailing");
_ship.setLocation(_panel.getModel().bounds.width/2,
_panel.getModel().bounds.height/2);
_ship.setLocation(_panel.getSceneMetrics().bounds.width/2,
_panel.getSceneMetrics().bounds.height/2);
_panel.addSprite(_ship);
}
@@ -161,7 +161,7 @@ public class ScrollingTestApp
}
try {
_panel.setScene(new ScrollingScene(ctx));
_panel.setSceneModel(new ScrollingScene(ctx));
} catch (Exception e) {
Log.warning("Error creating scene: " + e);
Log.logStackTrace(e);
@@ -174,10 +174,13 @@ public class ScrollingTestApp
*/
protected class ContextImpl implements MisoContext
{
public MisoTileManager getTileManager ()
{
public MisoTileManager getTileManager () {
return _tilemgr;
}
public FrameManager getFrameManager () {
return _framemgr;
}
}
/**
@@ -214,7 +217,7 @@ public class ScrollingTestApp
protected ScrollingFrame _frame;
/** The main panel. */
protected SceneViewPanel _panel;
protected MisoScenePanel _panel;
/** The ship in the center of our screen. */
protected CharacterSprite _ship;