Beispiel #1
0
        static void Main(string[] args)
        {
#if DEBUG
            var test = new Effekseer.InternalScript.Tests();
            Effekseer.IO.ChunkTest.Test();
#endif

            try
            {
                StartDirectory = System.IO.Directory.GetCurrentDirectory();
                EntryDirectory = GUI.Manager.GetEntryDirectory();
            }
            catch (Exception e)
            {
                DateTime dt       = DateTime.Now;
                var      filename = string.Format("error_{0:D4}_{1:D2}_{2:D2}_{3:D2}_{4:D2}_{5:D2}.txt", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
                System.IO.File.WriteAllText(filename, e.ToString());
                return;
            }

            bool   gui           = true;
            string input         = string.Empty;
            string output        = string.Empty;
            string format        = "efk";
            string export        = string.Empty;
            float  magnification = 0.0f;

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] == "-cui")
                {
                    gui = false;
                }
                else if (args[i] == "-in")
                {
                    i++;
                    if (i < args.Length)
                    {
                        input = args[i];
                    }
                }
                else if (args[i] == "-o")
                {
                    i++;
                    if (i < args.Length)
                    {
                        output = args[i];
                    }
                }
                else if (args[i] == "-f")
                {
                    i++;
                    if (i < args.Length)
                    {
                        format = args[i];
                    }
                }
                else if (args[i] == "-e")
                {
                    i++;
                    if (i < args.Length)
                    {
                        export = args[i];
                    }
                }
                else if (args[i] == "-m")
                {
                    i++;
                    if (i < args.Length)
                    {
                        float.TryParse(args[i], out magnification);
                    }
                }
                else
                {
                    input = args[i];
                }
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                Exec(gui, input, output, export, format, magnification);
            }
            else
            {
                try
                {
                    Exec(gui, input, output, export, format, magnification);
                }
                catch (Exception e)
                {
                    DateTime dt       = DateTime.Now;
                    var      filename = string.Format("error_{0:D4}_{1:D2}_{2:D2}_{3:D2}_{4:D2}_{5:D2}.txt", dt.Year, dt.Month, dt.Day, dt.Hour, dt.Minute, dt.Second);
                    var      filepath = Path.Combine(EntryDirectory, filename);
                    System.IO.File.WriteAllText(filepath, e.ToString());
                }
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
#if DEBUG
            var test = new Effekseer.InternalScript.Tests();
#endif
            StartDirectory = System.IO.Directory.GetCurrentDirectory();

            bool   gui           = true;
            string input         = string.Empty;
            string output        = string.Empty;
            string format        = "efk";
            string export        = string.Empty;
            float  magnification = 0.0f;

            for (int i = 0; i < args.Length; i++)
            {
                if (args[i] == "-cui")
                {
                    gui = false;
                }
                else if (args[i] == "-in")
                {
                    i++;
                    if (i < args.Length)
                    {
                        input = args[i];
                    }
                }
                else if (args[i] == "-o")
                {
                    i++;
                    if (i < args.Length)
                    {
                        output = args[i];
                    }
                }
                else if (args[i] == "-f")
                {
                    i++;
                    if (i < args.Length)
                    {
                        format = args[i];
                    }
                }
                else if (args[i] == "-e")
                {
                    i++;
                    if (i < args.Length)
                    {
                        export = args[i];
                    }
                }
                else if (args[i] == "-m")
                {
                    i++;
                    if (i < args.Length)
                    {
                        float.TryParse(args[i], out magnification);
                    }
                }
                else
                {
                    input = args[i];
                }
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                Exec(gui, input, output, export, format, magnification);
            }
            else
            {
                try
                {
                    Exec(gui, input, output, export, format, magnification);
                }
                catch (Exception e)
                {
                    System.IO.File.WriteAllText("error.txt", e.ToString());
                }
            }
        }