Skip to content

Commit

Permalink
When finding particles, show how many were found in HUD
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Mar 8, 2018
1 parent 5a61e6a commit b07e8d9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/graphics/Renderer.cpp
Expand Up @@ -1232,6 +1232,7 @@ void Renderer::render_parts()
}
}
#endif
foundElements = 0;
for(i = 0; i<=sim->parts_lastActiveIndex; i++) {
if (sim->parts[i].type && sim->parts[i].type >= 0 && sim->parts[i].type < PT_NUM) {
t = sim->parts[i].type;
Expand Down Expand Up @@ -1424,6 +1425,7 @@ void Renderer::render_parts()
{
colr = firer = 255;
colg = fireg = colb = fireb = 0;
foundElements++;
}
else
{
Expand Down Expand Up @@ -2557,6 +2559,7 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
debugLines(false),
sampleColor(0xFFFFFFFF),
findingElement(0),
foundElements(0),
mousePos(0, 0),
zoomWindowPosition(0, 0),
zoomScopePosition(0, 0),
Expand Down
1 change: 1 addition & 0 deletions src/graphics/Renderer.h
Expand Up @@ -64,6 +64,7 @@ class Renderer
bool debugLines;
pixel sampleColor;
int findingElement;
int foundElements;

//Mouse position for debug information
ui::Point mousePos;
Expand Down
7 changes: 6 additions & 1 deletion src/gui/game/GameView.cpp
Expand Up @@ -2448,7 +2448,12 @@ void GameView::OnDraw()
#endif

if (showDebug)
fpsInfo << " Parts: " << sample.NumParts;
{
if (ren->findingElement)
fpsInfo << " Parts: " << ren->foundElements << "/" << sample.NumParts;
else
fpsInfo << " Parts: " << sample.NumParts;
}
if (c->GetReplaceModeFlags()&REPLACE_MODE)
fpsInfo << " [REPLACE MODE]";
if (c->GetReplaceModeFlags()&SPECIFIC_DELETE)
Expand Down

0 comments on commit b07e8d9

Please sign in to comment.