Examples of AssetUri


Examples of org.terasology.asset.AssetUri

    public void onFrobButton(FrobButton event, EntityRef character) {
        if (event.getState() != ButtonState.DOWN) {
            return;
        }

        AssetUri activeInteractionScreenUri = InteractionUtil.getActiveInteractionScreenUri(character);
        if (activeInteractionScreenUri != null) {
            InteractionUtil.cancelInteractionAsClient(character);
            return;
        }
        boolean activeRequestSent = localPlayer.activateTargetAsClient();
View Full Code Here

Examples of org.terasology.asset.AssetUri

                if (Files.isDirectory(child)) {
                    scanOverrides(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            addOverride(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load override {}", child, e.getMessage());
View Full Code Here

Examples of org.terasology.asset.AssetUri

                if (Files.isDirectory(child)) {
                    scanDeltas(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    Path modulePath = relativePath.subpath(0, 1);
                    AssetUri uri = getUri(new Name(modulePath.toString()), modulePath.relativize(relativePath));
                    if (uri != null) {
                        try {
                            setDelta(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load delta {}", child, e.getMessage());
View Full Code Here

Examples of org.terasology.asset.AssetUri

            for (Path child : stream) {
                if (Files.isDirectory(child)) {
                    scanAssets(child, basePath);
                } else if (Files.isRegularFile(child)) {
                    Path relativePath = basePath.relativize(child);
                    AssetUri uri = getUri(relativePath);
                    if (uri != null) {
                        try {
                            addItem(uri, child.toUri().toURL());
                        } catch (MalformedURLException e) {
                            logger.warn("Failed to load asset {}", relativePath, e.getMessage());
View Full Code Here

Examples of org.terasology.asset.AssetUri

                        continue;
                    }
                    Name moduleName = new Name(key.substring(0, moduleIndex));
                    key = key.substring(moduleIndex + 1);

                    AssetUri uri = getUri(moduleName, key);
                    if (uri == null || !uri.isValid()) {
                        continue;
                    }

                    logger.debug("Discovered override {} at {}", uri, entryPath);
View Full Code Here

Examples of org.terasology.asset.AssetUri

                        continue;
                    }
                    Name moduleName = new Name(key.substring(0, moduleIndex));
                    key = key.substring(moduleIndex + 1);

                    AssetUri uri = getUri(moduleName, key);
                    if (uri == null || !uri.isValid()) {
                        continue;
                    }

                    logger.debug("Discovered delta {} at {}", uri, entryPath);
View Full Code Here

Examples of org.terasology.asset.AssetUri

                String entryPath = entry.getName();
                logger.debug("Found {}", entryPath);

                if (entryPath.startsWith(assetsPath)) {
                    String key = entryPath.substring(assetsPath.length() + 1);
                    AssetUri uri = getUri(key);
                    if (uri == null || !uri.isValid()) {
                        continue;
                    }

                    logger.debug("Discovered resource {}", uri);
View Full Code Here

Examples of org.terasology.asset.AssetUri

    private GLSLMaterial prepareAndStoreShaderProgramInstance(String title, ShaderParameters params) {
        String uri = "engine:" + title;
        Shader shader = Assets.getShader(uri);
        checkNotNull(shader, "Failed to resolve %s", uri);
        shader.recompile();
        GLSLMaterial material = Assets.generateAsset(new AssetUri(AssetType.MATERIAL, "engine:prog." + title), new MaterialData(shader), GLSLMaterial.class);
        material.setShaderParameters(params);

        return material;
    }
View Full Code Here

Examples of org.terasology.asset.AssetUri

    private IconMeshFactory() {
    }

    public static Mesh getIconMesh(TextureRegion region) {
        if (region instanceof Asset) {
            AssetUri iconUri = ((Asset) region).getURI();
            return Assets.get(new AssetUri(AssetType.MESH, iconUri.getModuleName(), IconMeshResolver.ICON_DISCRIMINATOR + "." + iconUri.getAssetName()), Mesh.class);
        } else {
            return generateIconMesh(region);
        }
    }
View Full Code Here

Examples of org.terasology.asset.AssetUri

                throw new IOException("Failed to load font - unable to resolve font page '" + textureName + "'");
            }

            MaterialData materialData = new MaterialData(Assets.getShader("engine:font"));
            materialData.setParam("texture", texture);
            AssetUri matName = new AssetUri(AssetType.MATERIAL, moduleName, textureName + "_font");
            Material pageMat = Assets.generateAsset(matName, materialData, Material.class);

            builder.addPage(pageId, texture, pageMat);
        } else {
            throw new IOException("Failed to load font - invalid page line '" + pageInfo + "'");
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.