Cosmetic changes.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@11381 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hikerstk 2012-07-11 06:42:47 +00:00
parent f26a34647e
commit e0c8652d89

View File

@ -174,12 +174,14 @@ Item* ItemManager::newItem(Item::ItemType type, const Vec3& xyz,
if(index==-1) index = m_all_items.size(); if(index==-1) index = m_all_items.size();
Item* item; Item* item;
item = new Item(type, xyz, normal, m_item_mesh[type], m_item_lowres_mesh[type], index); item = new Item(type, xyz, normal, m_item_mesh[type],
m_item_lowres_mesh[type], index);
if(parent != NULL) item->setParent(parent); if(parent != NULL) item->setParent(parent);
if(m_switch_time>=0) if(m_switch_time>=0)
{ {
Item::ItemType new_type = m_switch_to[item->getType()]; Item::ItemType new_type = m_switch_to[item->getType()];
item->switchTo(new_type, m_item_mesh[(int)new_type], m_item_lowres_mesh[(int)new_type]); item->switchTo(new_type, m_item_mesh[(int)new_type],
m_item_lowres_mesh[(int)new_type]);
} }
if(index<(int)m_all_items.size()) if(index<(int)m_all_items.size())
m_all_items[index] = item; m_all_items[index] = item;
@ -193,7 +195,8 @@ Item* ItemManager::newItem(Item::ItemType type, const Vec3& xyz,
/** Creates a new trigger item. /** Creates a new trigger item.
* \param xyz Position of the item. * \param xyz Position of the item.
*/ */
Item* ItemManager::newItem(const Vec3& xyz, float distance, TriggerItemListener* listener) Item* ItemManager::newItem(const Vec3& xyz, float distance,
TriggerItemListener* listener)
{ {
// Find where the item can be stored in the index list: either in a // Find where the item can be stored in the index list: either in a
// previously deleted entry, otherwise at the end. // previously deleted entry, otherwise at the end.
@ -214,8 +217,8 @@ Item* ItemManager::newItem(const Vec3& xyz, float distance, TriggerItemListener*
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** Set an item as collected. /** Set an item as collected.
* This function is called on the server when an item is collected, or on the * This function is called on the server when an item is collected, or on
* client upon receiving information about collected items. */ * the client upon receiving information about collected items. */
void ItemManager::collectedItem(int item_id, AbstractKart *kart, int add_info) void ItemManager::collectedItem(int item_id, AbstractKart *kart, int add_info)
{ {
Item *item=m_all_items[item_id]; Item *item=m_all_items[item_id];
@ -264,7 +267,7 @@ void ItemManager::cleanup()
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** Resets all items and removes bubble gum that is stuck on the track. /** Resets all items and removes bubble gum that is stuck on the track.
* This is necessary in case that a race is restarted. * This is done when a race is restarted.
*/ */
void ItemManager::reset() void ItemManager::reset()
{ {
@ -305,6 +308,10 @@ void ItemManager::reset()
} // reset } // reset
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
/** Updates all items, and handles switching items back if the switch time
* is over.
* \param dt Time step.
*/
void ItemManager::update(float dt) void ItemManager::update(float dt)
{ {
// If switch time is over, switch all items back // If switch time is over, switch all items back