/** * Add a given texture to the cache * * @param texture * our texture */ public static void addToCache(final Texture texture) { if (TextureState.getDefaultTexture() == null || (texture != TextureState.getDefaultTexture() && texture.getImage() != TextureState.getDefaultTextureImage())) { _tCache.put(texture.getTextureKey(), texture); } }
/** * Loads a texture from the given source. * * @param source * the source of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param format * the specific format to use when storing this texture on the card. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final ResourceSource source, final Texture.MinificationFilter minFilter, final TextureStoreFormat format, final boolean flipVertically) { if (null == source) { logger.warning("Could not load image... source was null. defaultTexture used."); return TextureState.getDefaultTexture(); } final TextureKey tkey = TextureKey.getKey(source, flipVertically, format, minFilter); return loadFromKey(tkey, null, null); }
/** * Add a given texture to the cache * * @param texture * our texture */ public static void addToCache(final Texture texture) { if (TextureState.getDefaultTexture() == null || (texture != TextureState.getDefaultTexture() && texture.getImage() != TextureState .getDefaultTextureImage())) { _tCache.put(texture.getTextureKey(), texture); } }
/** * Loads a texture from the given source. * * @param source * the source of the texture image. * @param minFilter * the filter for the near values. Used to determine if we should generate mipmaps. * @param format * the specific format to use when storing this texture on the card. * @param flipVertically * If true, the image is flipped vertically during image loading. * @return the loaded texture. */ public static Texture load(final ResourceSource source, final Texture.MinificationFilter minFilter, final TextureStoreFormat format, final boolean flipVertically) { if (null == source) { logger.warning("Could not load image... source was null. defaultTexture used."); return TextureState.getDefaultTexture(); } final TextureKey tkey = TextureKey.getKey(source, flipVertically, format, minFilter); return loadFromKey(tkey, null, null); }
if (tkey == null) { logger.warning("TextureKey is null, cannot load"); return TextureState.getDefaultTexture(); return TextureState.getDefaultTexture();
if (tkey == null) { logger.warning("TextureKey is null, cannot load"); return TextureState.getDefaultTexture(); return TextureState.getDefaultTexture();