Exemplo n.º 1
0
        bool NetHandle_StressTestNames(eNetCmd cmd, UsCmd c)
        {
            var effects = new ObservableCollection<EffectObject>();
            int count = c.ReadInt32();
            for (int i = 0; i < count; i++)
            {
                var e = new EffectObject();
                e.Name = c.ReadString();
                effects.Add(e);
            }

            EffectGrid.Dispatcher.Invoke(new Action(() =>
            {
                EffectGrid.DataContext = effects;
            }));
            return true;
        }
Exemplo n.º 2
0
        bool NetHandle_StressTestResult(eNetCmd cmd, UsCmd c)
        {
            string name = c.ReadString();
            int avgMS = c.ReadInt32();
            int maxMS = c.ReadInt32();
            int drawcall = c.ReadInt32();
            int parCount = c.ReadInt32();

            EffectGrid.Dispatcher.Invoke(new Action(() =>
            {
                foreach (var item in EffectGrid.Items)
                {
                    EffectObject mo = item as EffectObject;
                    if (mo != null && mo.Name == name)
                    {
                        if (_highlighted != null)
                        {
                            DataGridUtil.ClearHighlighted(EffectGrid, _highlighted);
                        }

                        mo.MSAvg = avgMS;
                        mo.MSMax = maxMS;
                        mo.DrawCallCount = drawcall;
                        mo.TotalParticles = parCount;

                        DataGridUtil.MarkAsHighlighted(EffectGrid, item, Colors.Chartreuse);
                        _highlighted = mo;

                        break;
                    }
                }
            }));

            RunNextEffectStressTest();

            return true;
        }