Game Development Reference
In-Depth Information
// For the Top Ranked entries copy these to the HighScore Table BillBoard
for (int i = 0; i < MAX_RANK; i++)
{
if (m_HighScoreTable[i].IsValid())
{
CopyHighScoreEntryToHighScoreTable(i+1, Cam, m_HighScoreTable[i]);
}
}
// Save High Scores
SaveHighScoreTable(HIGH_SCORES);
m_Dirty = false;
}
// Update BillBoard orientation for Score
m_HighScoreTableImage.UpdateObject3d(Cam);
}
The function does the following:
1.
If m_Dirty is true, it adds a new high score entry and processes and renders it
to the high score table billboard.
2.
If m_Dirty is true, it
a. Sorts the high score table in descending order, with the highest score listed first, by
calling the SortHighScoreTable() function
b. Clears the high score table by calling the ClearHighScoreTable() function
c.
Renders the high score table's heading by calling the RenderTitle() function
d. Renders the top 10 high scores to the high score table by calling the
CopyHighScoreEntryToHighScoreTable() function
e.
Saves the high score table by calling the SaveHighScoreTable() function
f.
Sets m_Dirty to false to indicate that the high score table has been updated
3.
Updates the high score table billboard by calling the UpdateObject3d()
function to turn the billboard toward the camera
The RenderHighScoreTable() function draws the high score table billboard and the texture containing
the player's high scores to the screen. (See Listing 9-23.)
Listing 9-23. Rendering the High Score Table
void RenderHighScoreTable(Camera Cam, PointLight Light, boolean DebugOn)
{
// Render Final High Score Table Composite Image
m_HighScoreTableImage.DrawObject(Cam, Light);
}
 
Search WWH ::




Custom Search