コード例 #1
0
        public void ExitZone(String zoneName)
        {
            if (!GameSettings.Default.DrawDebugData || FirstFrameAfterShown)
            {
                return;
            }

            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                return; // Just give up if the zone doesn't exist.
            }
            TrackerZone cur = zone.Peek();

            if (z != zone.Peek())
            {
                throw new Exception("TrackerZone " + z.Name + " trying to exit but we are actually in " + cur.Name);
            }
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.ExitZone();
                }
            }
            zone.Pop();
        }
コード例 #2
0
 public ZoneData(TrackerZone zone, int historySize)
 {
     threadName = GamePerformance.threadName;
     if (threadName == null)
     {
         Debugger.Break();
     }
     name       = zone.Name;
     history    = new Queue <long>(historySize);
     maxHistory = historySize;
 }
コード例 #3
0
        public void EnterZone(String zoneName)
        {
            int         id = ThreadID;
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                z = new TrackerZone(zoneName);
                zoneList.TryAdd(zoneName, z);
            }
            zone.Push(z);
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.EnterZone();
                }
            }
        }
コード例 #4
0
            private ZoneData GetData(bool autoCreate = true)
            {
                ZoneData    data;
                TrackerZone z = zone.Peek();

                if (!zoneData.TryGetValue(z.ID, out data))
                {
                    if (!autoCreate)
                    {
                        return(null);
                    }
                    data = new ZoneData(z, maxHistory);
                    lock (zoneDataLockObject)
                    {
                        zoneData.Add(z.ID, data);
                    }
                    zonesUsed++;
                }
                return(data);
            }
コード例 #5
0
        public void ExitZone(String zoneName)
        {
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                throw new Exception("Unknown TrackerZone found.");
            }
            TrackerZone cur = zone.Peek();

            if (z != zone.Peek())
            {
                throw new Exception("TrackerZone " + z.Name + " trying to exit but we are actually in " + cur.Name);
            }
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.ExitZone();
                }
            }
            zone.Pop();
        }
コード例 #6
0
        public void EnterZone(String zoneName)
        {
            if (!GameSettings.Default.DrawDebugData || FirstFrameAfterShown)
            {
                return;
            }

            int         id = ThreadID;
            TrackerZone z;

            if (!zoneList.TryGetValue(zoneName, out z))
            {
                z = new TrackerZone(zoneName);
                zoneList.TryAdd(zoneName, z);
            }
            zone.Push(z);
            lock (internalTrackerLockObject)
            {
                foreach (KeyValuePair <string, Tracker> kvp in internalTrackers)
                {
                    kvp.Value.EnterZone();
                }
            }
        }