コード例 #1
0
        public RPPN(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
        {
            ParentFile = FE;

            byte[] SrcData = ParentFile.GetFileData();

            Offset = SrcOffset;

            _Unknown  = Helpers.Read32(SrcData, SrcOffset);
            _Position = new Vector3(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x08)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)));

            SrcOffset += 0x10;

            RenderColor = Color;

            Node = Helpers.CreateTreeNode(string.Format("{0}", _Position), this);
            ParentNode.BackColor = RenderColor;
            ParentNode.Nodes.Add(Node);

            ZA = ParentZA;

            GLID = GL.GenLists(1);
            GL.NewList(GLID, ListMode.Compile);
            Helpers.DrawFramedSphere(new Vector3d(0, 0, 0), 25.0f, 10);
            GL.EndList();
        }
コード例 #2
0
 public DZx(RARC.FileEntry FE, TreeNode TN, ZeldaArc PZA = null)
 {
     Root      = TN;
     FileEntry = FE;
     ParentZA  = PZA;
     Load();
 }
コード例 #3
0
        public MULT(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
        {
            ParentFile = FE;

            byte[] SrcData = ParentFile.GetFileData();

            Offset = SrcOffset;

            _Translation = new Vector2(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04)));
            _Rotation   = ((short)(Helpers.Read16(SrcData, SrcOffset + 0x08)) / 182.04444444444444f).Clamp(-180, 179);
            _RoomNumber = SrcData[SrcOffset + 0x0A];
            _Unknown2   = SrcData[SrcOffset + 0x0B];

            SrcOffset += 0x0C;

            RenderColor = Color;

            Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, new Vector2(_Translation.X / 100000, _Translation.Y / 100000)), this, string.Format("{0}", _Translation));
            ParentNode.BackColor = RenderColor;
            ParentNode.Nodes.Add(Node);

            ZA = ParentZA;

            GLID = GL.GenLists(1);
            GL.NewList(GLID, ListMode.Compile);
            Helpers.DrawFramedCube(new Vector3d(15, 15, 15));
            GL.EndList();
        }
コード例 #4
0
ファイル: DZx.cs プロジェクト: pho/WindViewer
 public DZx(RARC.FileEntry FE, TreeNode TN, ZeldaArc PZA = null)
 {
     Root = TN;
     FileEntry = FE;
     ParentZA = PZA;
     Load();
 }
コード例 #5
0
        public ZAControl(ZeldaArc ThisActor)
        {
            InitializeComponent();

            Actor = ThisActor;

            this.SuspendLayout();
            UpdateControl();
            this.ResumeLayout();
        }
コード例 #6
0
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;

            _data = new DZSFormat(stage.DZSs[0].FileEntry.GetFileData(), ref srcOffset);

            //Now that the DZSFormat is populated with information, we're going to load the UI up!

            //EnvR
            foreach (DZSChunkHeader chunk in _data.ChunkHeaders)
            {
                switch (chunk.Tag)
                {
                case "EnvR":
                    //Populate the Dropdown
                    for (int i = 0; i < chunk.ElementCount; i++)
                    {
                        EnvRDropdown.Items.Add("EnvR [" + i + "]");
                    }
                    EnvRDropdown.SelectedIndex = 0;
                    break;

                case "Colo":
                    //Populate the Dropdown
                    for (int i = 0; i < chunk.ElementCount; i++)
                    {
                        ColorDropdown.Items.Add("Colo [" + i + "]");
                    }
                    ColorDropdown.SelectedIndex = 0;
                    break;

                case "Pale":
                    //Populate the Dropdown
                    for (int i = 0; i < chunk.ElementCount; i++)
                    {
                        PaleDropdown.Items.Add("Pale [" + i + "]");
                    }
                    PaleDropdown.SelectedIndex = 0;
                    break;

                case "Virt":
                    //Populate the Dropdown
                    for (int i = 0; i < chunk.ElementCount; i++)
                    {
                        VirtDropdown.Items.Add("Virt [" + i + "]");
                    }
                    VirtDropdown.SelectedIndex = 0;
                    break;

                default:
                    break;
                }
            }
        }
コード例 #7
0
        private void RoomExitEditor_Load(object sender, EventArgs e)
        {
            ZeldaArc stage = _mainForm.Rooms[0];

            if (stage == null)
            {
                Console.WriteLine("Load a Stage first!");
                return;
            }

            LoadDZSForStage(stage);
        }
コード例 #8
0
ファイル: ExitEditor.cs プロジェクト: pho/WindViewer
        /// <summary>
        /// This is temporary until we replace out the main form's version of the DZS loading stuff.
        /// Sorry!
        /// </summary>
        /// <param name="stage"></param>
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;
            _data = new DZSFormat(stage.DZRs[0].FileEntry.GetFileData(), ref srcOffset);

            List<IChunkType> sclsChunks = _data.GetChunksOfType(DZSChunkTypes.SCLS);
            if (sclsChunks == null)
                return;

            for (int i = 0; i < sclsChunks.Count; i++)
            {
                SclsChunk exitChunk = (SclsChunk) sclsChunks[i];
                sclsDropdown.Items.Add("[" + i + "] - " + exitChunk.DestinationName);
            }

            sclsDropdown.SelectedIndex = 0;
            _sclsChunk = (SclsChunk) sclsChunks[sclsDropdown.SelectedIndex];
            UpdateSclsControlsFromFile();
        }
