INNER CODE UNIT · C++
width
vectozavr/3dzavr · engine/Engine.cpp:261
int width = timerWidth * (totalTime - timeSum) / totalTime;
screen->drawStrokeRectangle(xPos, yPos + (1.5*height)*i, width, height,
Color(width * 255 / timerWidth, 255 - width * 255 / timerWidth, 0, 255));
screen->drawText("all other stuff (" + std::to_string((int) (100 * (totalTime - timeSum) / totalTime)) + "%)",
xPos+5, yPos + (1.5*height)*i, Color(0, 0, 0, 150), 12);
_histResources["d other"].emplace_back(Time::time(), totalTime - timeSum);
screen->drawPlot(_histResources["d other"], xPos + timerWidth, yPos + (1.5*height)*i, 50, height);
// Draw a plot of fps
_histResources["fpsCounter"].emplace_back(Time::time(), Time::fps());
screen->drawPlot(_histResources["fpsCounter"], 60, 3*h + offset, plotWidth, 14);
for(auto& [histName, data] : _histResources) {
if(data.size() > 1000) {
data.erase(data.begin());