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 CRunActs GetActs(int iItem) { CMnuItem pMnuItem = this.mnuItems[iItem]; CRunActs result = new CRunActs(); this.LoadActs(pMnuItem, ref result); return(result); }
private void StartItem(int i) { this.runactions = this.myMenu.GetActs(i); this.TotalTimeSpan = CHelper.GetTimeSpan(this.runactions.StopTickCount); this.CurrAct = i; this.ResetAction(); this.StartActions(); this.MenuTitleText = this.GetMenuTitleText(this.CurrAct); this.bMenuHidden = true; this.TerrainVisible = true; }
public CThucHanh(Form pMapPanel, float[,] pheightData, float pSCALE_FACTOR, char pDecSepa, char pGrpSepa) { try { this.m_MapPanel = pMapPanel; this.InitializeDevice(pMapPanel); this.myTerrain = new CTerrainMesh(this.device, pheightData, pSCALE_FACTOR); this.mySound = new CSounds(pMapPanel); this.m_SoundNames = new List <string>(); this.m_BillboardMeshs = new List <CBillboardMesh>(); this.Billboards = new List <CBillboard>(); this.ModelMeshs = new List <CModelMesh>(); this.Models = new List <CModel>(); this.SpriteTexs = new List <CSpriteTex>(); this.SpriteObjs = new List <CSpriteObj>(); this.texObjs = new List <CTexObj>(); this.runactions = new CRunActs(); } catch (Exception ex) { throw ex; } }
private void LoadActs(CMnuItem pMnuItem, ref CRunActs pRunActs) { int num = 0; int num2 = 0; List <CScriptDef> list = new List <CScriptDef>(); foreach (CScriptDef current in pMnuItem.ScriptDefs) { if (current.scrptfile.Length > 0) { CScript script = this.GetScript(current.scrptfile); int start = this.GetStart(current.start, list); script.UpdateStart(start); foreach (CAct current2 in script.acts) { pRunActs.actions.Add(current2); } current.StartTickCount = script.StartTickCount; current.StopTickCount = script.StopTickCount; if (current.StartTickCount < num) { num = current.StartTickCount; } if (current.StopTickCount > num2) { num2 = current.StopTickCount; } if (num < pRunActs.StartTickCount) { pRunActs.StartTickCount = num; } if (num2 > pRunActs.StopTickCount) { pRunActs.StopTickCount = num2; } list.Add(current); } else if (current.mnuItemRef.Length > 0) { CRunActs cRunActs = new CRunActs(); CMnuItem mnuItem = this.GetMnuItem(current.mnuItemRef); if (mnuItem != null) { this.LoadActs(mnuItem, ref cRunActs); } int start2 = this.GetStart(current.start, list); cRunActs.UpdateStart(start2); foreach (CAct current3 in cRunActs.actions) { pRunActs.actions.Add(current3); } current.StartTickCount = cRunActs.StartTickCount; current.StopTickCount = cRunActs.StopTickCount; if (current.StartTickCount < num) { num = current.StartTickCount; } if (current.StopTickCount > num2) { num2 = current.StopTickCount; } if (num < pRunActs.StartTickCount) { pRunActs.StartTickCount = num; } if (num2 > pRunActs.StopTickCount) { pRunActs.StopTickCount = num2; } list.Add(current); } } }