Applied Khonkhortisan's patch to squash the icons

in the race gui if the kart is squashed. Thanks!


git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@9625 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk
2011-08-25 23:49:29 +00:00
parent a51597cdaf
commit 5f3f25a5e5

View File

@@ -484,7 +484,8 @@ void RaceGUI::drawGlobalPlayerIcons(const KartIconDisplayInfo* info)
}
// Fixes crash bug, why are certain icons not showing up?
if ((icon != NULL) && (!kart->playingEmergencyAnimation()))
if ((icon != NULL) && (!kart->playingEmergencyAnimation()) &&
(!kart->isSquashed()) )
{
const core::rect<s32> rect(core::position2d<s32>(0,0),
icon->getOriginalSize());
@@ -506,6 +507,18 @@ void RaceGUI::drawGlobalPlayerIcons(const KartIconDisplayInfo* info)
NULL, NULL, true);
}
if ((icon != NULL) && (kart->isSquashed()))
{
//syncs icon squash with kart squash
const core::rect<s32> destRect(core::position2d<s32>(x,y+w/4),
core::position2d<s32>(x+w,y+w*3/4));
const core::rect<s32> sourceRect(core::position2d<s32>(0,0),
icon->getOriginalSize());
irr_driver->getVideoDriver()->draw2DImage(icon, destRect,
sourceRect, NULL, NULL,
true);
}
if ((icon != NULL) && (kart->playingExplosionAnimation()))
{
//exploses into 4 parts