Add glow support for banana and bubblegum

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14648 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
samuncle 2013-12-06 23:19:43 +00:00
parent b0ce591330
commit 627004a536
3 changed files with 33 additions and 2 deletions

View File

@ -187,6 +187,12 @@ void STKConfig::init_defaults()
m_box_glow_color[0] = 1.0f;
m_box_glow_color[1] = 1.0f;
m_box_glow_color[2] = 1.0f;
m_banana_glow_color[0] = 1.0f;
m_banana_glow_color[1] = 1.0f;
m_banana_glow_color[2] = 1.0f;
m_bubblegum_glow_color[0] = 1.0f;
m_bubblegum_glow_color[1] = 1.0f;
m_bubblegum_glow_color[2] = 1.0f;
m_score_increase.clear();
m_leader_intervals.clear();
@ -386,6 +392,20 @@ void STKConfig::getAllData(const XMLNode * root)
m_box_glow_color[1] = tmpcol.getGreen() / 255.0f;
m_box_glow_color[2] = tmpcol.getBlue() / 255.0f;
}
if (colors->get("banana", &tmpcol))
{
m_banana_glow_color[0] = tmpcol.getRed() / 255.0f;
m_banana_glow_color[1] = tmpcol.getGreen() / 255.0f;
m_banana_glow_color[2] = tmpcol.getBlue() / 255.0f;
}
if (colors->get("bubblegum", &tmpcol))
{
m_bubblegum_glow_color[0] = tmpcol.getRed() / 255.0f;
m_bubblegum_glow_color[1] = tmpcol.getGreen() / 255.0f;
m_bubblegum_glow_color[2] = tmpcol.getBlue() / 255.0f;
}
}
// Get the default KartProperties

View File

@ -150,8 +150,9 @@ public:
/** Colors for glows */
float m_nitro_glow_color[3];
float m_box_glow_color[3];
float m_banana_glow_color[3];
float m_bubblegum_glow_color[3];
private:
/** True if stk_config has been loaded. This is necessary if the

View File

@ -96,7 +96,7 @@ void IrrDriver::renderGLSL(float dt)
const Item::ItemType type = item->getType();
if (type != Item::ITEM_NITRO_BIG && type != Item::ITEM_NITRO_SMALL &&
type != Item::ITEM_BONUS_BOX)
type != Item::ITEM_BONUS_BOX && type != Item::ITEM_BANANA && type != Item::ITEM_BUBBLEGUM)
continue;
LODNode * const lod = (LODNode *) item->getSceneNode();
@ -129,6 +129,16 @@ void IrrDriver::renderGLSL(float dt)
dat.g = stk_config->m_box_glow_color[1];
dat.b = stk_config->m_box_glow_color[2];
break;
case Item::ITEM_BANANA:
dat.r = stk_config->m_banana_glow_color[0];
dat.g = stk_config->m_banana_glow_color[1];
dat.b = stk_config->m_banana_glow_color[2];
break;
case Item::ITEM_BUBBLEGUM:
dat.r = stk_config->m_bubblegum_glow_color[0];
dat.g = stk_config->m_bubblegum_glow_color[1];
dat.b = stk_config->m_bubblegum_glow_color[2];
break;
default:
Log::fatal("render", "Unknown item type got through");
break;