@MainThread public static void preloadCache(final Renderer r) { for (final Texture t : _tCache.values()) { if (t == null) { continue; } if (t.getTextureKey().getSource() != null) { r.loadTexture(t, 0); } } }
@MainThread public static void preloadCache(final ITextureUtils util) { for (final Texture t : _tCache.values()) { if (t == null) { continue; } if (t.getTextureKey().getSource() != null) { util.loadTexture(t, 0); } } }
if (textureState.isEnabled() && textureState.getTexture() != null) { final TextureKey tKey = textureState.getTexture().getTextureKey(); final String tmpTextureName = tKey.getSource().getName(); final int lastIndexOfUnixPathSeparator = tmpTextureName.lastIndexOf('/'); final int lastIndexOfWindowsPathSeparator = tmpTextureName.lastIndexOf('\\');
tex = ((TextureState) system.getLocalRenderState(StateType.Texture)).getTexture(); if (tex != null) { if (tex.getTextureKey() != null && tex.getTextureKey().getSource() != null) { _imageLabel .setIcon(new ImageIcon(((URLResourceSource) tex.getTextureKey().getSource()).getURL())); logger.warning("image: " + tex + " : " + tex != null ? tex.getTextureKey().getSource().toString() : "");
public void read(final InputCapsule capsule) throws IOException { _minificationFilter = capsule.readEnum("minificationFilter", MinificationFilter.class, MinificationFilter.NearestNeighborNoMipMaps); _image = (Image) capsule.readSavable("image", null); // pull our key, if exists final TextureKey key = (TextureKey) capsule.readSavable("textureKey", null); if (key != null) { _key = TextureKey.getKey(key.getSource(), key.isFlipped(), key.getFormat(), key.getId(), key.getMinificationFilter()); } else { // none set, so pop in a generated key _key = TextureKey.getRTTKey(_minificationFilter); } // pull texture image from resource, if possible. if (_image == null && _key != null && _key.getSource() != null) { TextureManager.loadFromKey(_key, null, this); } _borderColor.set((ColorRGBA) capsule.readSavable("borderColor", new ColorRGBA(ColorRGBA.BLACK_NO_ALPHA))); _hasBorder = capsule.readBoolean("hasBorder", false); _anisotropicFilterPercent = capsule.readFloat("anisotropicFilterPercent", 0.0f); _lodBias = capsule.readFloat("lodBias", 0.0f); _magnificationFilter = capsule.readEnum("magnificationFilter", MagnificationFilter.class, MagnificationFilter.Bilinear); _storeFormat = capsule.readEnum("storeFormat", TextureStoreFormat.class, TextureStoreFormat.RGBA8); _rttPixelDataType = capsule.readEnum("rttPixelDataType", PixelDataType.class, PixelDataType.UnsignedByte); }