forked from mirror/openmw-tes3mp
Accept a ConstPtr in get*SoundId
This commit is contained in:
parent
dc92fefd2b
commit
d77f785cbc
26 changed files with 56 additions and 60 deletions
|
@ -82,12 +82,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Apparatus).name(), instance);
|
||||
}
|
||||
|
||||
std::string Apparatus::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Apparatus::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Apparatus Up");
|
||||
}
|
||||
|
||||
std::string Apparatus::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Apparatus::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Apparatus Down");
|
||||
}
|
||||
|
|
|
@ -45,10 +45,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Armor).name(), instance);
|
||||
}
|
||||
|
||||
std::string Armor::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Armor::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
int es = getEquipmentSkill(ptr);
|
||||
if (es == ESM::Skill::LightArmor)
|
||||
|
@ -188,7 +188,7 @@ namespace MWClass
|
|||
return std::string("Item Armor Heavy Up");
|
||||
}
|
||||
|
||||
std::string Armor::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Armor::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
int es = getEquipmentSkill(ptr);
|
||||
if (es == ESM::Skill::LightArmor)
|
||||
|
|
|
@ -58,10 +58,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -96,12 +96,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Book).name(), instance);
|
||||
}
|
||||
|
||||
std::string Book::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Book::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Book Up");
|
||||
}
|
||||
|
||||
std::string Book::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Book::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Book Down");
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -133,10 +133,9 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Clothing).name(), instance);
|
||||
}
|
||||
|
||||
std::string Clothing::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Clothing::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->mBase->mData.mType == 8)
|
||||
{
|
||||
|
@ -145,10 +144,9 @@ namespace MWClass
|
|||
return std::string("Item Clothes Up");
|
||||
}
|
||||
|
||||
std::string Clothing::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Clothing::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Clothing> *ref =
|
||||
ptr.get<ESM::Clothing>();
|
||||
const MWWorld::LiveCellRef<ESM::Clothing> *ref = ptr.get<ESM::Clothing>();
|
||||
|
||||
if (ref->mBase->mData.mType == 8)
|
||||
{
|
||||
|
|
|
@ -50,10 +50,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -98,12 +98,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Ingredient).name(), instance);
|
||||
}
|
||||
|
||||
std::string Ingredient::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Ingredient::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Ingredient Up");
|
||||
}
|
||||
|
||||
std::string Ingredient::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Ingredient::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Ingredient Down");
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -126,12 +126,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Light).name(), instance);
|
||||
}
|
||||
|
||||
std::string Light::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Light::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Misc Up");
|
||||
}
|
||||
|
||||
std::string Light::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Light::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Misc Down");
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -92,12 +92,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Lockpick).name(), instance);
|
||||
}
|
||||
|
||||
std::string Lockpick::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Lockpick::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Lockpick Up");
|
||||
}
|
||||
|
||||
std::string Lockpick::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Lockpick::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Lockpick Down");
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -106,14 +106,14 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Miscellaneous).name(), instance);
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Miscellaneous::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
if (isGold(ptr))
|
||||
return std::string("Item Gold Up");
|
||||
return std::string("Item Misc Up");
|
||||
}
|
||||
|
||||
std::string Miscellaneous::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Miscellaneous::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
if (isGold(ptr))
|
||||
return std::string("Item Gold Down");
|
||||
|
|
|
@ -42,10 +42,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -87,12 +87,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Potion).name(), instance);
|
||||
}
|
||||
|
||||
std::string Potion::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Potion::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Potion Up");
|
||||
}
|
||||
|
||||
std::string Potion::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Potion::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Potion Down");
|
||||
}
|
||||
|
|
|
@ -45,10 +45,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -92,12 +92,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Probe).name(), instance);
|
||||
}
|
||||
|
||||
std::string Probe::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Probe::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Probe Up");
|
||||
}
|
||||
|
||||
std::string Probe::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Probe::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Probe Down");
|
||||
}
|
||||
|
|
|
@ -46,10 +46,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -83,12 +83,12 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Repair).name(), instance);
|
||||
}
|
||||
|
||||
std::string Repair::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Repair::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Repair Up");
|
||||
}
|
||||
|
||||
std::string Repair::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Repair::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
return std::string("Item Repair Down");
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -153,10 +153,9 @@ namespace MWClass
|
|||
registerClass (typeid (ESM::Weapon).name(), instance);
|
||||
}
|
||||
|
||||
std::string Weapon::getUpSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Weapon::getUpSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->mBase->mData.mType;
|
||||
// Ammo
|
||||
|
@ -198,10 +197,9 @@ namespace MWClass
|
|||
return std::string("Item Misc Up");
|
||||
}
|
||||
|
||||
std::string Weapon::getDownSoundId (const MWWorld::Ptr& ptr) const
|
||||
std::string Weapon::getDownSoundId (const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
MWWorld::LiveCellRef<ESM::Weapon> *ref =
|
||||
ptr.get<ESM::Weapon>();
|
||||
const MWWorld::LiveCellRef<ESM::Weapon> *ref = ptr.get<ESM::Weapon>();
|
||||
|
||||
int type = ref->mBase->mData.mType;
|
||||
// Ammo
|
||||
|
|
|
@ -56,10 +56,10 @@ namespace MWClass
|
|||
|
||||
static void registerSelf();
|
||||
|
||||
virtual std::string getUpSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the pick up sound Id
|
||||
|
||||
virtual std::string getDownSoundId (const MWWorld::Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const MWWorld::ConstPtr& ptr) const;
|
||||
///< Return the put down sound Id
|
||||
|
||||
virtual std::string getInventoryIcon (const MWWorld::ConstPtr& ptr) const;
|
||||
|
|
|
@ -252,12 +252,12 @@ namespace MWWorld
|
|||
sClasses.insert(std::make_pair(key, instance));
|
||||
}
|
||||
|
||||
std::string Class::getUpSoundId (const Ptr& ptr) const
|
||||
std::string Class::getUpSoundId (const ConstPtr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("class does not have an up sound");
|
||||
}
|
||||
|
||||
std::string Class::getDownSoundId (const Ptr& ptr) const
|
||||
std::string Class::getDownSoundId (const ConstPtr& ptr) const
|
||||
{
|
||||
throw std::runtime_error ("class does not have an down sound");
|
||||
}
|
||||
|
|
|
@ -234,11 +234,11 @@ namespace MWWorld
|
|||
///
|
||||
/// (default implementation: return false)
|
||||
|
||||
virtual std::string getUpSoundId (const Ptr& ptr) const;
|
||||
virtual std::string getUpSoundId (const ConstPtr& ptr) const;
|
||||
///< Return the up sound ID of \a ptr or throw an exception, if class does not support ID retrieval
|
||||
/// (default implementation: throw an exception)
|
||||
|
||||
virtual std::string getDownSoundId (const Ptr& ptr) const;
|
||||
virtual std::string getDownSoundId (const ConstPtr& ptr) const;
|
||||
///< Return the down sound ID of \a ptr or throw an exception, if class does not support ID retrieval
|
||||
/// (default implementation: throw an exception)
|
||||
|
||||
|
|
Loading…
Reference in a new issue