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


C# Meta.Meta类代码示例

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


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

示例1: MetaEditorControlPage

        public MetaEditorControlPage(Meta meta, MapForms.MapForm mapForm)
        {
            InitializeComponent();

            // Try to draw treeview nodes to "hide" "disabled" nodes; fail. Still leaves space where node is
            //treeViewTagReflexives.DrawMode = TreeViewDrawMode.OwnerDrawAll;
            //treeViewTagReflexives.DrawNode += new DrawTreeNodeEventHandler(myTreeView_DrawNode);

            this.MapForm = mapForm;
            this.map = mapForm.map;

            this.meta = meta;
            this.BR = new BinaryReader(meta.MS);
            // Create a backup of the Tags memory stream, for restoring, comparing, etc
            msBackup = new MemoryStream(meta.MS.ToArray());
            msDebug = new MemoryStream((int)meta.MS.Length);

            mainReflexive = createReflexiveList();  // Done
            refreshTreeListing(mainReflexive);      // Done

            this.treeViewTagReflexives.Sort();
            treeViewTagReflexives.SelectedNode = treeViewTagReflexives.Nodes[0];
            // Default Peek/Poke to "Single Value"
            this.tscbApplyTo.SelectedIndex = 0;
        }
开发者ID:troymac1ure,项目名称:Entity,代码行数:25,代码来源:MetaEditorControlPage.cs

示例2: DataValues

 public DataValues(Meta meta, string iEntName, Map map, int iOffsetInChunk, IFPIO.ObjectEnum type, int iLineNumber)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     this.Controls[2].Text = type.ToString();
     this.ValueType = type;
     switch (this.ValueType)
     {
         case IFPIO.ObjectEnum.Byte:
             this.size = 1;
             break;
         case IFPIO.ObjectEnum.Short:
         case IFPIO.ObjectEnum.UShort:
             this.size = 2;
             break;
         case IFPIO.ObjectEnum.Int:
         case IFPIO.ObjectEnum.UInt:
         case IFPIO.ObjectEnum.Float:
         case IFPIO.ObjectEnum.Unknown:
             this.size = 4;
             break;
         case IFPIO.ObjectEnum.Unused:
             this.size = 0;
             break;
     }
     this.AutoSize = false;
 }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:33,代码来源:DataValues.cs

