Exemplo n.º 1
0
        public MeleeTextureSelector(MeleeDataObjectNode mdon, TextureNode Texture)
        {
            InitializeComponent();

            this.SelectedTexture     = Texture;
            this.meleeDataObjectNode = mdon;
            DialogResult             = DialogResult.None;

            DatDOBJ[] DOBJS = mdon.GetRoot().Root.GetDataObjects();

            ImageList imageList1 = new ImageList();

            imageList1.ColorDepth    = ColorDepth.Depth24Bit;
            listView1.Scrollable     = true;
            listView1.View           = View.LargeIcon;
            imageList1.ImageSize     = new Size(115, 115);
            listView1.LargeImageList = imageList1;

            // Grab all unique textures
            List <byte[]>     Used     = new List <byte[]>();
            List <DatTexture> Textures = new List <DatTexture>();

            for (int i = 0; i < DOBJS.Length; i++)
            {
                foreach (DatTexture t in DOBJS[i].Material.Textures)
                {
                    if (t.ImageData == null || Used.Contains(t.ImageData.Data))
                    {
                        continue;
                    }
                    else
                    {
                        Used.Add(t.ImageData.Data);

                        ListViewItem lstItem = new ListViewItem();
                        lstItem.ImageIndex = Textures.Count;
                        lstItem.Text       = "Texture_" + lstItem.ImageIndex + "_" + (t.ImageData != null ? t.ImageData.Format.ToString() + "\n" + t.ImageData.Width + "x" + t.ImageData.Height : "");
                        lstItem.Tag        = t;
                        listView1.Items.Add(lstItem);
                        imageList1.Images.Add(t.GetStaticBitmap());
                        Textures.Add(t);
                    }
                }
            }

            // Setup Combo Boxes

            foreach (var enu in Enum.GetValues(typeof(TPL_TextureFormat)))
            {
                CBFormat.Items.Add(enu);
            }
            foreach (var enu in Enum.GetValues(typeof(TPL_PaletteFormat)))
            {
                CBPalette.Items.Add(enu);
            }
            CBFormat.SelectedItem  = TPL_TextureFormat.CMP;
            CBPalette.SelectedItem = TPL_PaletteFormat.RGB565;
        }
Exemplo n.º 2
0
        public DOBJImportSettings(MeleeDataObjectNode DOBJ)
        {
            InitializeComponent();
            this.DOBJ = DOBJ;

            foreach (GXAttribGroup group in DOBJ.GetRoot().Root.Attributes)
            {
                listBox1.Items.Add(group.Attributes.Count + "_Group");
            }

            int i = 0;

            foreach (DatJOBJ b in DOBJ.GetRoot().Root.GetJOBJinOrder())
            {
                CBBone.Items.Add(new BoneNode(b)
                {
                    Text = "Bone_" + i++
                });
            }
            CBBone.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        public DOBJEditor(DatDOBJ DOBJ, MeleeDataObjectNode meleeDataObjectNode)
        {
            InitializeComponent();
            this.DOBJ = DOBJ;
            this.meleeDataObjectNode = meleeDataObjectNode;

            CBWrapS.Items.Add(GXWrapMode.CLAMP);
            CBWrapS.Items.Add(GXWrapMode.MIRROR);
            CBWrapS.Items.Add(GXWrapMode.REPEAT);
            CBWrapT.Items.Add(GXWrapMode.CLAMP);
            CBWrapT.Items.Add(GXWrapMode.MIRROR);
            CBWrapT.Items.Add(GXWrapMode.REPEAT);

            foreach (var suit in Enum.GetValues(typeof(GXAlphaOp)))
            {
                alphaOpComboBox.Items.Add(suit);
            }
            foreach (var suit in Enum.GetValues(typeof(GXCompareType)))
            {
                alphaComp1ComboBox.Items.Add(suit); alphaComp2ComboBox.Items.Add(suit); depthFuncComboBox.Items.Add(suit);
            }
            foreach (var suit in Enum.GetValues(typeof(GXBlendFactor)))
            {
                srcFactorComboBox.Items.Add(suit);
                dstFactorComboBox.Items.Add(suit);
            }
            foreach (var suit in Enum.GetValues(typeof(GXLogicOp)))
            {
                blendOpComboBox.Items.Add(suit);
            }
            foreach (var suit in Enum.GetValues(typeof(GXBlendMode)))
            {
                blendModeComboBox.Items.Add(suit);
            }

            foreach (var cbv in Enum.GetValues(typeof(GXTexMapID)))
            {
                CBTexID.Items.Add(cbv);
            }
            foreach (var cbv in Enum.GetValues(typeof(GXTexGenSrc)))
            {
                CBTexGenSrc.Items.Add(cbv);
            }
            foreach (var cbv in Enum.GetValues(typeof(GXTexFilter)))
            {
                CBTexMag.Items.Add(cbv);
                CBMinFilter.Items.Add(cbv);
            }
            foreach (var cbv in Enum.GetValues(typeof(GXAnisotropy)))
            {
                CBAnisotrophy.Items.Add(cbv);
            }

            Reload();

            if (DOBJ.Material.Textures.Length > 0)
            {
                textureListBox.SelectedIndex = 0;
            }

            pixelProcessingTableLayout.Visible = pixelProcessingCB.Checked;
        }