コード例 #9
0
ファイル: SpawnpointEditor.cs プロジェクト: pho/WindViewer
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;
            _data = new DZSFormat(stage.DZRs[0].FileEntry.GetFileData(), ref srcOffset);

            List<IChunkType> plyrChunks = _data.GetChunksOfType(DZSChunkTypes.PLYR);
            if (plyrChunks == null)
                return;

            for (int i = 0; i < plyrChunks.Count; i++)
            {
                PlyrChunk plyrChunk = (PlyrChunk)plyrChunks[i];
                spawnDropdown.Items.Add("[" + i + "] - " + plyrChunk.Name);
            }

            spawnDropdown.SelectedIndex = 0;
            _plyrChunk = (PlyrChunk)plyrChunks[spawnDropdown.SelectedIndex];
            UpdateUIControlsFromFile();
        }
コード例 #10
0
ファイル: TGDR.cs プロジェクト: GUIpsp/WindViewer
        public TGDR(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
        {
            ParentFile = FE;

            byte[] SrcData = ParentFile.GetFileData();

            Offset = SrcOffset;

            _Name = Helpers.ReadString(SrcData, SrcOffset, 8);
            _Parameters = Helpers.Read32(SrcData, SrcOffset + 8);
            _Position = new Vector3(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14)));

            _Unknown1 = Helpers.Read16(SrcData, SrcOffset + 0x18);
            _RotationY = ((short)Helpers.Read16(SrcData, SrcOffset + 0x1A) / 182.04444444444444).Clamp(-180, 179);
            _Unknown2 = Helpers.Read16(SrcData, SrcOffset + 0x1C);

            _Unknown3 = Helpers.Read16(SrcData, SrcOffset + 0x1E);
            _Unknown4 = Helpers.Read32(SrcData, SrcOffset + 0x20);

            SrcOffset += 0x24;

            RenderColor = Color;

            Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, _Name), this);
            ParentNode.BackColor = RenderColor;
            ParentNode.Nodes.Add(Node);

            GLID = GL.GenLists(1);
            GL.NewList(GLID, ListMode.Compile);

            if (ParentZA != null)
            {
                MatchedModel = ParentZA.J3Dxs.Find(x => x.FileEntry.FileName.StartsWith(_Name));
                MatchedCollision = ParentZA.DZBs.Find(x => x.Name.StartsWith(_Name));
            }

            Helpers.DrawFramedCube(new Vector3d(15, 15, 15));
            GL.EndList();
        }
コード例 #11
0
        /// <summary>
        /// Called when the Form is loaded. This is a temporary solution until there's some form of Event evoked by
        /// Archives being loaded. We'll grab the loaded archives from the MainForm and populate our list of DZS files
        /// with it.
        /// </summary>
        private void EnvironmentLightingEditorForm_Load(object sender, EventArgs e)
        {
            ZeldaArc stage = _mainForm.Stage;

            if (stage == null)
            {
                Console.WriteLine("Load a Stage first!");
                return;
            }


            //For each loaded Archive we're going to want to grab the DZS file out of them.
            foreach (DZx dzS in stage.DZSs)
            {
                dzsFileDropdown.Items.Add(Path.GetFileName(stage.Filename) + @"\" + dzS.FileEntry.FileName);
            }

            LoadDZSForStage(stage);
            dzsFileDropdown.SelectedIndex = 0;
        }
コード例 #12
0
        public ACTR(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
        {
            ParentFile = FE;

            byte[] SrcData = ParentFile.GetFileData();

            Offset = SrcOffset;

            _Name       = Helpers.ReadString(SrcData, SrcOffset, 8);
            _Parameters = Helpers.Read32(SrcData, SrcOffset + 8);
            _Position   = new Vector3(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14)));
            _Rotation = new Vector3(
                ((short)Helpers.Read16(SrcData, SrcOffset + 0x18) / 182.04444444444444f).Clamp(-180, 179),
                ((short)Helpers.Read16(SrcData, SrcOffset + 0x1A) / 182.04444444444444f).Clamp(-180, 179),
                ((short)Helpers.Read16(SrcData, SrcOffset + 0x1C) / 182.04444444444444f).Clamp(-180, 179));
            _Unknown = Helpers.Read16(SrcData, SrcOffset + 0x1E);

            SrcOffset += 0x20;

            RenderColor = Color;

            Node = Helpers.CreateTreeNode(string.Format("{0:X6}: {1}", Offset, _Name), this);
            ParentNode.BackColor = RenderColor;
            ParentNode.Nodes.Add(Node);

            GLID = GL.GenLists(1);
            GL.NewList(GLID, ListMode.Compile);

            if (ParentZA != null)
            {
                MatchedModel     = ParentZA.J3Dxs.Find(x => x.FileEntry.FileName.StartsWith(_Name));
                MatchedCollision = ParentZA.DZBs.Find(x => x.Name.StartsWith(_Name));
            }

            ZA = ParentZA;
            Helpers.DrawFramedCube(new Vector3d(15, 15, 15));
            GL.EndList();
        }
