コード例 #1
0
        private string AddFileToProject(string filename)
        {
            string openFile = Program.Instance.OpenFile;

            if (openFile != null)
            {
                string projectFolder = string.Concat(new FileInfo(openFile).DirectoryName, "\\");
                string newFileName   = new FileInfo(filename).Name;
                string copiedName    = string.Concat(projectFolder, newFileName);
                if (!File.Exists(copiedName))
                {
                    File.Copy(filename, copiedName);
                    if (filename.EndsWith(".x"))
                    {
                        XMesh mesh = new XMesh(filename);
                        for (int i = 0; i < mesh.NumberTextures; i++)
                        {
                            TextureBase texture = mesh.GetTexture(i);
                            if ((texture != null) && (!string.IsNullOrEmpty(texture.FileName)))
                            {
                                AddFileToProject(texture.FileName);
                            }
                        }
                        mesh.Dispose();
                    }
                }
                return(copiedName);
            }
            else
            {
                return(null);
            }
        }
コード例 #2
0
ファイル: WindSock.cs プロジェクト: sionhannuna/rcdeskpilot
 /// <summary>
 /// Clean up.
 /// </summary>
 public override void Dispose()
 {
     count--;
     if (count == 0)
     {
         meshWindSock.Dispose();
         meshWindSock = null;
         flagShader.Dispose();
         flagShader = null;
     }
 }
コード例 #3
0
 /// <summary>
 /// Clean up.
 /// </summary>
 public override void Dispose()
 {
     count--;
     if (count == 0)
     {
         meshFixed.Dispose();
         meshFixed = null;
         meshFrontWheels.Dispose();
         meshFrontWheels = null;
         meshRearWheels.Dispose();
         meshRearWheels = null;
     }
 }
コード例 #4
0
ファイル: Windmill.cs プロジェクト: sionhannuna/rcdeskpilot
 /// <summary>
 /// Clean up.
 /// </summary>
 public override void Dispose()
 {
     count--;
     if (count == 0)
     {
         meshFixed.Dispose();
         meshFixed = null;
         meshTurbine.Dispose();
         meshTurbine = null;
         meshBlades.Dispose();
         meshBlades = null;
     }
 }
コード例 #5
0
 /// <summary>
 /// Clean up.
 /// </summary>
 public override void Dispose()
 {
     count--;
     if (count == 0)
     {
         meshPole.Dispose();
         meshPole = null;
         meshFlag.Dispose();
         meshFlag = null;
         flagShader.Dispose();
         flagShader = null;
     }
     pole.Dispose();
     flag.Dispose();
 }
コード例 #6
0
ファイル: MeshBrowserForm.cs プロジェクト: kagada/Arianrhod
        private void LoadMesh(string filename)
        {
            lock (meshLock)
            {
                if (mesh != null)
                {
                    mesh.Dispose();
                    mesh = null;
                }

                worldMatrix = Matrix4x4F.Identity;

                XMesh meshT = meshManager.Open(filename);

                meshT.ShowWireFrame = cbWireframe.Checked;

                mesh = meshT;
            };
        }
コード例 #7
0
        /// <summary>
        /// Clean up.
        /// </summary>
        public void Dispose()
        {
            Program.Instance.CenterHud.ShowGameText("", 1000);
            foreach (CornField field in cornfields)
            {
                field.Dispose();
            }
            cornfields.Clear();
            if (birds != null)
            {
                birds.Dispose();
                birds = null;
            }

            if (arrow != null)
            {
                arrow.Dispose();
                arrow = null;
            }
            cornMesh.Dispose();
        }