private void AddObjectDirectory(
            IModelDirectory <GloModelFileBundle> parentNode,
            IFileHierarchy gloverFileHierarchy,
            IFileHierarchyDirectory objectDirectory)
        {
            var objectFiles = objectDirectory.FilesWithExtension(".glo");

            var gloverSteamDirectory = gloverFileHierarchy.Root;
            var textureDirectories   = gloverSteamDirectory
                                       .TryToGetSubdir("data/textures/generic")
                                       .Subdirs.ToList();

            try {
                var levelTextureDirectory = gloverSteamDirectory.TryToGetSubdir(
                    objectDirectory.LocalPath.Replace("data\\objects",
                                                      "data\\textures"));
                textureDirectories.Add(levelTextureDirectory);
                textureDirectories.AddRange(levelTextureDirectory.Subdirs);
            } catch (Exception e) {
                ;
            }

            foreach (var objectFile in objectFiles)
            {
                parentNode.AddFileBundle(
                    new GloModelFileBundle(objectFile, textureDirectories));
            }
        }
        public void ExtractModel_(
            IModelDirectory <CmbModelFileBundle> parentNode,
            IFileHierarchyDirectory subdir)
        {
            var cmbFiles = subdir.FilesWithExtension(".cmb").ToArray();

            if (cmbFiles.Length == 0)
            {
                return;
            }

            var csabFiles = subdir.FilesWithExtension(".csab").ToArray();
            var ctxbFiles = subdir.FilesWithExtension(".ctxb").ToArray();
            var shpaFiles = subdir.FilesWithExtension(".shpa").ToArray();

            try {
                var bundles =
                    this.separator_.Separate(subdir, cmbFiles, csabFiles);

                foreach (var bundle in bundles)
                {
                    parentNode.AddFileBundle(new CmbModelFileBundle(
                                                 bundle.ModelFile,
                                                 bundle.AnimationFiles.ToArray(),
                                                 ctxbFiles,
                                                 shpaFiles
                                                 ));
                }
            } catch { }
        }
Esempio n. 3
0
        private void ExtractModels_(
            IModelDirectory <BmdModelFileBundle> node,
            IReadOnlyList <IFileHierarchyFile> bmdFiles,
            IReadOnlyList <IFileHierarchyFile>?bcxFiles = null,
            IReadOnlyList <IFileHierarchyFile>?btiFiles = null
            )
        {
            Asserts.True(bmdFiles.Count > 0);

            foreach (var bmdFile in bmdFiles)
            {
                node.AddFileBundle(new BmdModelFileBundle {
                    BmdFile   = bmdFile,
                    BcxFiles  = bcxFiles,
                    BtiFiles  = btiFiles,
                    FrameRate = 60
                });
            }
        }