コード例 #1
0
        public void FillForm()
        {
            NUD.Material mat = material[current];

            textBox1.Text       = mat.flags.ToString("X") + "";
            textBox3.Text       = mat.srcFactor + "";
            textBox4.Text       = mat.dstFactor + "";
            ref1CB.SelectedItem = ref1[mat.ref1];
            ref0CB.SelectedItem = ref0[mat.ref0];
            textBox6.Text       = mat.drawPriority + "";
            textBox7.Text       = mat.cullMode + "";
            textBox8.Text       = mat.zBufferOffset + "";

            checkBox1.Checked = mat.unkownWater != 0;

            listView1.Items.Clear();

            mat.flags = mat.RebuildFlags();

            shadowCB.Checked    = mat.hasShadow;
            GlowCB.Checked      = mat.glow;
            specLightCB.Checked = mat.useSpecular;
            rimLightCB.Checked  = mat.useRimLight;

            if (mat.highlight)
            {
                listView1.Items.Add("Specular");
            }
            if (mat.highlight)
            {
                listView1.Items.Add("ShineHighlight");
            }
            if (mat.diffuse)
            {
                listView1.Items.Add("Diffuse");
            }
            if (mat.stagemap)
            {
                listView1.Items.Add("StageMap");
            }
            if (mat.cubemap)
            {
                listView1.Items.Add("Cubemap");
            }
            if (mat.diffuse2)
            {
                listView1.Items.Add("Diffuse2");
            }
            if (mat.aomap)
            {
                listView1.Items.Add("AO Map");
            }
            if (mat.normalmap)
            {
                listView1.Items.Add("NormalMap");
            }
            if (mat.ramp)
            {
                listView1.Items.Add("Ramp");
            }

            if (mat.useRimLight)
            {
                listView1.Items.Add("Dummy Rim");
            }

            while (listView1.Items.Count > mat.textures.Count)
            {
                listView1.Items.RemoveAt(1);
            }

            listView2.Items.Clear();
            listView2.View = View.List;
            foreach (string s in mat.entries.Keys)
            {
                listView2.Items.Add(s);
            }
            if (listView2.Items.Count > 0)
            {
                listView2.SelectedIndices.Add(0);
            }
        }
コード例 #2
0
        public void FillForm()
        {
            NUD.Material mat = material[current];

            textBox1.Text = mat.flags.ToString("X") + "";
            textBox3.Text = mat.dstFactor + "";
            textBox4.Text = mat.srcFactor + "";
            //textBox5.Text = mat.alphaFunc + "";
            textBox6.Text = mat.drawPriority + "";
            textBox7.Text = mat.cullMode + "";
            textBox8.Text = mat.zBufferOffset + "";

            checkBox1.Checked = mat.unkownWater != 0;

            listView1.Items.Clear();

            mat.flags = mat.RebuildFlags();

            shadowCB.Checked    = mat.hasShadow;
            GlowCB.Checked      = mat.glow;
            specLightCB.Checked = mat.useSpecular;
            rimLightCB.Checked  = mat.useRimLight;

            if (mat.highlight)
            {
                listView1.Items.Add("Specular");
            }
            if (mat.highlight)
            {
                listView1.Items.Add("ShineHighlight");
            }
            if (mat.diffuse)
            {
                listView1.Items.Add("Diffuse");
            }
            if (mat.diffuse2)
            {
                listView1.Items.Add("Diffuse2");
            }
            if (mat.stagemap)
            {
                listView1.Items.Add("StageMap");
            }
            if (mat.cubemap)
            {
                listView1.Items.Add("Cubemap");
            }
            if (mat.aomap)
            {
                listView1.Items.Add("AO Map");
            }
            if (mat.normalmap)
            {
                listView1.Items.Add("NormalMap");
            }
            if (mat.ramp)
            {
                listView1.Items.Add("Ramp");
            }

            if (mat.useRimLight)
            {
                listView1.Items.Add("Dummy Rim");
            }

            /*listView1.View = View.List;
             *
             * int[] locs = new int[mat.textures.Count + 4];
             * int li = 0;
             * if ((mat.flags & (uint)NUD.TextureFlags.DiffuseMap) > 0)
             *  locs[li++] = 0;
             *
             * if ((mat.flags & (uint)NUD.TextureFlags.RIM) > 0)
             * {
             *  // as a stage map...
             *  if ((mat.flags & (uint)NUD.TextureFlags.AOMap) > 0)
             *      locs[li++] = 2;
             * }
             * else
             * {
             *  if ((mat.flags & (uint)NUD.TextureFlags.CubeMap) > 0)
             *      locs[li++] = 3;
             * }
             *
             * if ((mat.flags & (uint)NUD.TextureFlags.UnknownTex) > 0)
             *  locs[li++] = 5;
             *
             * if ((mat.flags & (uint)NUD.TextureFlags.NormalMap) > 0)
             *  locs[li++] = 1;
             * else if ((mat.flags & (uint)NUD.TextureFlags.RIM) > 0)
             * {
             *  locs[li++] = 0; // second diffuse
             * }
             *
             * if ((mat.flags & (uint)NUD.TextureFlags.RIM) > 0)
             * {
             *  // as a rim lighting
             *  if ((mat.flags & (uint)NUD.TextureFlags.CubeMap) > 0)
             *      locs[li++] = 3;
             * }
             * else
             * {
             *  if ((mat.flags & (uint)NUD.TextureFlags.AOMap) > 0)
             *      locs[li++] = 2;
             * }
             * if ((mat.flags & (uint)NUD.TextureFlags.Shadow) > 0)
             *  locs[li++] = 4;
             *
             * string[] texnames = new string[] { "Diffuse Map", "Normal Map",
             *  ((mat.flags & (uint)NUD.TextureFlags.RIM) > 0) ? "Stage Map" : "Cube Map",
             *  ((mat.flags & (uint)NUD.TextureFlags.RIM) > 0) ? "Rim Map" : "AO Map",
             *  "Dummy Rim",
             *  "Specular Map"};
             *
             * for (int i = 0; i < mat.textures.Count; i++)
             * {
             *  listView1.Items.Add(texnames[locs[i]]);
             * }
             * listView1.SelectedIndices.Add(0);*/

            listView2.Items.Clear();
            listView2.View = View.List;
            foreach (string s in mat.entries.Keys)
            {
                listView2.Items.Add(s);
            }
            if (listView2.Items.Count > 0)
            {
                listView2.SelectedIndices.Add(0);
            }
        }