fix weird profiler bug, hovering it would change the values. No idea why these changes work

This commit is contained in:
Marianne Gagnon 2014-09-03 21:13:07 -04:00
parent 0a6735a6ec
commit 449c6a07b4

View File

@ -353,26 +353,27 @@ void Profiler::draw()
} }
} }
// GPU profiler
QueryPerf hovered_gpu_marker = Q_LAST; QueryPerf hovered_gpu_marker = Q_LAST;
long hovered_gpu_marker_elapsed = 0; long hovered_gpu_marker_elapsed = 0;
int gpu_y = int(y_offset + nb_thread_infos*line_height + line_height/2);
float total = 0;
for (unsigned i = 0; i < Q_LAST; i++)
{
total += irr_driver->getGPUTimer(i).elapsedTimeus();
}
static video::SColor colors[] = {
video::SColor(255, 255, 0, 0),
video::SColor(255, 0, 255, 0),
video::SColor(255, 0, 0, 255),
video::SColor(255, 255, 255, 0),
video::SColor(255, 255, 0, 255),
video::SColor(255, 0, 255, 255)
};
if (hovered_markers.size() == 0) if (hovered_markers.size() == 0)
{ {
int gpu_y = int(y_offset + nb_thread_infos*line_height + line_height/2);
float total = 0;
for (unsigned i = 0; i < Q_LAST; i++)
{
total += irr_driver->getGPUTimer(i).elapsedTimeus();
}
static video::SColor colors[] = {
video::SColor(255, 255, 0, 0),
video::SColor(255, 0, 255, 0),
video::SColor(255, 0, 0, 255),
video::SColor(255, 255, 255, 0),
video::SColor(255, 255, 0, 255),
video::SColor(255, 0, 255, 255)
};
float curr_val = 0; float curr_val = 0;
for (unsigned i = 0; i < Q_LAST; i++) for (unsigned i = 0; i < Q_LAST; i++)
{ {
@ -422,7 +423,7 @@ void Profiler::draw()
// Draw the hovered markers' names // Draw the hovered markers' names
gui::ScalableFont* font = GUIEngine::getFont(); gui::ScalableFont* font = GUIEngine::getFont();
if(font) if (font)
{ {
core::stringw text; core::stringw text;
while(!hovered_markers.empty()) while(!hovered_markers.empty())