Don't load tile images on server; just allow/check for null image provider.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3608 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -367,7 +367,9 @@ public abstract class TileSet
|
|||||||
*/
|
*/
|
||||||
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
||||||
{
|
{
|
||||||
tile.setImage(getTileMirage(tileIndex, zations));
|
if (_improv != null) {
|
||||||
|
tile.setImage(getTileMirage(tileIndex, zations));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -387,6 +389,7 @@ public abstract class TileSet
|
|||||||
protected void reportCachePerformance ()
|
protected void reportCachePerformance ()
|
||||||
{
|
{
|
||||||
if (/* Log.getLevel() != Log.log.DEBUG || */
|
if (/* Log.getLevel() != Log.log.DEBUG || */
|
||||||
|
_improv == null ||
|
||||||
_cacheStatThrottle.throttleOp()) {
|
_cacheStatThrottle.throttleOp()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: BundledTileSetRepository.java,v 1.15 2004/08/27 02:12:42 mdb Exp $
|
// $Id$
|
||||||
//
|
//
|
||||||
// Narya library - tools for developing networked games
|
// Narya library - tools for developing networked games
|
||||||
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
// Copyright (C) 2002-2004 Three Rings Design, Inc., All Rights Reserved
|
||||||
@@ -51,7 +51,8 @@ public class BundledTileSetRepository
|
|||||||
* @param rmgr the resource manager from which to obtain our resource
|
* @param rmgr the resource manager from which to obtain our resource
|
||||||
* set.
|
* set.
|
||||||
* @param imgr the image manager through which we will configure the
|
* @param imgr the image manager through which we will configure the
|
||||||
* tile sets to load their images.
|
* tile sets to load their images, or <code>null</code> if image tiles
|
||||||
|
* should not be loaded (only the tile metadata)
|
||||||
* @param name the name of the resource set from which we will be
|
* @param name the name of the resource set from which we will be
|
||||||
* loading our tile data.
|
* loading our tile data.
|
||||||
*/
|
*/
|
||||||
@@ -141,7 +142,8 @@ public class BundledTileSetRepository
|
|||||||
protected void addBundle (HashIntMap idmap, HashMap namemap,
|
protected void addBundle (HashIntMap idmap, HashMap namemap,
|
||||||
TileSetBundle bundle)
|
TileSetBundle bundle)
|
||||||
{
|
{
|
||||||
IMImageProvider improv = new IMImageProvider(_imgr, bundle);
|
IMImageProvider improv = (_imgr == null) ?
|
||||||
|
null : new IMImageProvider(_imgr, bundle);
|
||||||
|
|
||||||
// map all of the tilesets in this bundle
|
// map all of the tilesets in this bundle
|
||||||
for (Iterator iter = bundle.entrySet().iterator(); iter.hasNext(); ) {
|
for (Iterator iter = bundle.entrySet().iterator(); iter.hasNext(); ) {
|
||||||
|
|||||||
@@ -21,11 +21,8 @@
|
|||||||
|
|
||||||
package com.threerings.stage.server;
|
package com.threerings.stage.server;
|
||||||
|
|
||||||
import java.awt.Container;
|
|
||||||
|
|
||||||
import com.threerings.resource.ResourceManager;
|
import com.threerings.resource.ResourceManager;
|
||||||
|
|
||||||
import com.threerings.media.image.ImageManager;
|
|
||||||
import com.threerings.media.tile.TileManager;
|
import com.threerings.media.tile.TileManager;
|
||||||
import com.threerings.media.tile.bundle.BundledTileSetRepository;
|
import com.threerings.media.tile.bundle.BundledTileSetRepository;
|
||||||
|
|
||||||
@@ -45,9 +42,6 @@ public abstract class StageServer extends WhirledServer
|
|||||||
* the server and client). */
|
* the server and client). */
|
||||||
public ResourceManager rsrcmgr;
|
public ResourceManager rsrcmgr;
|
||||||
|
|
||||||
/** Provides access to image resources. */
|
|
||||||
public static ImageManager imagemgr;
|
|
||||||
|
|
||||||
/** Provides access to our tile repository. */
|
/** Provides access to our tile repository. */
|
||||||
public static TileManager tilemgr;
|
public static TileManager tilemgr;
|
||||||
|
|
||||||
@@ -62,11 +56,10 @@ public abstract class StageServer extends WhirledServer
|
|||||||
rsrcmgr = new ResourceManager("rsrc");
|
rsrcmgr = new ResourceManager("rsrc");
|
||||||
rsrcmgr.initBundles(null, "config/resource/manager.properties", null);
|
rsrcmgr.initBundles(null, "config/resource/manager.properties", null);
|
||||||
|
|
||||||
// create our image manager, tile manager and repository
|
// create our tile manager and repository
|
||||||
imagemgr = new ImageManager(rsrcmgr, null);
|
tilemgr = new TileManager(null);
|
||||||
tilemgr = new TileManager(imagemgr);
|
|
||||||
tilemgr.setTileSetRepository(
|
tilemgr.setTileSetRepository(
|
||||||
new BundledTileSetRepository(rsrcmgr, imagemgr,
|
new BundledTileSetRepository(rsrcmgr, null,
|
||||||
StageCodes.TILESET_RSRC_SET));
|
StageCodes.TILESET_RSRC_SET));
|
||||||
|
|
||||||
Log.info("Stage server initialized.");
|
Log.info("Stage server initialized.");
|
||||||
|
|||||||
Reference in New Issue
Block a user