コード例 #1
0
ファイル: Realtime.Highlight.cs プロジェクト: mc-gulu/utrace
 private List<MaterialObject> HighlightMaterialByTexture(TextureObject texture, Color c)
 {
     List<MaterialObject> highlighted = new List<MaterialObject>();
     foreach (var item in MaterialGrid.Items)
     {
         MaterialObject mo = item as MaterialObject;
         if (mo != null && texture.RefList.Contains(mo.InstID))
         {
             DataGridUtil.MarkAsHighlighted(MaterialGrid, item, c);
             highlighted.Add(mo);
         }
     }
     return highlighted;
 }
コード例 #2
0
ファイル: Realtime.Net.cs プロジェクト: mc-gulu/utrace
        public bool NetHandle_FrameData_Texture(eNetCmd cmd, UsCmd c)
        {
            UsLogging.Printf("eNetCmd.Handle_FrameData_Texture received ({0}).", c.Buffer.Length);

            var textures = new ObservableCollection<TextureObject>();
            int count = c.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                var m = new TextureObject();
                m.InstID = c.ReadInt32();
                m.Name = c.ReadString();
                m.PixelSize = c.ReadString();
                m.MemSize = c.ReadString();
                m.RefCnt = c.ReadInt32();
                m.RefList = new List<int>();
                for (int k = 0; k < m.RefCnt; k++)
                {
                    int owner = c.ReadInt32();
                    m.RefList.Add(owner);
                }

                textures.Add(m);
            }

            TextureGrid.Dispatcher.Invoke(new Action(() =>
            {
                title_texture.Text = string.Format("Textures ({0})", textures.Count);
                TextureGrid.DataContext = textures;
            }));
            return true;
        }