Examples of AssetKey


Examples of com.jme3.asset.AssetKey

        if (!settingsDirectory.exists()) {
            if (settingsDirectory.mkdir()) {
                assetManager.registerLoader(DatabaseLoader.class, "db");

                String levelFilename = "Files/" + settingsFile;
                AssetKey myKey1 = new AssetKey(levelFilename);
                AssetInfo info1 = assetManager.locateAsset(myKey1);
                InputStream inputStream = (InputStream) info1.openStream();

                OutputStream outStream = null;
View Full Code Here

Examples of com.jme3.asset.AssetKey

   
    private void removeCollectedAssets(){
        int removedAssets = 0;
        for (KeyRef ref; (ref = (KeyRef)refQueue.poll()) != null;){
            // (Cannot use ref.get() since it was just collected by GC!)
            AssetKey key = ref.clonedKey;
           
            // Asset was collected, note that at this point the asset cache
            // might not even have this asset anymore, it is OK.
            if (smartCache.remove(key) != null){
                removedAssets ++;
View Full Code Here

Examples of com.jme3.asset.AssetKey

            return null;
        } else {
            // NOTE: Optimization so that registerAssetClone()
            // can check this and determine that the asset clone
            // belongs to the asset retrieved here.
            AssetKey keyForTheClone = smartInfo.get();
            if (keyForTheClone == null){
                // The asset was JUST collected by GC
                // (between here and smartCache.get)
                return null;
            }
View Full Code Here

Examples of com.jme3.asset.AssetKey

            if (info.getUnusedNodes().contains(shaderNode.getName())) {
                continue;
            }
            if (shaderNode.getDefinition().getType() == type) {
                int index = findShaderIndexFromVersion(shaderNode, type);
                String loadedSource = (String) assetManager.loadAsset(new AssetKey(shaderNode.getDefinition().getShadersPath().get(index)));
                appendNodeDeclarationAndMain(loadedSource, sourceDeclaration, source, shaderNode, info);
            }
        }
    }
View Full Code Here

Examples of com.jme3.asset.AssetKey

            }
        }
    }

    public Material(AssetManager contentMan, String defName) {
        this((MaterialDef) contentMan.loadAsset(new AssetKey(defName)));
    }
View Full Code Here

Examples of com.jme3.asset.AssetKey

                }
            }
            assert applyDefaultValues && guessRenderStateApply;
        }

        def = (MaterialDef) im.getAssetManager().loadAsset(new AssetKey(defName));
        paramValues = new ListMap<String, MatParam>();

        // load the textures and update nextTexUnit
        for (Map.Entry<String, MatParam> entry : params.entrySet()) {
            MatParam param = entry.getValue();
View Full Code Here

Examples of com.jme3.asset.AssetKey

    private ShaderNodeLoaderDelegate loaderDelegate;

    @Override
    public Object load(AssetInfo assetInfo) throws IOException {
        AssetKey k = assetInfo.getKey();
        if (!(k instanceof ShaderNodeDefinitionKey)) {
            throw new IOException("ShaderNodeDefinition file must be loaded via ShaderNodeDefinitionKey");
        }
        ShaderNodeDefinitionKey key = (ShaderNodeDefinitionKey) k;
        loaderDelegate = new ShaderNodeLoaderDelegate();
View Full Code Here

Examples of com.jme3.asset.AssetKey

    private String textureName(Texture texture) {
        if (texture == null) {
            return null;
        }
        AssetKey key = texture.getKey();
        if (key != null) {
            return key.toString();
        } else {
            return null;
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.