public CAppear(CThucHanh pThucHanh, string pName, CTexObj pObj, int start, int pduration, int psteps, float pPartial, bool pstophide, int pisound, bool loop) : base(pThucHanh) { this.Name = pName; this.Obj = pObj; this.RenderSurface = this.Obj.GetRenderSurface(); this.StartTickCount = start; this.duration = pduration; this.stophide = pstophide; this.steps = psteps; if (this.steps < 1) { this.steps = 1; } this.partial = pPartial; if (this.partial < 0.1f) { this.partial = 0.1f; } if (this.partial > 1f) { this.partial = 1f; } this.StopTickCount = this.StartTickCount + this.duration; this.interval = this.duration / this.steps; this.ImageWidth = this.Obj.ImageWidth - 2 * this.Obj.PixelsPerGridX; this.ImageHeight = this.Obj.ImageHeight - 2 * this.Obj.PixelsPerGridY; this.done = false; this.isound = pisound; this.soundloop = loop; this.iLastStep = 0; }
public void ClearTerrain() { this.m_MapPanel.MouseWheel -= new MouseEventHandler(this.Form1_MouseWheel); this.m_MapPanel.MouseDoubleClick -= new MouseEventHandler(this.Form1_MouseDoubleClick); this.m_MapPanel.Paint -= new PaintEventHandler(this.Form1_Paint); this.m_MapPanel.MouseDown -= new MouseEventHandler(this.Form1_MouseDown); this.m_MapPanel.MouseMove -= new MouseEventHandler(this.Form1_MouseMove); this.mySound.ClearSounds(); this.m_SoundNames.Clear(); this.m_BillboardMeshs.Clear(); this.Billboards.Clear(); this.ModelMeshs.Clear(); this.Models.Clear(); this.SpriteTexs.Clear(); this.SpriteObjs.Clear(); if (this.texObjs.Count > 0) { for (int i = this.texObjs.Count - 1; i > -1; i--) { CTexObj cTexObj = this.texObjs[i]; cTexObj.Dispose(); this.texObjs.RemoveAt(i); } } this.runactions.actions.Clear(); this.runactions = null; this.myTerrain.Dispose(); this.device.Dispose(); }
public void LoadTexObjs(string pFile) { try { this.texObjs.Clear(); DataSet dataSet = new DataSet(); dataSet.ReadXml(pFile); DataTable dataTable = dataSet.Tables[0]; if (dataTable.Rows.Count > 0) { foreach (DataRow dataRow in dataTable.Rows) { string pName = (string)dataRow[0]; string pTexFile = (string)dataRow[1]; int pWIDTH = Convert.ToInt32(dataRow[2]); int pHEIGHT = Convert.ToInt32(dataRow[3]); int pShiftX = Convert.ToInt32(dataRow[4]); int pShiftY = Convert.ToInt32(dataRow[5]); int pImageWidth = Convert.ToInt32(dataRow[6]); int pImageHeight = Convert.ToInt32(dataRow[7]); CTexObj item = new CTexObj(pName, this.device, pTexFile, this.myTerrain.heightData, pWIDTH, pHEIGHT, this.myTerrain.SCALE_FACTOR, pShiftX, pShiftY, pImageWidth, pImageHeight); this.texObjs.Add(item); } } dataSet.Dispose(); } catch { } }
public CTexObj GetTexObjByName(string name) { CTexObj result = null; if (this.texObjs.Count > 0) { for (int i = 0; i < this.texObjs.Count; i++) { if (this.texObjs[i].Name.Length == name.Length && this.texObjs[i].Name.ToUpper() == name.ToUpper()) { result = this.texObjs[i]; break; } } } return(result); }
public CDisappearLeft(CThucHanh pThucHanh, string pName, CTexObj pObj, int start, int pduration, int psteps, float pPartial, int pisound, bool loop) : base(pThucHanh, pName, pObj, start, pduration, psteps, pPartial, pisound, loop) { }
public CAppearDown(CThucHanh pThucHanh, string pName, CTexObj pObj, int start, int pduration, int psteps, float pPartial, bool pstophide, int pisound, bool loop) : base(pThucHanh, pName, pObj, start, pduration, psteps, pPartial, pstophide, pisound, loop) { }
public void Create1TexObj(string pName, string pImageFile, int pWidth, int pHeight, int pShiftX, int pShiftY, int pImageWidth, int pImageHeight) { CTexObj item = new CTexObj(pName, this.device, pImageFile, this.myTerrain.heightData, pWidth, pHeight, this.myTerrain.SCALE_FACTOR, pShiftX, pShiftY, pImageWidth, pImageHeight); this.texObjs.Add(item); }