Split DrawGlobalPlayerIcons
This commit is contained in:
parent
0c5b1a3999
commit
6445fb059d
@ -670,8 +670,8 @@ void RaceGUIBase::drawGlobalReadySetGo()
|
||||
} // drawGlobalReadySetGo
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Draw players icons and their times (if defined in the current mode).
|
||||
* Also takes care of icon looking different due to plumber, squashing, ...
|
||||
/** Draw players icons and, depending on the current mode, their time
|
||||
* or their score (battle lives, egg collected, etc.).
|
||||
*/
|
||||
void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
{
|
||||
@ -717,7 +717,6 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
int ICON_WIDTH = ICON_PLAYER_WIDTH * 5 / 6;
|
||||
|
||||
WorldWithRank* world = dynamic_cast<WorldWithRank*>(World::getWorld());
|
||||
CaptureTheFlag* ctf = dynamic_cast<CaptureTheFlag*>(World::getWorld());
|
||||
|
||||
//initialize m_previous_icons_position
|
||||
if(m_previous_icons_position.size()==0)
|
||||
@ -865,12 +864,25 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
true /* ignore RTL */);
|
||||
}
|
||||
|
||||
// draw icon
|
||||
video::ITexture *icon =
|
||||
kart->getKartProperties()->getIconMaterial()->getTexture();
|
||||
int w = kart->getController()
|
||||
->isLocalPlayerController() ? ICON_PLAYER_WIDTH
|
||||
: ICON_WIDTH;
|
||||
drawPlayerIcon(kart, x, y, w);
|
||||
} //next position
|
||||
#endif
|
||||
} // drawGlobalPlayerIcons
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
/** Draw one player icon
|
||||
* Takes care of icon looking different due to plumber, squashing, ...
|
||||
*/
|
||||
void RaceGUIBase::drawPlayerIcon(AbstractKart *kart, int x, int y, int w)
|
||||
{
|
||||
video::ITexture *icon =
|
||||
kart->getKartProperties()->getIconMaterial()->getTexture();
|
||||
|
||||
CaptureTheFlag* ctf = dynamic_cast<CaptureTheFlag*>(World::getWorld());
|
||||
unsigned int kart_id = kart->getWorldKartId();
|
||||
|
||||
// CTF
|
||||
if (ctf)
|
||||
@ -987,7 +999,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
}
|
||||
|
||||
//Plunger
|
||||
if (kart->getGraphicalViewBlockedByPlunger() > 0.0f)
|
||||
if (kart->getBlockedByPlungerTicks()>0)
|
||||
{
|
||||
video::ITexture *icon_plunger =
|
||||
powerup_manager->getIcon(PowerupManager::POWERUP_PLUNGER)->getTexture();
|
||||
@ -1017,10 +1029,7 @@ void RaceGUIBase::drawGlobalPlayerIcons(int bottom_margin)
|
||||
NULL, true);
|
||||
}
|
||||
}
|
||||
|
||||
} //next position
|
||||
#endif
|
||||
} // drawGlobalPlayerIcons
|
||||
} // drawPlayerIcon
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@ -1031,7 +1040,7 @@ void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt)
|
||||
{
|
||||
#ifndef SERVER_ONLY
|
||||
const AbstractKart *kart = camera->getKart();
|
||||
if (kart->getGraphicalViewBlockedByPlunger() <= 0.0f)
|
||||
if (kart->getBlockedByPlungerTicks()<=0)
|
||||
{
|
||||
m_plunger_state = PLUNGER_STATE_INIT;
|
||||
return;
|
||||
@ -1056,7 +1065,7 @@ void RaceGUIBase::drawPlungerInFace(const Camera *camera, float dt)
|
||||
if(m_plunger_move_time < dt && m_plunger_state!=PLUNGER_STATE_FAST)
|
||||
{
|
||||
const float fast_time = 0.3f;
|
||||
if (kart->getGraphicalViewBlockedByPlunger() < fast_time)
|
||||
if(kart->getBlockedByPlungerTicks()<stk_config->time2Ticks(fast_time))
|
||||
{
|
||||
// First time we reach faste state: select random target point
|
||||
// at top of screen and set speed accordingly
|
||||
@ -1129,3 +1138,4 @@ void RaceGUIBase::removeReferee()
|
||||
m_referee->removeFromSceneGraph();
|
||||
}
|
||||
} // removeReferee
|
||||
|
||||
|
@ -246,6 +246,7 @@ public:
|
||||
virtual void clearAllMessages() { m_messages.clear(); }
|
||||
|
||||
void drawGlobalPlayerIcons(int bottom_margin);
|
||||
void drawPlayerIcon(AbstractKart *kart, int x, int y, int w);
|
||||
|
||||
virtual void drawEnergyMeter(int x, int y, const AbstractKart *kart,
|
||||
const core::recti &viewport,
|
||||
|
Loading…
x
Reference in New Issue
Block a user