source: OniSplit/Akira/AkiraImporter.cs

Last change on this file was 1114, checked in by iritscen, 5 years ago

Adding OniSplit source code (v0.9.99.0). Many thanks to Neo for all his work over the years.

File size: 1.9 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Globalization;
4using System.IO;
5using Oni.Imaging;
6
7namespace Oni.Akira
8{
9 internal class AkiraImporter : Importer
10 {
11 private bool debug;
12 //private string defaultTexture = "NONE";
13 //private bool importLights;
14 //private bool noLight;
15 //private bool noTextures;
16
17 public AkiraImporter(string[] args)
18 {
19 foreach (string arg in args)
20 {
21 if (arg == "-debug")
22 {
23 debug = true;
24 }
25 //if (arg.StartsWith("-texdefault:", StringComparison.Ordinal))
26 //{
27 // int i = arg.IndexOf(':');
28 // defaultTexture = arg.Substring(i + 1);
29 //}
30 //else if (arg.StartsWith("-lights", StringComparison.Ordinal))
31 //{
32 // importLights = true;
33 //}
34 //else if (arg == "-env-notxmp")
35 //{
36 // noTextures = true;
37 //}
38 //else if (arg.StartsWith("-nolight", StringComparison.Ordinal))
39 //{
40 // noLight = true;
41 //}
42 }
43 }
44
45 public override void Import(string filePath, string outputDirPath)
46 {
47 Import(new[] { filePath }, outputDirPath);
48 }
49
50 public void Import(IList<string> files, string outputDirPath)
51 {
52 Import(files, outputDirPath, Path.GetFileNameWithoutExtension(files[0]));
53 }
54
55 public void Import(IList<string> files, string outputDirPath, string name)
56 {
57 PolygonMesh mesh = AkiraDaeReader.Read(files);
58
59 BeginImport();
60 AkiraDatWriter.Write(mesh, this, name, debug);
61 Write(outputDirPath);
62 }
63 }
64}
Note: See TracBrowser for help on using the repository browser.