diff --git a/indra/llmessage/sound_ids.cpp b/indra/llmessage/sound_ids.cpp index 2b8a0807c6..b43e591c3e 100644 --- a/indra/llmessage/sound_ids.cpp +++ b/indra/llmessage/sound_ids.cpp @@ -105,7 +105,58 @@ const LLUUID SND_WOOD_PLASTIC ("c70141d4-ba06-41ea-bcbc-35ea81cb8335"); const LLUUID SND_WOOD_RUBBER ("7d1826f4-24c4-4aac-8c2e-eff45df37783"); const LLUUID SND_WOOD_WOOD ("063c97d3-033a-4e9b-98d8-05c8074922cb"); - +// FIRE-31628 Use OpenSim collision sounds when in OpenSim +#ifdef OPENSIM +const LLUUID OPENSIM_SND_FLESH_FLESH ("be7295c0-a158-11e1-b3dd-0804204c9a66"); +const LLUUID OPENSIM_SND_FLESH_GLASS ("be7295c0-a158-11e1-b3dd-0804202c9a66"); +const LLUUID OPENSIM_SND_FLESH_METAL ("be7295c0-a158-11e1-b3dd-0804201c9a66"); +const LLUUID OPENSIM_SND_FLESH_PLASTIC ("be7295c0-a158-11e1-b3dd-0804205c9a66"); +const LLUUID OPENSIM_SND_FLESH_RUBBER ("be7295c0-a158-11e1-b3dd-0804206c9a66"); +const LLUUID OPENSIM_SND_FLESH_STONE ("be7295c0-a158-11e1-b3dd-0804200c9a66"); +const LLUUID OPENSIM_SND_FLESH_WOOD ("be7295c0-a158-11e1-b3dd-0804203c9a66"); +const LLUUID OPENSIM_SND_GLASS_FLESH ("be7295c0-a158-11e1-b3dd-0802204c9a66"); +const LLUUID OPENSIM_SND_GLASS_GLASS ("be7295c0-a158-11e1-b3dd-0802202c9a66"); +const LLUUID OPENSIM_SND_GLASS_METAL ("be7295c0-a158-11e1-b3dd-0802201c9a66"); +const LLUUID OPENSIM_SND_GLASS_PLASTIC ("be7295c0-a158-11e1-b3dd-0802205c9a66"); +const LLUUID OPENSIM_SND_GLASS_RUBBER ("be7295c0-a158-11e1-b3dd-0802206c9a66"); +const LLUUID OPENSIM_SND_GLASS_STONE ("be7295c0-a158-11e1-b3dd-0802200c9a66"); +const LLUUID OPENSIM_SND_GLASS_WOOD ("be7295c0-a158-11e1-b3dd-0802203c9a66"); +const LLUUID OPENSIM_SND_METAL_FLESH ("be7295c0-a158-11e1-b3dd-0801204c9a66"); +const LLUUID OPENSIM_SND_METAL_GLASS ("be7295c0-a158-11e1-b3dd-0801202c9a66"); +const LLUUID OPENSIM_SND_METAL_METAL ("be7295c0-a158-11e1-b3dd-0801201c9a66"); +const LLUUID OPENSIM_SND_METAL_PLASTIC ("be7295c0-a158-11e1-b3dd-0801205c9a66"); +const LLUUID OPENSIM_SND_METAL_RUBBER ("be7295c0-a158-11e1-b3dd-0801206c9a66"); +const LLUUID OPENSIM_SND_METAL_STONE ("be7295c0-a158-11e1-b3dd-0801200c9a66"); +const LLUUID OPENSIM_SND_METAL_WOOD ("be7295c0-a158-11e1-b3dd-0801203c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_FLESH ("be7295c0-a158-11e1-b3dd-0805204c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_GLASS ("be7295c0-a158-11e1-b3dd-0805202c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_METAL ("be7295c0-a158-11e1-b3dd-0805201c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_PLASTIC ("be7295c0-a158-11e1-b3dd-0805205c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_RUBBER ("be7295c0-a158-11e1-b3dd-0805206c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_STONE ("be7295c0-a158-11e1-b3dd-0805200c9a66"); +const LLUUID OPENSIM_SND_PLASTIC_WOOD ("be7295c0-a158-11e1-b3dd-0805203c9a66"); +const LLUUID OPENSIM_SND_RUBBER_FLESH ("be7295c0-a158-11e1-b3dd-0806204c9a66"); +const LLUUID OPENSIM_SND_RUBBER_GLASS ("be7295c0-a158-11e1-b3dd-0806202c9a66"); +const LLUUID OPENSIM_SND_RUBBER_METAL ("be7295c0-a158-11e1-b3dd-0806201c9a66"); +const LLUUID OPENSIM_SND_RUBBER_PLASTIC ("be7295c0-a158-11e1-b3dd-0806205c9a66"); +const LLUUID OPENSIM_SND_RUBBER_RUBBER ("be7295c0-a158-11e1-b3dd-0806206c9a66"); +const LLUUID OPENSIM_SND_RUBBER_STONE ("be7295c0-a158-11e1-b3dd-0806200c9a66"); +const LLUUID OPENSIM_SND_RUBBER_WOOD ("be7295c0-a158-11e1-b3dd-0806203c9a66"); +const LLUUID OPENSIM_SND_STONE_FLESH ("be7295c0-a158-11e1-b3dd-0800204c9a66"); +const LLUUID OPENSIM_SND_STONE_GLASS ("be7295c0-a158-11e1-b3dd-0800202c9a66"); +const LLUUID OPENSIM_SND_STONE_METAL ("be7295c0-a158-11e1-b3dd-0800201c9a66"); +const LLUUID OPENSIM_SND_STONE_PLASTIC ("be7295c0-a158-11e1-b3dd-0800205c9a66"); +const LLUUID OPENSIM_SND_STONE_RUBBER ("be7295c0-a158-11e1-b3dd-0800206c9a66"); +const LLUUID OPENSIM_SND_STONE_STONE ("be7295c0-a158-11e1-b3dd-0800200c9a66"); +const LLUUID OPENSIM_SND_STONE_WOOD ("be7295c0-a158-11e1-b3dd-0800203c9a66"); +const LLUUID OPENSIM_SND_WOOD_FLESH ("be7295c0-a158-11e1-b3dd-0803204c9a66" ); +const LLUUID OPENSIM_SND_WOOD_GLASS ("be7295c0-a158-11e1-b3dd-0803202c9a66"); +const LLUUID OPENSIM_SND_WOOD_METAL ("be7295c0-a158-11e1-b3dd-0803201c9a66"); +const LLUUID OPENSIM_SND_WOOD_PLASTIC ("be7295c0-a158-11e1-b3dd-0803205c9a66"); +const LLUUID OPENSIM_SND_WOOD_RUBBER ("be7295c0-a158-11e1-b3dd-0803206c9a66"); +const LLUUID OPENSIM_SND_WOOD_STONE ("be7295c0-a158-11e1-b3dd-0803200c9a66"); +const LLUUID OPENSIM_SND_WOOD_WOOD ("be7295c0-a158-11e1-b3dd-0803203c9a66"); +#endif //OPENSIM const LLUUID SND_SLIDE_FLESH_FLESH ("614eec22-f73d-4fdc-8691-a37dc5c58333"); const LLUUID SND_SLIDE_FLESH_PLASTIC (SND_NULL); const LLUUID SND_SLIDE_FLESH_RUBBER (SND_NULL); diff --git a/indra/llmessage/sound_ids.h b/indra/llmessage/sound_ids.h index 6a2e343ad3..3d46c5e134 100644 --- a/indra/llmessage/sound_ids.h +++ b/indra/llmessage/sound_ids.h @@ -105,8 +105,59 @@ extern const LLUUID SND_WOOD_FLESH; extern const LLUUID SND_WOOD_PLASTIC; extern const LLUUID SND_WOOD_RUBBER; extern const LLUUID SND_WOOD_WOOD; - - +// FIRE-31628 Use OpenSim collision sounds when in OpenSim +#ifdef OPENSIM +extern const LLUUID OPENSIM_SND_FLESH_FLESH; +extern const LLUUID OPENSIM_SND_FLESH_GLASS; +extern const LLUUID OPENSIM_SND_FLESH_METAL; +extern const LLUUID OPENSIM_SND_FLESH_PLASTIC; +extern const LLUUID OPENSIM_SND_FLESH_RUBBER; +extern const LLUUID OPENSIM_SND_FLESH_STONE; +extern const LLUUID OPENSIM_SND_FLESH_WOOD; +extern const LLUUID OPENSIM_SND_GLASS_FLESH; +extern const LLUUID OPENSIM_SND_GLASS_GLASS; +extern const LLUUID OPENSIM_SND_GLASS_METAL; +extern const LLUUID OPENSIM_SND_GLASS_PLASTIC; +extern const LLUUID OPENSIM_SND_GLASS_RUBBER; +extern const LLUUID OPENSIM_SND_GLASS_STONE; +extern const LLUUID OPENSIM_SND_GLASS_WOOD; +extern const LLUUID OPENSIM_SND_METAL_FLESH; +extern const LLUUID OPENSIM_SND_METAL_GLASS; +extern const LLUUID OPENSIM_SND_METAL_METAL; +extern const LLUUID OPENSIM_SND_METAL_PLASTIC; +extern const LLUUID OPENSIM_SND_METAL_RUBBER; +extern const LLUUID OPENSIM_SND_METAL_STONE; +extern const LLUUID OPENSIM_SND_METAL_WOOD; +extern const LLUUID OPENSIM_SND_PLASTIC_FLESH; +extern const LLUUID OPENSIM_SND_PLASTIC_GLASS; +extern const LLUUID OPENSIM_SND_PLASTIC_METAL; +extern const LLUUID OPENSIM_SND_PLASTIC_PLASTIC; +extern const LLUUID OPENSIM_SND_PLASTIC_RUBBER; +extern const LLUUID OPENSIM_SND_PLASTIC_STONE; +extern const LLUUID OPENSIM_SND_PLASTIC_WOOD; +extern const LLUUID OPENSIM_SND_RUBBER_FLESH; +extern const LLUUID OPENSIM_SND_RUBBER_GLASS; +extern const LLUUID OPENSIM_SND_RUBBER_METAL; +extern const LLUUID OPENSIM_SND_RUBBER_PLASTIC; +extern const LLUUID OPENSIM_SND_RUBBER_RUBBER; +extern const LLUUID OPENSIM_SND_RUBBER_STONE; +extern const LLUUID OPENSIM_SND_RUBBER_WOOD; +extern const LLUUID OPENSIM_SND_STONE_FLESH; +extern const LLUUID OPENSIM_SND_STONE_GLASS; +extern const LLUUID OPENSIM_SND_STONE_METAL; +extern const LLUUID OPENSIM_SND_STONE_PLASTIC; +extern const LLUUID OPENSIM_SND_STONE_RUBBER; +extern const LLUUID OPENSIM_SND_STONE_STONE; +extern const LLUUID OPENSIM_SND_STONE_WOOD; +extern const LLUUID OPENSIM_SND_WOOD_FLESH; +extern const LLUUID OPENSIM_SND_WOOD_GLASS; +extern const LLUUID OPENSIM_SND_WOOD_METAL; +extern const LLUUID OPENSIM_SND_WOOD_PLASTIC; +extern const LLUUID OPENSIM_SND_WOOD_RUBBER; +extern const LLUUID OPENSIM_SND_WOOD_STONE; +extern const LLUUID OPENSIM_SND_WOOD_WOOD; +#endif //OPENSIM +// extern const LLUUID SND_SLIDE_FLESH_FLESH; extern const LLUUID SND_SLIDE_FLESH_PLASTIC; extern const LLUUID SND_SLIDE_FLESH_RUBBER; diff --git a/indra/llprimitive/llmaterialtable.cpp b/indra/llprimitive/llmaterialtable.cpp index 58b2d00d44..f47d511019 100644 --- a/indra/llprimitive/llmaterialtable.cpp +++ b/indra/llprimitive/llmaterialtable.cpp @@ -341,6 +341,114 @@ void LLMaterialTable::initBasicTable() } } +// FIRE-31628 Use OpenSim collision sounds when in OpenSim +#ifdef OPENSIM +void LLMaterialTable::replaceCollsionSounds(bool useOpenSim) +{ + if(mCollisionSoundMatrix) + delete[] mCollisionSoundMatrix; + + mCollisionSoundMatrix= new LLUUID[LL_MCODE_END*LL_MCODE_END]; + + if (mCollisionSoundMatrix) + { + if(useOpenSim) + { + addCollisionSound(LL_MCODE_STONE, LL_MCODE_FLESH, OPENSIM_SND_STONE_FLESH); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_METAL, OPENSIM_SND_STONE_METAL); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_GLASS, OPENSIM_SND_STONE_GLASS); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_PLASTIC, OPENSIM_SND_STONE_PLASTIC); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_RUBBER, OPENSIM_SND_STONE_RUBBER); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_STONE, OPENSIM_SND_STONE_STONE); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_WOOD, OPENSIM_SND_STONE_WOOD); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_LIGHT, OPENSIM_SND_STONE_PLASTIC); + + addCollisionSound(LL_MCODE_METAL, LL_MCODE_FLESH, OPENSIM_SND_METAL_FLESH); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_GLASS, OPENSIM_SND_METAL_GLASS); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_METAL, OPENSIM_SND_METAL_METAL); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_PLASTIC, OPENSIM_SND_METAL_PLASTIC); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_RUBBER, OPENSIM_SND_METAL_RUBBER); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_WOOD, OPENSIM_SND_METAL_WOOD); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_LIGHT, OPENSIM_SND_METAL_PLASTIC); + + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_FLESH, OPENSIM_SND_GLASS_FLESH); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_GLASS, OPENSIM_SND_GLASS_GLASS); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_PLASTIC, OPENSIM_SND_GLASS_PLASTIC); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_RUBBER, OPENSIM_SND_GLASS_RUBBER); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_WOOD, OPENSIM_SND_GLASS_WOOD); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_LIGHT, OPENSIM_SND_GLASS_PLASTIC); + + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_FLESH, OPENSIM_SND_WOOD_FLESH); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_PLASTIC, OPENSIM_SND_WOOD_PLASTIC); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_RUBBER, OPENSIM_SND_WOOD_RUBBER); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_WOOD, OPENSIM_SND_WOOD_WOOD); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_LIGHT, OPENSIM_SND_WOOD_PLASTIC); + + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_FLESH, OPENSIM_SND_FLESH_FLESH); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_PLASTIC, OPENSIM_SND_FLESH_PLASTIC); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_RUBBER, OPENSIM_SND_FLESH_RUBBER); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_LIGHT, OPENSIM_SND_FLESH_PLASTIC); + + addCollisionSound(LL_MCODE_RUBBER, LL_MCODE_RUBBER, OPENSIM_SND_RUBBER_RUBBER); + addCollisionSound(LL_MCODE_RUBBER, LL_MCODE_LIGHT, OPENSIM_SND_RUBBER_PLASTIC); + + addCollisionSound(LL_MCODE_PLASTIC, LL_MCODE_PLASTIC, OPENSIM_SND_PLASTIC_PLASTIC); + addCollisionSound(LL_MCODE_PLASTIC, LL_MCODE_RUBBER, OPENSIM_SND_PLASTIC_RUBBER); + addCollisionSound(LL_MCODE_PLASTIC, LL_MCODE_LIGHT, OPENSIM_SND_PLASTIC_PLASTIC); + + addCollisionSound(LL_MCODE_LIGHT, LL_MCODE_LIGHT, OPENSIM_SND_PLASTIC_PLASTIC); + } + else + { + addCollisionSound(LL_MCODE_STONE, LL_MCODE_STONE, SND_STONE_STONE); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_METAL, SND_STONE_METAL); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_GLASS, SND_STONE_GLASS); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_WOOD, SND_STONE_WOOD); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_FLESH, SND_STONE_FLESH); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_PLASTIC, SND_STONE_PLASTIC); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_RUBBER, SND_STONE_RUBBER); + addCollisionSound(LL_MCODE_STONE, LL_MCODE_LIGHT, SND_STONE_PLASTIC); + + addCollisionSound(LL_MCODE_METAL, LL_MCODE_METAL, SND_METAL_METAL); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_GLASS, SND_METAL_GLASS); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_WOOD, SND_METAL_WOOD); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_FLESH, SND_METAL_FLESH); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_PLASTIC, SND_METAL_PLASTIC); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_LIGHT, SND_METAL_PLASTIC); + addCollisionSound(LL_MCODE_METAL, LL_MCODE_RUBBER, SND_METAL_RUBBER); + + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_GLASS, SND_GLASS_GLASS); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_WOOD, SND_GLASS_WOOD); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_FLESH, SND_GLASS_FLESH); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_PLASTIC, SND_GLASS_PLASTIC); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_RUBBER, SND_GLASS_RUBBER); + addCollisionSound(LL_MCODE_GLASS, LL_MCODE_LIGHT, SND_GLASS_PLASTIC); + + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_WOOD, SND_WOOD_WOOD); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_FLESH, SND_WOOD_FLESH); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_PLASTIC, SND_WOOD_PLASTIC); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_RUBBER, SND_WOOD_RUBBER); + addCollisionSound(LL_MCODE_WOOD, LL_MCODE_LIGHT, SND_WOOD_PLASTIC); + + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_FLESH, SND_FLESH_FLESH); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_PLASTIC, SND_FLESH_PLASTIC); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_RUBBER, SND_FLESH_RUBBER); + addCollisionSound(LL_MCODE_FLESH, LL_MCODE_LIGHT, SND_FLESH_PLASTIC); + + addCollisionSound(LL_MCODE_RUBBER, LL_MCODE_RUBBER, SND_RUBBER_RUBBER); + addCollisionSound(LL_MCODE_RUBBER, LL_MCODE_PLASTIC, SND_RUBBER_PLASTIC); + addCollisionSound(LL_MCODE_RUBBER, LL_MCODE_LIGHT, SND_RUBBER_PLASTIC); + + addCollisionSound(LL_MCODE_PLASTIC, LL_MCODE_PLASTIC, SND_PLASTIC_PLASTIC); + addCollisionSound(LL_MCODE_PLASTIC, LL_MCODE_LIGHT, SND_PLASTIC_PLASTIC); + + addCollisionSound(LL_MCODE_LIGHT, LL_MCODE_LIGHT, SND_PLASTIC_PLASTIC); + } + } +} +#endif // OPENSIM +// + BOOL LLMaterialTable::add(U8 mcode, const std::string& name, const LLUUID &uuid) { LLMaterialInfo *infop; diff --git a/indra/llprimitive/llmaterialtable.h b/indra/llprimitive/llmaterialtable.h index 0cf5e626ef..e227fa7ce7 100644 --- a/indra/llprimitive/llmaterialtable.h +++ b/indra/llprimitive/llmaterialtable.h @@ -116,6 +116,12 @@ public: BOOL addRestitution(U8 mcode, const F32 &restitution); BOOL addDamageAndEnergy(U8 mcode, const F32 &hp_mod, const F32 &damage_mod, const F32 &ep_mod); + // FIRE-31628 Use OpenSim collision sounds when in OpenSim + #ifdef OPENSIM + void replaceCollsionSounds(bool useOpenSim=false); + #endif + // + LLUUID getDefaultTextureID(const std::string& name); // LLUUID::null if not found LLUUID getDefaultTextureID(U8 mcode); // LLUUID::null if not found U8 getMCode(const std::string& name); // 0 if not found diff --git a/indra/newview/fsgridhandler.cpp b/indra/newview/fsgridhandler.cpp index 462b10ca41..14f369ffda 100644 --- a/indra/newview/fsgridhandler.cpp +++ b/indra/newview/fsgridhandler.cpp @@ -52,6 +52,7 @@ #include "fscorehttputil.h" #include "fspanellogin.h" #include "lfsimfeaturehandler.h" // +#include "llmaterialtable.h" // FIRE-31628 for access to static var void gridDownloadError( LLSD const &aData, LLGridManager* mOwner, GridEntry* mData, LLGridManager::AddState mState ) { @@ -1051,6 +1052,7 @@ void LLGridManager::setGridChoice(const std::string& grid) gSavedSettings.setString("CurrentGrid", grid); LLTrans::setDefaultArg("CURRENT_GRID", getGridLabel()); // updateIsInProductionGrid(); + LLMaterialTable::basic.replaceCollsionSounds(isInOpenSim()); // FIRE-31628 Use OpenSim collision sounds when in OpenSim mReadyToLogin = true; } }