INNER CODE UNIT · C++
width
vectozavr/3dzavr · engine/Engine.cpp:239
int width = timerWidth * timer.elapsedSeconds() / totalTime;
if (timerName == "d all" || timerName[0] != 'd') {
continue;
}
_histResources[timerName].emplace_back(Time::time(), timer.elapsedSeconds());
screen->drawStrokeRectangle(xPos, yPos + (1.5*height)*i, width, height,
Color(width * 255 / timerWidth, 255 - width * 255 / timerWidth, 0, 255));
screen->drawText(
timerName.substr(2, timerName.size()) + " (" +
std::to_string((int) (100 * timer.elapsedSeconds() / totalTime)) + "%)",
xPos+5, yPos + (1.5*height)*i, Color::BLACK, 12);
screen->drawPlot(_histResources[timerName], xPos + timerWidth, yPos + (1.5*height)*i, plotWidth, height);