Examples of AssetFile


Examples of info.ata4.unity.asset.AssetFile

                continue;
            }

            String className = ClassID.getNameForID(path.getClassID(), true);
           
            AssetFile subAsset = new AssetFile();
            subAsset.getHeader().setFormat(asset.getHeader().getFormat());
           
            ObjectPath subFieldPath = new ObjectPath();
            subFieldPath.setClassID1(path.getClassID1());
            subFieldPath.setClassID2(path.getClassID2());
            subFieldPath.setLength(path.getLength());
            subFieldPath.setOffset(0);
            subFieldPath.setPathID(1);
            subAsset.getPaths().add(subFieldPath);
           
            TypeTree subTypeTree = subAsset.getTypeTree();
            subTypeTree.setEngineVersion(typeTree.getEngineVersion());
            subTypeTree.setVersion(-2);
            subTypeTree.setFormat(typeTree.getFormat());
            subTypeTree.getFields().put(path.getClassID(), typeTree.getFields().get(path.getClassID()));

            subAsset.setDataBuffer(asset.getPathBuffer(path));
           
            Path subAssetDir = outputDir.resolve(className);
            if (Files.notExists(subAssetDir)) {
                Files.createDirectories(subAssetDir);
            }
           
            // probe asset name
            String subAssetName = getObjectName(asset, path);
            if (subAssetName != null) {
                // remove any chars that could cause troubles on various file systems
                subAssetName = FilenameSanitizer.sanitizeName(subAssetName);
            } else {
                // use numeric names
                subAssetName = String.format("%06d", path.getPathID());
            }
            subAssetName += ".asset";
           
            Path subAssetFile = subAssetDir.resolve(subAssetName);
            if (Files.notExists(subAssetFile)) {
                L.log(Level.INFO, "Writing {0}", subAssetFile);
                subAsset.save(subAssetFile);
            }
        }
    }
View Full Code Here

Examples of info.ata4.unity.asset.AssetFile

            }
        }
    }
   
    protected void processAssetFile(Path file) throws IOException {
        AssetFile asset = new AssetFile();
        asset.open(file);

        setOutputDir(PathUtils.removeExtension(file));
        processAsset(asset);
    }
View Full Code Here

Examples of info.ata4.unity.asset.AssetFile

               
                L.log(Level.INFO, "{0}{1}{2}", new Object[]{file.toString(), file.getFileSystem().getSeparator(), pathString});

                // load asset
                ByteBuffer bb = entry.getValue();
                AssetFile asset = new AssetFile();
                asset.load(bb);
                asset.setSourceBundle(ab);

                // process asset
                setOutputDir(PathUtils.removeExtension(path));
                processAsset(asset);
            }
View Full Code Here

Examples of main.asset.AssetFile

        glCullFace(GL_BACK);
        glFrontFace(GL_CCW);
        glClearColor(0.0f, 0.0f, 0.0f, 1.0f);

        long start = System.currentTimeMillis();
        AssetFile assets = AssetFile.load(new File("assets/test.ten"));
        ModelChunk model = (ModelChunk) assets.findChunk("carrier");
        System.out.println(System.currentTimeMillis() - start);
        TextureChunk tex1 = (TextureChunk) assets.findChunk("tex1");

        ByteBuffer buf = ByteBuffer.allocateDirect(tex1.getData().length);
        System.out.println(tex1.getData().length);
        buf.put(tex1.getData());
        buf.flip();
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.