コード例 #13
0
        /// <summary>
        /// This is temporary until we replace out the main form's version of the DZS loading stuff.
        /// Sorry!
        /// </summary>
        /// <param name="stage"></param>
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;

            _data = new DZSFormat(stage.DZRs[0].FileEntry.GetFileData(), ref srcOffset);

            List <IChunkType> sclsChunks = _data.GetChunksOfType(DZSChunkTypes.SCLS);

            if (sclsChunks == null)
            {
                return;
            }

            for (int i = 0; i < sclsChunks.Count; i++)
            {
                SclsChunk exitChunk = (SclsChunk)sclsChunks[i];
                sclsDropdown.Items.Add("[" + i + "] - " + exitChunk.DestinationName);
            }

            sclsDropdown.SelectedIndex = 0;
            _sclsChunk = (SclsChunk)sclsChunks[sclsDropdown.SelectedIndex];
            UpdateSclsControlsFromFile();
        }
コード例 #14
0
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;

            _data = new DZSFormat(stage.DZRs[0].FileEntry.GetFileData(), ref srcOffset);

            List <IChunkType> plyrChunks = _data.GetChunksOfType(DZSChunkTypes.PLYR);

            if (plyrChunks == null)
            {
                return;
            }

            for (int i = 0; i < plyrChunks.Count; i++)
            {
                PlyrChunk plyrChunk = (PlyrChunk)plyrChunks[i];
                spawnDropdown.Items.Add("[" + i + "] - " + plyrChunk.Name);
            }

            spawnDropdown.SelectedIndex = 0;
            _plyrChunk = (PlyrChunk)plyrChunks[spawnDropdown.SelectedIndex];
            UpdateUIControlsFromFile();
        }
コード例 #15
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;
            }
コード例 #16
0
        public LGTV(RARC.FileEntry FE, ref int SrcOffset, TreeNode ParentNode, System.Drawing.Color Color = default(System.Drawing.Color), ZeldaArc ParentZA = null)
        {
            ParentFile = FE;

            byte[] SrcData = ParentFile.GetFileData();

            Offset = SrcOffset;

            _Unknown1 = new Vector3(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x04)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x08)));
            _Unknown2 = new Vector3(
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x0C)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x10)),
                Helpers.ConvertIEEE754Float(Helpers.Read32(SrcData, SrcOffset + 0x14)));
            _Unknown3 = Helpers.Read32(SrcData, SrcOffset + 0x18);

            SrcOffset += 0x1C;

            RenderColor = Color;

            Node = Helpers.CreateTreeNode(string.Format("{0:X6}", Offset), this, string.Format("{0}\n{1}\n0x{2:X8}", _Unknown1, _Unknown2, _Unknown3));
            ParentNode.BackColor = RenderColor;
            ParentNode.Nodes.Add(Node);
        }
コード例 #17
0
            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;
            }
コード例 #18
0
        private void LoadDZSForStage(ZeldaArc stage)
        {
            int srcOffset = 0;
            _data = new DZSFormat(stage.DZSs[0].FileEntry.GetFileData(), ref srcOffset);

            //Now that the DZSFormat is populated with information, we're going to load the UI up!

            //EnvR
            foreach (DZSChunkHeader chunk in _data.ChunkHeaders)
            {
                switch (chunk.Tag)
                {
                    case "EnvR":
                        //Populate the Dropdown
                        for (int i = 0; i < chunk.ElementCount; i++)
                            EnvRDropdown.Items.Add("EnvR [" + i + "]");
                        EnvRDropdown.SelectedIndex = 0;
                        break;
                    case "Colo":
                        //Populate the Dropdown
                        for (int i = 0; i < chunk.ElementCount; i++)
                            ColorDropdown.Items.Add("Colo [" + i + "]");
                        ColorDropdown.SelectedIndex = 0;
                        break;
                    case "Pale":
                        //Populate the Dropdown
                        for (int i = 0; i < chunk.ElementCount; i++)
                            PaleDropdown.Items.Add("Pale [" + i + "]");
                        PaleDropdown.SelectedIndex = 0;
                        break;
                    case "Virt":
                        //Populate the Dropdown
                        for (int i = 0; i < chunk.ElementCount; i++)
                            VirtDropdown.Items.Add("Virt [" + i + "]");
                        VirtDropdown.SelectedIndex = 0;
                        break;
                    default:
                        break;
                }
            }
        }