示例3: H2ParsedPRTM

        /// <summary>
        /// The h 2 parsed prtm.
        /// </summary>
        /// <param name="meta">The meta.</param>
        /// <remarks></remarks>
        public void H2ParsedPRTM(ref Meta meta)
        {
            string[] temps = meta.name.Split('\\');
            name = temps[temps.Length - 1];

            BoundingBox = new BoundingBoxContainer();

            BinaryReader BR = new BinaryReader(meta.MS);

            RawDataMetaChunks = new RawDataMetaChunk[1];
            RawDataMetaChunks[0] = new PRTMRawDataMetaChunk(ref meta);

            BR.BaseStream.Position = 28;
            int tempshad = BR.ReadInt32();
            int shadid = meta.Map.Functions.ForMeta.FindMetaByID(tempshad);
            Shaders = new ShaderContainer();
            Shaders.Shader = new ShaderInfo[1];
            Shaders.Shader[0] = new ShaderInfo(shadid, meta.Map);

            // LOD = new LODInfo(ref meta, meta.Map, ref RawDataMetaChunks);
            Display = new DisplayedInfo();
            Display.Chunk.Add(0);
            Display.ShaderIndex = new int[1];
            Display.ShaderIndex[0] = 0;

            // MessageBox.Show("test");
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:32,代码来源:PRTMModel.cs

示例4: argb_color

        /// <summary>
        /// Creates a color wheel with associated (A)RGB text boxes
        /// </summary>
        /// <param name="meta"></param>
        /// <param name="iEntName">Control display name</param>
        /// <param name="map"></param>
        /// <param name="iOffsetInChunk"></param>
        /// <param name="hasAlphaChannel">True if ARGB, False for RGB</param>
        /// <param name="valueType">Float for 0f-1f, Int for 0-255</param>
        /// <param name="iLineNumber"></param>
        public argb_color(Meta meta, string iEntName, Map map, int iOffsetInChunk, bool hasAlphaChannel, IFPIO.ObjectEnum valueType,int iLineNumber)
        {
            InitializeComponent();

            this.meta = meta;
            this.LineNumber = iLineNumber;
            this.chunkOffset = iOffsetInChunk;
            this.map = map;
            this.EntName = " " + iEntName + " ";
            this.Dock = DockStyle.Top;
            this.Controls[0].Text = EntName;
            this.hasAlpha = hasAlphaChannel;
            this.ValueType = valueType;
            switch (valueType)
            {
                case IFPIO.ObjectEnum.Byte:
                    this.eachSize = 1;
                    break;
                case IFPIO.ObjectEnum.Short:
                case IFPIO.ObjectEnum.UShort:
                    this.eachSize = 2;
                    break;
                case IFPIO.ObjectEnum.Int:
                case IFPIO.ObjectEnum.UInt:
                case IFPIO.ObjectEnum.Float:
                case IFPIO.ObjectEnum.Unknown:
                    this.eachSize = 4;
                    break;
            }
            this.size = (hasAlpha ? eachSize * 4 : eachSize * 3);

            CW = new ColorWheel();
            CW.Location = new Point(180, 5);

            Red = new DataValues(meta, "Red", map, iOffsetInChunk, valueType, iLineNumber);
            Red.BackColor = System.Drawing.Color.DarkRed;
            CW.setTextBox(Red.textBox1, Color.Red);

            Blue = new DataValues(meta, "Blue", map, iOffsetInChunk + eachSize, valueType, iLineNumber);
            Blue.BackColor = System.Drawing.Color.DarkBlue;
            CW.setTextBox(Blue.textBox1, Color.Blue);

            Green = new DataValues(meta, "Green", map, iOffsetInChunk + eachSize * 2, valueType, iLineNumber);
            Green.BackColor = System.Drawing.Color.FromArgb(10, 80, 35);
            CW.setTextBox(Green.textBox1, Color.Green);

            if (hasAlpha)
            {
                Alpha = new DataValues(meta, "Alpha", map, iOffsetInChunk + eachSize * 3, valueType, iLineNumber);
                Alpha.BackColor = System.Drawing.Color.Gray;
                CW.setTextBox(Alpha.textBox1, Color.White);
                gbRGBColor.Controls.Add(Alpha);
            }

            gbRGBColor.Controls.Add(CW);
            CW.BringToFront();
            gbRGBColor.Controls.Add(Green);
            gbRGBColor.Controls.Add(Blue);
            gbRGBColor.Controls.Add(Red);
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:70,代码来源:rgb_color.cs

示例5: Enums

 public Enums(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iType, object[] ioptions, int iLineNumber)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this.Options = ioptions;
     this.enumType = iType;
     this.size = iType / 8;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     InitializeComponent();
     this.Size = this.PreferredSize;
     this.Dock = DockStyle.Top;
     this.Controls[0].Text = EntName;
     switch (iType)
     {
         case 8:
             {
                 this.Controls[2].Text = "Enum8";
                 break;
             }
         case 16:
             {
                 this.Controls[2].Text = "Enum16";
                 break;
             }
         case 32:
             {
                 this.Controls[2].Text = "Enum32";
                 break;
             }
     }
     this.AutoSize = false;
 }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:34,代码来源:Enums.cs

示例6: GetFramesFromHalo2Model

        /// <summary>
        /// The get frames from halo 2 model.
        /// </summary>
        /// <param name="meta">The meta.</param>
        /// <remarks></remarks>
        public void GetFramesFromHalo2Model(ref Meta meta)
        {
            BinaryReader BR = new BinaryReader(meta.MS);
            BR.BaseStream.Position = 72;
            int tempc = BR.ReadInt32();
            int tempr = BR.ReadInt32() - meta.magic - meta.offset;
            for (int x = 0; x < tempc; x++)
            {
                FrameInfo f = new FrameInfo();
                BR.BaseStream.Position = tempr + (96 * x);
                f.Name = meta.Map.Strings.Name[BR.ReadUInt16()];
                BR.ReadUInt16();
                f.Parent = BR.ReadInt16();
                f.Child = BR.ReadInt16();
                f.Sibling = BR.ReadInt16();
                BR.BaseStream.Position = tempr + (96 * x) + 12;
                f.x = BR.ReadSingle();
                f.y = BR.ReadSingle();
                f.z = BR.ReadSingle();
                f.i = BR.ReadSingle();
                f.j = BR.ReadSingle();
                f.k = BR.ReadSingle();
                f.w = BR.ReadSingle();
                f.matrix = Matrix.Identity;

                Quaternion q = new Quaternion(f.i, f.j, f.k, f.w);
                f.matrix.Multiply(Matrix.Translation(f.x, f.y, f.z));
                f.matrix.RotateQuaternion(q);

                BR.ReadSingle();

                f.skinweightmatrix = Matrix.Identity;
                f.skinweightmatrix.M11 = BR.ReadSingle();
                f.skinweightmatrix.M12 = BR.ReadSingle();
                f.skinweightmatrix.M13 = BR.ReadSingle();
                f.skinweightmatrix.M14 = 0.0f;

                f.skinweightmatrix.M21 = BR.ReadSingle();
                f.skinweightmatrix.M22 = BR.ReadSingle();
                f.skinweightmatrix.M23 = BR.ReadSingle();
                f.skinweightmatrix.M24 = 0.0f;

                f.skinweightmatrix.M31 = BR.ReadSingle();
                f.skinweightmatrix.M32 = BR.ReadSingle();
                f.skinweightmatrix.M33 = BR.ReadSingle();
                f.skinweightmatrix.M34 = 0.0f;

                f.skinweightmatrix.M41 = BR.ReadSingle();
                f.skinweightmatrix.M42 = BR.ReadSingle();
                f.skinweightmatrix.M43 = BR.ReadSingle();
                f.skinweightmatrix.M44 = 1.0f;

                f.DistanceFromParent = BR.ReadSingle();

                // f.matrix.MultiplyTranspose(f.skinweightmatrix);//=Matrix.Transformation(new Vector3(0, 0, 0), new Quaternion(),new Vector3(1,1,1), new Vector3(0, 0, 0), q, new Vector3(f.x, f.y, f.z));
                Frame.Add(f);
            }
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:63,代码来源:FrameHierarchy.cs

示例7: loadMeta

        public void loadMeta(Meta meta, HaloVersionEnum HaloVersion, string FileName)
        {
            this.fileName = fileName;
            this.HaloVersion = HaloVersion;
            this.meta = meta;

            loadFile();

            createTreeListing();
        }
开发者ID:nolenfelten,项目名称:Entity,代码行数:10,代码来源:TagTreeView.cs

示例8: BuildMeta

        /// <summary>
        /// The build meta.
        /// </summary>
        /// <param name="metasplit">The metasplit.</param>
        /// <param name="map">The map.</param>
        /// <returns></returns>
        /// <remarks></remarks>
        public static Meta BuildMeta(MetaSplitter metasplit, Map map)
        {
            metasize = 0;
            MetaStream = new MemoryStream(metasplit.Header.chunksize);
            BinaryWriter BW = new BinaryWriter(MetaStream);

            // BW.BaseStream.Position = 0;
            // BW.Write(metasplit.Header.MS.ToArray(), 0, metasplit.Header.chunksize);
            metasize += metasplit.Header.chunksize;

            TagIndex = metasplit.TagIndex;

            Meta m = new Meta(map);

            List<Meta.Item> NewItems = new List<Meta.Item>();

            // Major error here! Size is not calculated right!
            RecursivelyAddPiecesToMeta(metasplit.Header, ref NewItems, ref BW);

            m.items = NewItems;
            if (MetaStream.Length % 4 != 0)
            {
                metasize += (int)MetaStream.Length % 4;
                MetaStream.SetLength(MetaStream.Length + MetaStream.Length % 4);
            }

            m.MS = MetaStream;
            m.size = metasize;
            m.type = metasplit.type;
            m.name = metasplit.name;
            m.rawType = metasplit.rawtype;
            m.raw = metasplit.raw;
            m.magic = metasplit.magic;
            m.offset = metasplit.offset;

            m.TagIndex = TagIndex;
            m.RelinkReferences();
            m.WriteReferences();

            // m.items.Clear();
            // MetaScanner Ms = new MetaScanner();
            if (m.rawType != RawDataContainerType.Empty)
            {
                map.OpenMap(MapTypes.Internal);
                m.raw = map.Functions.ForMeta.ReadRaw(m.TagIndex, false);
                map.CloseMap();
            }

            // map.OpenMap(MapTypes.Internal);
            // IFPIO ifp=IFP.IFPHashMap.GetIfp(m.type);
            // m.parsed = true;
            // Ms.ScanWithIFP(ref ifp, ref m, map) ;
            // map.CloseMap();
            return m;
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:62,代码来源:MetaBuilder.cs

示例9: StringBox

 public StringBox(Meta meta, string iEntName, Map map, int iOffsetInChunk, int iLineNumber, int chunkCount)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this.chunkOffset = iOffsetInChunk;
     this.map = map;
     this.EntName = iEntName;
     this.size = chunkCount;
     InitializeComponent();
     this.Size = this.PreferredSize;
     this.Dock = DockStyle.Top;
     this.label3.Text = EntName;
     this.AutoSize = false;
 }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:14,代码来源:StringBox.cs

示例10: ParsedBitmap

 /// <summary>
 /// Initializes a new instance of the <see cref="ParsedBitmap"/> class.
 /// </summary>
 /// <param name="meta">The meta.</param>
 /// <param name="map">The map.</param>
 /// <remarks></remarks>
 public ParsedBitmap(ref Meta meta, Map map)
 {
     BitmapHeader = new HaloBitmapHeader(ref meta);
     switch (map.HaloVersion)
     {
         case HaloVersionEnum.Halo2:
         case HaloVersionEnum.Halo2Vista:
             ReadH2ParsedBitmap(ref meta);
             break;
         case HaloVersionEnum.HaloCE:
         case HaloVersionEnum.Halo1:
             ReadCEParsedBitmap(ref meta);
             break;
     }
 }
开发者ID:troymac1ure,项目名称:Entity,代码行数:21,代码来源:ParsedBitmap.cs

示例11: Add

        /// <summary>
        /// The add.
        /// </summary>
        /// <param name="tagIndex">Index of the tag.</param>
        /// <param name="metasplit">The metasplit.</param>
        /// <remarks></remarks>
        public void Add(int tagIndex, MetaSplitter metasplit)
        {
            // TagIndex - Global Variable
            this.TagIndex = tagIndex;

            ArrayList metas = new ArrayList(0);

            for (int x = 0; x < map.IndexHeader.metaCount; x++)
            {
                // sender.setProgressBar(x / map.IndexHeader.metaCount);
                Meta m = new Meta(map);
                m.ReadMetaFromMap(x, true);

                // Read meta layout of TAG from .ENT file
                IFPIO ifpx = IFPHashMap.GetIfp(m.type, map.HaloVersion);

                m.headersize = ifpx.headerSize;

                if (m.type == "sbsp")
                {
                }
                else
                {
                    // anything but "sbsp"
                    m.scanner.ScanWithIFP(ref ifpx);

                    // metaScanner.ScanManually(ref m, ref map);
                }

                metas.Add(m);
            }

            // sender.setProgressBar(0);
            Meta targetTag = (Meta)metas[tagIndex];

            Meta tempm = MetaBuilder.BuildMeta(metasplit, map); // (Meta) metas[TagIndex];
            metas[tagIndex] = tempm;

            // ((Meta)metas[TagIndex]).RelinkReferences(map);
            SizeOfShift = tempm.size - targetTag.size;

            // Map IS already open? I guess it's a safety check.
            map.OpenMap(MapTypes.Internal);
            FixReflexives(metas);

            map.CloseMap();
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:53,代码来源:ChunkAdder.cs

示例12: EntStrings

 /// <summary>
 /// Creates a new EntStrings class for a set-length unicode or ASCII string.
 /// </summary>
 /// <param name="meta">The controls meta data</param>
 /// <param name="iEntName">The identifying name of the meta string</param>
 /// <param name="map">The metas map file</param>
 /// <param name="iOffsetInChunk">The offset to the string in the memory stream</param>
 /// <param name="ilength">The set length of the string (usually 32, 64 or 256, but will handle any length strings)</param>
 /// <param name="itype">Set to false for ASCII strings, true for Unicode (UTF-8) strings</param>
 /// <param name="iLineNumber">The associated line number</param>
 public EntStrings(Meta meta, string iEntName, Map map, int iOffsetInChunk, int ilength, bool itype, int iLineNumber)
 {
     this.meta = meta;
     this.LineNumber = iLineNumber;
     this._entUnicode = itype;
     this._length = ilength;
     this.size = this._length;
     this.map = map;
     this.EntName = iEntName;
     this.chunkOffset = iOffsetInChunk;
     InitializeComponent();
     this.label2.Text = EntName;
     this.Dock = DockStyle.Top;
     this.Size = this.PreferredSize;
     this.AutoSize = false;
     this.Leave += new EventHandler(String_Leave);
 }
开发者ID:troymac1ure,项目名称:Entity,代码行数:27,代码来源:EntStrings.cs

示例13: MetaEditorControlPage

        public MetaEditorControlPage(Meta meta, MapForms.MapForm mapForm)
        {
            InitializeComponent();

            this.MapForm = mapForm;
            this.map = mapForm.map;

            this.meta = meta;
            this.BR = new BinaryReader(meta.MS);
            // Create a backup of the Tags memory stream, for restoring, comparing, etc
            msBackup = new MemoryStream(meta.MS.ToArray());
            msDebug = new MemoryStream((int)meta.MS.Length);

            createTreeListing();
            this.treeViewTagReflexives.Sort();
            treeViewTagReflexives.SelectedNode = treeViewTagReflexives.Nodes[0];
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:17,代码来源:MetaEditorControlPage.cs

示例14: SID

        public SID(Meta meta, string iEntName, Map map, int iOffsetInChunk,int iLineNumber)
        {
            this.meta = meta;
            this.LineNumber = iLineNumber;
            this.chunkOffset = iOffsetInChunk;
            this.map = map;
            this.EntName = iEntName;
            this.size = 4;
            InitializeComponent();
            this.Size = this.PreferredSize;
            this.Dock = DockStyle.Top;
            this.Controls[0].Text = EntName;
            this.AutoSize = false;

            //this.comboBox1.DataSource = map.Strings.Name;
            this.comboBox1.DataSource = null;    // Loading data source takes a long time. Only do it when needed.
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:17,代码来源:SID.cs

示例15: SplitWithIFP

        /// <summary>
        /// The split with ifp.
        /// </summary>
        /// <param name="ifp">The ifp.</param>
        /// <param name="meta">The meta.</param>
        /// <param name="map">The map.</param>
        /// <remarks></remarks>
        public void SplitWithIFP(ref IFPIO ifp, ref Meta meta, Map map)
        {
            this.type = meta.type;
            this.TagIndex = meta.TagIndex;
            this.name = meta.name;
            this.offset = meta.offset;
            this.magic = meta.magic;
            this.raw = meta.raw;
            this.rawtype = meta.rawType;
            map.OpenMap(MapTypes.Internal);
            if (ifp.items != null)
            {
                map.BR.BaseStream.Position = meta.offset;
                Header = new SplitReflexive();
                Header.offset = 0;
                Header.Chunks = new List<SplitReflexive>();
                Header.translation = 0;

                // Header.MS = new MemoryStream(ifp.headerSize);
                // Header.MS.Write(map.BR.ReadBytes(ifp.headerSize), 0, ifp.headerSize);
                Header.chunksize = ifp.headerSize;
                Header.chunkcount = 1;
                Header.splitReflexiveType = SplitReflexive.SplitReflexiveType.Container;
                Header.realtranslation = meta.offset;
                if (meta.type == "sbsp")
                {
                    int p = map.BSP.FindBSPNumberByBSPIdent(meta.ident);
                    CycleElements(
                        ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic);
                }
                else if (meta.type == "ltmp")
                {
                    int p = map.BSP.FindBSPNumberByLightMapIdent(meta.ident);
                    CycleElements(
                        ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.BSP.sbsp[p].magic);
                }
                else
                {
                    // not "sbsp" or "ltmp"
                    CycleElements(ref Header, ifp.items, ref meta, meta.offset, map, meta.TagIndex, map.SecondaryMagic);
                }
            }

            map.CloseMap();
        }
开发者ID:nolenfelten,项目名称:Blam_BSP,代码行数:52,代码来源:MetaSplitter.cs


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