public void AddHitPoint(PPMHitPoint hp) { if (this.hitPoints.Count <= MaxHitPoints) { this.hitPoints.Add(hp); #if VERBOSE if (hitPoints.Count % 1000 == 0) Tracer.TraceLine("HitPoints -Collected {0} / Needed {1}", hitPoints.Count, MaxHitPoints); #endif } else { if (Grid == null) { lock (build_lock) { Tracer.TraceLine("Start building photons hashgrid"); Grid = new HashGrid(hitPoints, Width, Height); Grid.ReHash(); Tracer.TraceLine("Complete!"); } } } }
internal void BuildGrid() { if (Grid == null) { lock (build_lock) { Tracer.TraceLine("Start building photons hashgrid"); Grid = new HashGrid(hitPoints, Width, Height); Tracer.TraceLine("Complete!"); } } }
public void ResetContext() { lock (build_lock) { hitPoints.Clear(); TotalPhotons += (ulong)photons; photons = 0; Grid = null; } }