When finding particles, show how many were found in HUD

This commit is contained in:
jacob1
2018-03-07 23:19:55 -05:00
parent 5a61e6a619
commit b07e8d93d5
3 changed files with 10 additions and 1 deletions

View File

@@ -1232,6 +1232,7 @@ void Renderer::render_parts()
} }
} }
#endif #endif
foundElements = 0;
for(i = 0; i<=sim->parts_lastActiveIndex; i++) { for(i = 0; i<=sim->parts_lastActiveIndex; i++) {
if (sim->parts[i].type && sim->parts[i].type >= 0 && sim->parts[i].type < PT_NUM) { if (sim->parts[i].type && sim->parts[i].type >= 0 && sim->parts[i].type < PT_NUM) {
t = sim->parts[i].type; t = sim->parts[i].type;
@@ -1424,6 +1425,7 @@ void Renderer::render_parts()
{ {
colr = firer = 255; colr = firer = 255;
colg = fireg = colb = fireb = 0; colg = fireg = colb = fireb = 0;
foundElements++;
} }
else else
{ {
@@ -2557,6 +2559,7 @@ Renderer::Renderer(Graphics * g, Simulation * sim):
debugLines(false), debugLines(false),
sampleColor(0xFFFFFFFF), sampleColor(0xFFFFFFFF),
findingElement(0), findingElement(0),
foundElements(0),
mousePos(0, 0), mousePos(0, 0),
zoomWindowPosition(0, 0), zoomWindowPosition(0, 0),
zoomScopePosition(0, 0), zoomScopePosition(0, 0),

View File

@@ -64,6 +64,7 @@ public:
bool debugLines; bool debugLines;
pixel sampleColor; pixel sampleColor;
int findingElement; int findingElement;
int foundElements;
//Mouse position for debug information //Mouse position for debug information
ui::Point mousePos; ui::Point mousePos;

View File

@@ -2448,7 +2448,12 @@ void GameView::OnDraw()
#endif #endif
if (showDebug) 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) if (c->GetReplaceModeFlags()&REPLACE_MODE)
fpsInfo << " [REPLACE MODE]"; fpsInfo << " [REPLACE MODE]";
if (c->GetReplaceModeFlags()&SPECIFIC_DELETE) if (c->GetReplaceModeFlags()&SPECIFIC_DELETE)