当前位置: 首页>>代码示例>>C#>>正文


C# Meta.Dispose方法代码示例

本文整理汇总了C#中HaloMap.Meta.Meta.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Meta.Dispose方法的具体用法?C# Meta.Dispose怎么用?C# Meta.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HaloMap.Meta.Meta的用法示例。


在下文中一共展示了Meta.Dispose方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: tsExternalReferenceAdd_Click

        private void tsExternalReferenceAdd_Click(object sender, EventArgs e)
        {
            TreeNode tn = treeViewTagReflexives.SelectedNode;
            reflexiveData rd = (reflexiveData)tn.Tag;
            if (rd.reflexive == null)
            {
                MessageBox.Show("Not a reflexive!");
                return;
            }

            WinMetaEditor.references refs = new WinMetaEditor.references();
            if (rd.inTagNumber == this.meta.TagIndex)
            {
                refs.ident = this.meta.offset + rd.baseOffset + this.meta.magic;
                refs.offset = rd.baseOffset;
                refs.tagIndex = this.meta.TagIndex;
                refs.tagName = this.meta.name;
                refs.tagType = this.meta.type;
            }
            else
            {
                refs.tagIndex = map.Functions.ForMeta.FindMetaByOffset(rd.baseOffset);
                Meta m = new Meta(map);
                map.OpenMap(MapTypes.Internal);
                m.ReadMetaFromMap(refs.tagIndex, true);
                map.CloseMap();
                refs.ident = rd.baseOffset + m.magic;
                refs.offset = rd.baseOffset;
                refs.tagName = m.name;
                refs.tagType = m.type;
                m.Dispose();
            }
            refs.chunkCount = rd.chunkCount;
            refs.size = rd.reflexive.chunkSize;
            refs.name = rd.reflexive.name;

            // Check for duplicates & remove
            List<WinMetaEditor.references> refList = ((WinMetaEditor)this.ParentForm).reflexiveReferences;
            for (int i = 0; i < refList.Count; i++)
            {
                if (refList[i].ident == refs.ident)
                    refList.RemoveAt(i--);
            }

            // Always add to top of list
            refList.Insert(0, refs);
        }
开发者ID:troymac1ure,项目名称:Entity,代码行数:47,代码来源:MetaEditorControlPage.cs

示例2: loadBSP

        /// <summary>
        /// The load bsp. The BSP is loaded into memory.
        /// </summary>
        /// <param name="BSPNum">The bsp num.</param>
        /// <remarks></remarks>
        private void loadBSP(int BSPId)
        {
            this.Cursor = Cursors.WaitCursor;
            //// Load the BSP viewer
            Meta meta = new Meta(map);
            meta.TagIndex = BSPId; // load BSP into MemoryStream (MS)
            meta.ScanMetaItems(true, false);
            BSPModel bsp = new BSPModel(ref meta);
            this.Cursor = Cursors.Arrow;
            if (bsp.BspNumber != -1)
            {
                BSPViewer bv = new BSPViewer(bsp, map);
                bv.Dispose();
                bv = null;
            }

            meta.Dispose();
            GC.Collect();
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:24,代码来源:MapForm.cs

示例3: Refresh

        /// <summary>
        /// Reloads the map.
        /// </summary>
        /// <param name="map">The map.</param>
        /// <returns>Returns the reloaded Map</returns>
        /// <remarks>This needs to use a return value, because the loaded map changes were not being saved. They would be
        /// lost when the function returned and we ?cannot pass Map as a ref?.</remarks>
        public static Map Refresh(Map map)
        {
            map.CloseMap();
            Meta tempmeta = new Meta(map);
            if (map.SelectedMeta != null)
            {
                tempmeta = map.SelectedMeta;
            }

            map = LoadFromFile(map.filePath);

            if (tempmeta.MS != null)
            {
                int tagIndex = map.Functions.ForMeta.FindByNameAndTagType(tempmeta.type, tempmeta.name);
                // SelectedMeta belongs to map above, so keeps original map "locked"
                Meta meta = Map.GetMetaFromTagIndex(tagIndex, map, tempmeta.scannedwithent, tempmeta.parsed);
                map.SelectedMeta = meta;
                tempmeta.Dispose();
            }
            return map;
        }
开发者ID:troymac1ure,项目名称:Entity,代码行数:28,代码来源:Map.cs

示例4: LoadSpawns


//.........这里部分代码省略.........
                        bsp.Spawns.Spawn[x].bbYDiff = bsp.Spawns.Spawn[xx].bbYDiff;
                        bsp.Spawns.Spawn[x].bbZDiff = bsp.Spawns.Spawn[xx].bbZDiff;
                        found = true;
                        break;
                    }
                }

                if (found)
                {
                    continue;
                }
                #endregion

                #region ReadSpawnMeta

                Meta m = new Meta(map);
                if (tempspawn.ModelTagNumber == -1)
                {
                    MessageBox.Show("Test");
                }

                m.ReadMetaFromMap(tempspawn.ModelTagNumber, false);

                #endregion

                #region DirectXModel

                ParsedModel pm = new ParsedModel(ref m);

                // pm.PermutationString=pm.hlmt.Permutations[pm.hlmt.FindPermutationByBaseClass,
                ParsedModel.DisplayedInfo.LoadDirectXTexturesAndBuffers(ref render.device, ref pm);
                SpawnModel.Add(pm);
                spawnmodelindex[x] = SpawnModel.Count - 1;
                m.Dispose();

                #endregion

                #region BoundingBox

                float boxwidth = pm.BoundingBox.MaxX - pm.BoundingBox.MinX;
                float boxheight = pm.BoundingBox.MaxY - pm.BoundingBox.MinY;
                float boxdepth = pm.BoundingBox.MaxZ - pm.BoundingBox.MinZ;
                try
                {
                    BoundingBoxModel[x] = Mesh.Box(render.device, boxwidth, boxheight, boxdepth);
                }
                catch (Exception ex)
                {
                    Global.ShowErrorMsg("Failure to create Bounding Box Mesh for " + pm.name +
                        "\nWidth : " + boxwidth.ToString() +
                        "\nHeight: " + boxheight.ToString() +
                        "\nLength: " + boxdepth.ToString(),
                        ex);
                }
                // Used for fixing position of bounding boxes
                bsp.Spawns.Spawn[x].bbXDiff = pm.BoundingBox.MaxX + pm.BoundingBox.MinX;
                bsp.Spawns.Spawn[x].bbYDiff = pm.BoundingBox.MaxY + pm.BoundingBox.MinY;
                bsp.Spawns.Spawn[x].bbZDiff = pm.BoundingBox.MaxZ + pm.BoundingBox.MinZ;

                #endregion
            }

            if (render.device.DeviceCaps.RasterCaps.SupportsFogTable && bsp.sky.fogenabled &&
                bsp.sky.fog.FogThickness != 0)
            {
                int a = (int)(bsp.sky.fog.A * 255);
开发者ID:troymac1ure,项目名称:Entity,代码行数:67,代码来源:BSPViewer.cs


注:本文中的HaloMap.Meta.Meta.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。