24{
25 BWAPI::Broodwar->drawBoxScreen(x - 5, y - 5, x + 110 + moduleBarWidth, y + 5 + (10 * moduleTimers.size()), BWAPI::Colors::Black, true);
26
27 int yskip = 0;
28 const double total = moduleTimers[0].getElapsedTimeInMilliSec();
29 for (size_t i(0); i < moduleTimers.size(); ++i)
30 {
31 const double elapsed = moduleTimers[i].getElapsedTimeInMilliSec();
32 if (elapsed > 85)
33 {
34 BWAPI::Broodwar->printf("Timer Debug (frame %d): %s %lf", BWAPI::Broodwar->getFrameCount(), timerNames[i].c_str(), elapsed);
35 }
36
37 int width = (int)((elapsed == 0) ? 0 : (moduleBarWidth * (elapsed / total)));
38
39 BWAPI::Broodwar->drawTextScreen(x, y + yskip - 3, "\x04 %s", timerNames[i].c_str());
40 BWAPI::Broodwar->drawBoxScreen(x + 60, y + yskip, x + 60 + width + 1, y + yskip + 8, BWAPI::Colors::White);
41 BWAPI::Broodwar->drawTextScreen(x + 70 + moduleBarWidth, y + yskip - 3, "%.4lf", elapsed);
42 yskip += 10;
43 }
44}