public void LoadTextures()
        {
            textureImageList.Images.Clear();
            textureListView.Items.Clear();
            textureListView.LargeImageList = textureImageList;
            textureListView.FullRowSelect  = true;

            int CurTex = 0;

            foreach (BinaryTextureContainer bntx in PluginRuntime.bntxContainers)
            {
                foreach (TextureData item in bntx.Textures.Values)
                {
                    ListViewItem it = new ListViewItem();
                    it.Text       = item.Text;
                    it.ImageIndex = CurTex++;

                    textureListView.Items.Add(it);

                    TextureData tex = bntx.Textures[item.Text];
                    tex.LoadOpenGLTexture();


                    TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;

                    Bitmap temp = tex.GLTextureToBitmap(renderedTex, renderedTex.display);

                    textureImageList.Images.Add(tex.Text, temp);

                    var dummy = textureImageList.Handle;
                    temp.Dispose();
                }
            }
        }
Пример #2
0
        public void InitializeTextureListView(FMAT material)
        {
            textureRefListView.Items.Clear();
            textureRefListView.SmallImageList = textureImageList;
            textureRefListView.FullRowSelect  = true;

            foreach (MatTexture tex in material.textures)
            {
                ListViewItem item = new ListViewItem();
                item.Text = tex.Name;
                item.SubItems.Add(tex.SamplerName);

                if (material.shaderassign.samplers.ContainsValue(tex.SamplerName))
                {
                    var FragSampler = material.shaderassign.samplers.FirstOrDefault(x => x.Value == tex.SamplerName).Key;
                    item.SubItems.Add(FragSampler.ToString());
                }

                textureRefListView.Items.Add(item);
            }

            textureImageList.Images.Clear();

            int CurTex = 0;

            if (PluginRuntime.bntxContainers.Count == 0 &&
                PluginRuntime.ftexContainers.Count == 0)
            {
                foreach (ListViewItem item in textureRefListView.Items)
                {
                    AddBlankTexture(item, item.Text, CurTex++);
                }
            }
            bool FoundTexture = false;

            foreach (ListViewItem item in textureRefListView.Items)
            {
                foreach (BinaryTextureContainer bntx in PluginRuntime.bntxContainers)
                {
                    if (bntx.Textures.ContainsKey(item.Text))
                    {
                        FoundTexture = true;

                        TextureData tex = bntx.Textures[item.Text];
                        TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
                        Bitmap temp = tex.GLTextureToBitmap(renderedTex, renderedTex.display);

                        textureImageList.Images.Add(tex.Text, temp);

                        item.ImageIndex = CurTex++;

                        var dummy = textureImageList.Handle;
                        temp.Dispose();
                    }
                }
                foreach (FTEXContainer ftexCont in PluginRuntime.ftexContainers)
                {
                    if (ftexCont.Textures.ContainsKey(item.Text))
                    {
                        FoundTexture = true;

                        FTEX tex = ftexCont.Textures[item.Text];
                        FTEX.RenderableTex renderedTex = tex.renderedTex;
                        Bitmap             temp        = tex.GLTextureToBitmap(renderedTex, renderedTex.display);

                        textureImageList.Images.Add(tex.Text, temp);

                        item.ImageIndex = CurTex++;

                        var dummy = textureImageList.Handle;
                        temp.Dispose();
                    }
                }
                if (FoundTexture == false)
                {
                    AddBlankTexture(item, item.Text, CurTex++);
                }
            }
        }
Пример #3
0
 public void LoadTexture(TextureData tex)
 {
     TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
     bntxEditor1.LoadPicture(tex.GLTextureToBitmap(renderedTex, renderedTex.display));
     bntxEditor1.LoadProperty(tex);
 }
 public void LoadTexture(TextureData tex)
 {
     TextureData.BRTI_Texture renderedTex = tex.renderedGLTex;
     bntxEditor1.LoadProperty(tex);
 }