Fix material 2D not always being enabled when it should

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8485 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
auria 2011-04-30 17:42:44 +00:00
parent b1c7d6954c
commit bea4efecfc
2 changed files with 4 additions and 4 deletions

View File

@ -1162,6 +1162,8 @@ void IrrDriver::update(float dt)
if (inRace)
{
irr_driver->getVideoDriver()->enableMaterial2D();
RaceGUIBase *rg = world->getRaceGUI();
for(unsigned int i=0; i<world->getNumKarts(); i++)
{
@ -1178,11 +1180,13 @@ void IrrDriver::update(float dt)
World::getWorld()->getPhysics()->draw();
} // if kart->Camera
} // for i<world->getNumKarts()
// To draw the race gui we set the viewport back to the full
// screen.
m_video_driver->setViewPort(core::recti(0, 0,
UserConfigParams::m_width,
UserConfigParams::m_height));
for(unsigned int i=0; i<world->getNumKarts(); i++)
{
Kart *kart = world->getKart(i);

View File

@ -181,7 +181,6 @@ void RaceGUI::renderGlobal(float dt)
KartIconDisplayInfo* info = world->getKartsDisplayInfo();
irr_driver->getVideoDriver()->enableMaterial2D(); // seems like we need to remind irrlicht from time to time to use the Material2D
drawGlobalPlayerIcons(info);
} // renderGlobal
@ -235,11 +234,8 @@ void RaceGUI::renderPlayerView(const Kart *kart)
RaceGUI::KartIconDisplayInfo* info = World::getWorld()->getKartsDisplayInfo();
irr_driver->getVideoDriver()->enableMaterial2D(); // not sure why I need to call it again but with this, it works
drawPowerupIcons (kart, viewport, scaling);
irr_driver->getVideoDriver()->enableMaterial2D();
drawSpeedAndEnergy (kart, viewport, scaling);
irr_driver->getVideoDriver()->enableMaterial2D();
drawRankLap (info, kart, viewport);
RaceGUIBase::renderPlayerView(kart);