Esempio n. 1
0
        public void ProcessNoParameter()
        {
            ConvoarParams parms           = new ConvoarParams();
            string        outputDirectory = "this/that";

            string[] args = new string[] {
                "-d", outputDirectory,
                "--noExportTextures",
                "--preferredTextureFormat", "GIF",
            };
            parms.SetParameterValue("ExportTextures", "true");

            Exception exceptionCode = null;

            try {
                parms.MergeCommandLine(args);
            }
            catch (Exception e) {
                exceptionCode = e;
            }

            if (exceptionCode != null)
            {
                Assert.Fail("Exception merging parameters: " + exceptionCode.ToString());
            }
            else
            {
                Assert.AreEqual(false, parms.P <bool>("ExportTextures"), "ExportTextures was not set to false");
            }
        }
Esempio n. 2
0
 public void Init()
 {
     _log            = new BLoggerConsole();
     _params         = new ConvoarParams();
     ConvOAR.Globals = new GlobalContext()
     {
         log   = _log,
         parms = _params
     };
 }
Esempio n. 3
0
 public void Init()
 {
     _parms          = new ConvoarParams();
     _log            = new LoggerConsole();
     ConvOAR.Globals = new GlobalContext(_parms, _log);
     _assetService   = new MemAssetService();
     _converter      = new BConverterOS();
     _scene          = _converter.CreateScene(_assetService, "convoar-test");
     _assetFetcher   = new OSAssetFetcher(_assetService);
     OMV.UUID defaultTextureID = new OMV.UUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
     _defaultTexture           = new OMV.Primitive.TextureEntryFace(null);
     _defaultTexture.TextureID = defaultTextureID;
 }
Esempio n. 4
0
 public void Init()
 {
     _log            = new BLoggerConsole();
     _params         = new ConvoarParams();
     ConvOAR.Globals = new GlobalContext()
     {
         log   = _log,
         parms = _params
     };
     _assetService = new MemAssetService();
     _converter    = new OarConverter(_log, _params);
     _scene        = _converter.CreateScene(_assetService, "convoar-test");
     _assetManager = new AssetManager(_assetService, _log, _params.OutputDir);
     OMV.UUID defaultTextureID = new OMV.UUID("179cdabd-398a-9b6b-1391-4dc333ba321f");
     _defaultTexture = new OMV.Primitive.TextureEntryFace(null)
     {
         TextureID = defaultTextureID
     };
 }
Esempio n. 5
0
        public void ProcessArgsParameter()
        {
            ConvoarParams parms                     = new ConvoarParams();
            bool          oldExportTextures         = parms.P <bool>("ExportTextures");
            string        inputOARFileParameterName = "InputOAR";
            string        inputOARFile              = "AnOARFileToRead.oar";
            string        outputDirectory           = "this/that";

            string[] args = new string[] {
                "-d", outputDirectory,
                "--exporttextures",
                "--preferredTextureFormat", "GIF",
                "--mergeStaticMeshes",
                "--verticesmaxForBuffer", "1234",
                inputOARFile
            };
            parms.SetParameterValue("ExportTextures", "false");
            parms.SetParameterValue("MergeStaticMeshes", "false");

            Exception exceptionCode = null;

            try {
                parms.MergeCommandLine(args, null, inputOARFileParameterName);
            }
            catch (Exception e) {
                exceptionCode = e;
            }

            if (exceptionCode != null)
            {
                Assert.Fail("Exception merging parameters: " + exceptionCode.ToString());
            }
            else
            {
                Assert.AreEqual(outputDirectory, parms.P <string>("OutputDir"), "Output directory specification short form was not set");
                Assert.AreEqual(true, parms.P <bool>("ExportTextures"), "ExportTextures was not parameterized properly");
                Assert.AreEqual("GIF", parms.P <string>("PreferredTextureFormat"), "Preferred texture format was not set");
                Assert.AreEqual(true, parms.P <bool>("MergeStaticMeshes"), "MergeStaticMeshes was not set");
                Assert.AreEqual(1234, parms.P <int>("VerticesMaxForBuffer"), "VerticesMaxForBuffer was not set");
                Assert.AreEqual(inputOARFile, parms.P <string>("InputOAR"), "The trailing filename was not set");
            }
        }