コード例 #1
0
            public FileChunk(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, ZeldaArc ParentZA)
            {
                byte[] SrcData = FE.GetFileData();

                Tag      = Helpers.ReadString(SrcData, SrcOffset, 4);
                Elements = Helpers.Read32(SrcData, SrcOffset + 4);
                Offset   = Helpers.Read32(SrcData, SrcOffset + 8);

                Data = new object[Elements];

                TreeNode NewNode = Helpers.CreateTreeNode(Tag, this, string.Format("Offset: {0:X6}\n{1} elements", Offset, Elements));

                int ReadOffset = (int)Offset;

                for (int i = 0; i < Elements; i++)
                {
                    switch (Tag)
                    {
                    /* Typically in DZR */
                    case "ACTR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue;

                    case "TGOB": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue;

                    case "PLYR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange, ParentZA); continue;

                    case "PPNT":        /* Found in DmSpot0's Stage DZS for some reason... */
                    case "RPPN": Data[i] = new RPPN(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightSkyBlue, ParentZA); continue;

                    case "SHIP": Data[i] = new SHIP(FE, ref ReadOffset, NewNode, System.Drawing.Color.BlueViolet, ParentZA); continue;

                    case "TGDR":
                    case "DOOR":
                    case "Door": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.HotPink, ParentZA); continue;

                    case "LGTV": Data[i] = new LGTV(FE, ref ReadOffset, NewNode, System.Drawing.Color.DarkGray, ParentZA); continue;      /* ????? */

                    /* Typically in DZS */
                    case "MULT": Data[i] = new MULT(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightGray, ParentZA); continue;

                    case "TRES": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown, ParentZA); continue;
                    }

                    switch (Tag.Substring(0, 3))
                    {
                    case "ACT": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); break;

                    case "PLY": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange, ParentZA); break;

                    case "SCO": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Yellow, ParentZA); break;

                    case "TRE": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown, ParentZA); break;

                    default: Data[i] = new Generic(FE, ref ReadOffset, NewNode); NewNode.Tag = Data[i]; break;
                    }
                }

                ParentNode.Nodes.Add(NewNode);

                SrcOffset += 12;
            }
コード例 #2
0
ファイル: SHIPControl.cs プロジェクト: GUIpsp/WindViewer
        public SHIPControl(SHIP ThisShip)
        {
            InitializeComponent();

            Ship = ThisShip;

            this.SuspendLayout();
            UpdateControl();
            this.ResumeLayout();
        }
コード例 #3
0
        public SHIPControl(SHIP ThisShip)
        {
            InitializeComponent();

            Ship = ThisShip;

            this.SuspendLayout();
            UpdateControl();
            this.ResumeLayout();
        }
コード例 #4
0
ファイル: DZx.cs プロジェクト: pho/WindViewer
            public FileChunk(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, ZeldaArc ParentZA = null)
            {
                byte[] SrcData = FE.GetFileData();

                Tag = Helpers.ReadString(SrcData, SrcOffset, 4);
                Elements = Helpers.Read32(SrcData, SrcOffset + 4);
                Offset = Helpers.Read32(SrcData, SrcOffset + 8);

                Data = new object[Elements];

                TreeNode NewNode = Helpers.CreateTreeNode(Tag, this, string.Format("Offset: {0:X6}\n{1} elements", Offset, Elements));

                int ReadOffset = (int)Offset;
                for (int i = 0; i < Elements; i++)
                {
                    switch (Tag)
                    {
                        /* Typically in DZR */
                        case "ACTR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue;
                        case "TGOB": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); continue;
                        case "PLYR": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange); continue;
                        case "PPNT":    /* Found in DmSpot0's Stage DZS for some reason... */
                        case "RPPN": Data[i] = new RPPN(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightSkyBlue); continue;
                        case "SHIP": Data[i] = new SHIP(FE, ref ReadOffset, NewNode, System.Drawing.Color.BlueViolet); continue;
                        case "TGDR":
                        case "DOOR":
                        case "Door": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.HotPink, ParentZA); continue;
                        case "LGTV": Data[i] = new LGTV(FE, ref ReadOffset, NewNode, System.Drawing.Color.DarkGray); continue;  /* ????? */

                        /* Typically in DZS */
                        case "MULT": Data[i] = new MULT(FE, ref ReadOffset, NewNode, System.Drawing.Color.LightGray); continue;
                        case "TRES": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown); continue;
                        //case "EnvR": Data[i] = new EnvRChunk(FE, ref ReadOffset, NewNode, System.Drawing.Color.DarkSlateGray); continue;
                    }

                    switch (Tag.Substring(0, 3))
                    {
                        case "ACT": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.GreenYellow, ParentZA); break;
                        case "PLY": Data[i] = new ACTR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Orange); break;
                        case "SCO": Data[i] = new TGDR(FE, ref ReadOffset, NewNode, System.Drawing.Color.Yellow, ParentZA); break;
                        case "TRE": Data[i] = new TRES(FE, ref ReadOffset, NewNode, System.Drawing.Color.SaddleBrown); break;
                        default: Data[i] = new Generic(FE, ref ReadOffset, NewNode); NewNode.Tag = Data[i]; break;
                    }
                }

                ParentNode.Nodes.Add(NewNode);

                SrcOffset += 12;
            }