/** DO NOT USE. FOR INTERNAL USE ONLY */ public static TextureKey initSavable() { return new TextureKey(); }
/** DO NOT USE. FOR INTERNAL USE ONLY */ public static TextureKey initSavable() { return new TextureKey(); }
public static synchronized TextureKey getKey(final ResourceSource source, final boolean flipped, final TextureStoreFormat storeFormat, final String id, final Texture.MinificationFilter minFilter) { final TextureKey key = new TextureKey(); key._source = source; key._flipped = flipped; key._minFilter = minFilter; key._format = storeFormat; key._id = id; key._code = Integer.MAX_VALUE; { WeakReference<TextureKey> ref; TextureKey check; for (final Iterator<WeakReference<TextureKey>> it = _keyCache.iterator(); it.hasNext();) { ref = it.next(); check = ref.get(); if (check == null) { // found empty, clean up it.remove(); continue; } if (check.equals(key)) { // found match, return return check; } } } // not found _keyCache.add(new WeakReference<TextureKey>(key)); return key; }
public static synchronized TextureKey getKey(final ResourceSource source, final boolean flipped, final TextureStoreFormat storeFormat, final String id, final Texture.MinificationFilter minFilter) { final TextureKey key = new TextureKey(); key._source = source; key._flipped = flipped; key._minFilter = minFilter; key._format = storeFormat; key._id = id; key._code = Integer.MAX_VALUE; { WeakReference<TextureKey> ref; TextureKey check; for (final Iterator<WeakReference<TextureKey>> it = _keyCache.iterator(); it.hasNext();) { ref = it.next(); check = ref.get(); if (check == null) { // found empty, clean up it.remove(); continue; } if (check.equals(key)) { // found match, return return check; } } } // not found _keyCache.add(new WeakReference<TextureKey>(key)); return key; }