Zeex / samp-plugin-profiler

Performance profiler plugin for SA-MP server
http://forum.sa-mp.com/showthread.php?t=271129
BSD 2-Clause "Simplified" License
46 stars 8 forks source link

Bad public color on *.gv #3

Closed grekon closed 11 years ago

grekon commented 12 years ago

Sometimes we have lines like this: "OnFilterScriptInit" [color="nan, nan, 1", shape=octagon]; Something wrong here: auto time = node->info()->GetSelfTime(); auto ratio = static_cast(time) / static_cast(max_time); // We encode color in HSB. auto hsb = std::make_tuple( (1.0 - ratio) * 0.6, // hue (ratio * 0.9) + 0.1, // saturation 1.0 // brightness );

temporary correct to: auto ratio = 0; if (max_time != 0) ratio = static_cast(time) / static_cast(max_time);

because can't understand syntax of graph.Traverse( [ &max_time, this, &graph ](const std::shared_ptr &node) {

Is it a unusual function call or function declaration? I see such thing at a the first time.

P.S. I have set gv font size from 10.8 to 20 for me, as at my huge gamemode the letters was undereadble.

Zeex commented 11 years ago

This seems outdated.