pioneerspacesim/pioneer — pull request #1543 by johnbartholomew (2012-09-24 18:18:45+00:00)
Title: Create a separate DeathView to replace the dead player code in WorldView

To fix #1540.

Changes:

* `Gui::ToolTip` now maintains a pointer to its "owner", and checks that its owner is visible before drawing (for the weird use in FaceVideoLink and DeadVideoLink, you can give it a null owner and it'll behave as before). This is arguably a hack -- I just did it to fix a situation where a tooltip is visible when the player dies and then the tooltip stays visible during the death view and tombstone loop.
* `WorldView` no longer handles a dead player at all (it asserts that the player is still alive in Update, Draw, Draw3D, RefreshButtonStateAndVisibility)
* There is now `DeathView` / `Pi::deathView`, which does what WorldView did before when the player died. Luckily, since the 3D drawing has been shifted into the Camera system this is actually really simple.
* `MainLoop` now checks for player death immediately after the physics/game logic update, and switches to DeathView immediately (this avoids one frame where WorldView is asked to draw after the player has died).
* I scrapped WorldView::GetNumLights, since it only ever returns 1 anyway (this is sort of unrelated -- I was thinking I'd need it in DeathView as well but then when I searched for uses I found it's only used by the planet rendering code and the value is always 1).