public <T> void registerAssetClone(AssetKey<T> key, T clone) { ArrayList<AssetKey> loadStack = assetLoadStack.get(); ((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1)); }
public Object createClone(Object obj) { CloneableSmartAsset asset = (CloneableSmartAsset) obj; return asset.clone(); }
public <T> void addToCache(AssetKey<T> originalKey, T obj) { // Make room for new asset removeCollectedAssets(); CloneableSmartAsset asset = (CloneableSmartAsset) obj; // No circular references, since the original asset is // strongly referenced, we don't want the key strongly referenced. asset.setKey(null); // Start tracking the collection of originalKey // (this adds the KeyRef to the ReferenceQueue) KeyRef ref = new KeyRef(originalKey, refQueue); // Place the asset in the cache, but use a clone of // the original key. smartCache.put(ref.clonedKey, new AssetRef(asset, originalKey)); // Push the original key used to load the asset // so that it can be set on the clone later ArrayList<AssetKey> loadStack = assetLoadStack.get(); loadStack.add(originalKey); }
public Object createClone(Object obj) { CloneableSmartAsset asset = (CloneableSmartAsset) obj; return asset.clone(); }
public <T> void registerAssetClone(AssetKey<T> key, T clone) { ArrayList<AssetKey> loadStack = assetLoadStack.get(); ((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1)); }
public <T> void registerAssetClone(AssetKey<T> key, T clone) { ArrayList<AssetKey> loadStack = assetLoadStack.get(); ((CloneableSmartAsset)clone).setKey(loadStack.remove(loadStack.size() - 1)); }
public <T> void addToCache(AssetKey<T> originalKey, T obj) { // Make room for new asset removeCollectedAssets(); CloneableSmartAsset asset = (CloneableSmartAsset) obj; // No circular references, since the original asset is // strongly referenced, we don't want the key strongly referenced. asset.setKey(null); // Start tracking the collection of originalKey // (this adds the KeyRef to the ReferenceQueue) KeyRef ref = new KeyRef(originalKey, refQueue); // Place the asset in the cache, but use a clone of // the original key. smartCache.put(ref.clonedKey, new AssetRef(asset, originalKey)); // Push the original key used to load the asset // so that it can be set on the clone later ArrayList<AssetKey> loadStack = assetLoadStack.get(); loadStack.add(originalKey); }
public <T> void addToCache(AssetKey<T> originalKey, T obj) { // Make room for new asset removeCollectedAssets(); CloneableSmartAsset asset = (CloneableSmartAsset) obj; // No circular references, since the original asset is // strongly referenced, we don't want the key strongly referenced. asset.setKey(null); // Start tracking the collection of originalKey // (this adds the KeyRef to the ReferenceQueue) KeyRef ref = new KeyRef(originalKey, refQueue); // Place the asset in the cache, but use a clone of // the original key. smartCache.put(ref.clonedKey, new AssetRef(asset, originalKey)); // Push the original key used to load the asset // so that it can be set on the clone later ArrayList<AssetKey> loadStack = assetLoadStack.get(); loadStack.add(originalKey); }