diff options
| author | jacob1 <jfu614@gmail.com> | 2012-10-04 16:35:11 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-10-05 15:33:12 (GMT) |
| commit | d2af4470a56265155f63cd9fe54ed3e33825fac7 (patch) | |
| tree | 4ec964e899da8bca92a3e583c426cf5f24b8de96 /src/game/GameView.cpp | |
| parent | 433a80b0990380d8ae4bc8a4c264336c1f12bae5 (diff) | |
| download | powder-d2af4470a56265155f63cd9fe54ed3e33825fac7.zip powder-d2af4470a56265155f63cd9fe54ed3e33825fac7.tar.gz | |
show # of parts, [GRID X], PIPE/PPIP with X, and molten X (with debug on) in HUD
Diffstat (limited to 'src/game/GameView.cpp')
| -rw-r--r-- | src/game/GameView.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index bb76c97..7ba1fe7 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -1882,11 +1882,22 @@ void GameView::OnDraw() { if(showDebug) { - sampleInfo << c->ElementResolve(sample.particle.type); - if(sample.particle.ctype > 0 && sample.particle.ctype < PT_NUM) - sampleInfo << " (" << c->ElementResolve(sample.particle.ctype) << ")"; + int ctype = sample.particle.ctype; + if (sample.particle.type == PT_PIPE || sample.particle.type == PT_PPIP) + ctype = sample.particle.tmp; + + if (sample.particle.type == PT_LAVA && ctype > 0 && ctype < PT_NUM) + sampleInfo << "Molten " << c->ElementResolve(ctype); + else if((sample.particle.type == PT_PIPE || sample.particle.type == PT_PPIP) && ctype > 0 && ctype < PT_NUM) + sampleInfo << c->ElementResolve(sample.particle.type) << " with " << c->ElementResolve(ctype); else - sampleInfo << " ()"; + { + sampleInfo << c->ElementResolve(sample.particle.type); + if(ctype > 0 && ctype < PT_NUM) + sampleInfo << " (" << c->ElementResolve(ctype) << ")"; + else + sampleInfo << " ()"; + } sampleInfo << ", Temp: " << std::fixed << sample.particle.temp -273.15f; sampleInfo << ", Life: " << sample.particle.life; sampleInfo << ", Tmp: " << sample.particle.tmp; @@ -1894,8 +1905,10 @@ void GameView::OnDraw() } else { - if(sample.particle.type == PT_LAVA && sample.particle.ctype > 0 && sample.particle.ctype < PT_NUM) + if (sample.particle.type == PT_LAVA && sample.particle.ctype > 0 && sample.particle.ctype < PT_NUM) sampleInfo << "Molten " << c->ElementResolve(sample.particle.ctype); + else if((sample.particle.type == PT_PIPE || sample.particle.type == PT_PPIP) && sample.particle.tmp > 0 && sample.particle.tmp < PT_NUM) + sampleInfo << c->ElementResolve(sample.particle.type) << " with " << c->ElementResolve(sample.particle.tmp); else sampleInfo << c->ElementResolve(sample.particle.type); sampleInfo << ", Temp: " << std::fixed << sample.particle.temp -273.15f; @@ -1984,6 +1997,11 @@ void GameView::OnDraw() #endif fpsInfo << "FPS: " << std::fixed << ui::Engine::Ref().GetFps(); + if (showDebug) + fpsInfo << " Parts: " << sample.NumParts; + if (ren->GetGridSize()) + fpsInfo << " [GRID: " << ren->GetGridSize() << "]"; + textWidth = Graphics::textwidth((char*)fpsInfo.str().c_str()); g->fillrect(12, 12, textWidth+8, 15, 0, 0, 0, 255*0.5); g->drawtext(16, 16, (const char*)fpsInfo.str().c_str(), 32, 216, 255, 255*0.75); |
