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); } }
/// <summary> /// Clean up. /// </summary> public override void Dispose() { count--; if (count == 0) { meshWindSock.Dispose(); meshWindSock = null; flagShader.Dispose(); flagShader = null; } }
/// <summary> /// Clean up. /// </summary> public override void Dispose() { count--; if (count == 0) { meshFixed.Dispose(); meshFixed = null; meshFrontWheels.Dispose(); meshFrontWheels = null; meshRearWheels.Dispose(); meshRearWheels = null; } }
/// <summary> /// Clean up. /// </summary> public override void Dispose() { count--; if (count == 0) { meshFixed.Dispose(); meshFixed = null; meshTurbine.Dispose(); meshTurbine = null; meshBlades.Dispose(); meshBlades = null; } }
/// <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(); }
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; }; }
/// <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(); }