Added boolean flag to indicate if the referee is a start (true)

or rescue (false) referee - no actual implementation change yet.


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9851 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2011-09-16 01:44:33 +00:00
parent 6b19b7c49e
commit 9f4bce73a3
3 changed files with 15 additions and 10 deletions

View File

@ -136,8 +136,10 @@ void Referee::cleanup()
// ----------------------------------------------------------------------------
/** Creates an instance of the referee, using the static values to initialise
* it.
* \param is_start_referee True when this is the start referee, i.e. it must
* have the traffic light attached.
*/
Referee::Referee()
Referee::Referee(bool is_start_referee)
{
assert(m_st_referee_mesh);
// First add a NULL mesh, then set the material to be read only
@ -146,13 +148,16 @@ Referee::Referee()
// mesh. ATM it doesn't make any difference, but if we ever should
// decide to use more than one referee model at startup we only
// have to change the textures once, and all models will be in synch.
m_scene_node = irr_driver->addAnimatedMesh(NULL);
m_scene_node->setReadOnlyMaterials(true);
m_scene_node->setMesh(m_st_referee_mesh);
m_scene_node->grab();
m_scene_node->setRotation(m_st_start_rotation.toIrrVector());
m_scene_node->setScale(m_st_scale.toIrrVector());
m_scene_node->setFrameLoop(m_st_first_start_frame, m_st_last_start_frame);
if(is_start_referee)
{
m_scene_node = irr_driver->addAnimatedMesh(NULL);
m_scene_node->setReadOnlyMaterials(true);
m_scene_node->setMesh(m_st_referee_mesh);
m_scene_node->grab();
m_scene_node->setRotation(m_st_start_rotation.toIrrVector());
m_scene_node->setScale(m_st_scale.toIrrVector());
m_scene_node->setFrameLoop(m_st_first_start_frame, m_st_last_start_frame);
}
} // Referee
// ----------------------------------------------------------------------------

View File

@ -78,7 +78,7 @@ private:
scene::IAnimatedMeshSceneNode *m_scene_node;
public:
Referee();
Referee(bool is_start_referee);
~Referee();
void selectReadySetGo(int rsg);
void attachToSceneNode();

View File

@ -107,7 +107,7 @@ void RaceGUIBase::init()
m_referee_rotation.push_back(hpr);
}
m_referee = new Referee();
m_referee = new Referee(/*is_start_referee*/true);
// Do everything else required at a race restart as well, esp.
// resetting the height of the referee.