From 81d54f08b07f4c0853e914536ef643661713cc65 Mon Sep 17 00:00:00 2001 From: Armin Weatherwax Date: Fri, 25 Mar 2011 10:34:33 +0100 Subject: cleaned up particle system llsd de/serialization; improvements to the avatar cloud * llsd now uses camel case for each key, confusion of particle max age vs source max age fixed * cloud.xml is now loaded with a fallback chain PER_SL_ACCOUNT -> USER_SETTINGS -> APP_SETTINGS so that customized clouds can exist per account or for all users and survive updates --- linden/indra/llmessage/llpartdata.cpp | 28 ++++---- linden/indra/newview/app_settings/cloud.xml | 100 +++++++++++++++++----------- linden/indra/newview/llvoavatar.cpp | 10 ++- 3 files changed, 83 insertions(+), 55 deletions(-) diff --git a/linden/indra/llmessage/llpartdata.cpp b/linden/indra/llmessage/llpartdata.cpp index a2811ab..4012d2c 100644 --- a/linden/indra/llmessage/llpartdata.cpp +++ b/linden/indra/llmessage/llpartdata.cpp @@ -363,14 +363,14 @@ LLSD LLPartSysData::asLLSD() const sd["LL_PART_EMISSIVE_MASK"] = (LLPartData::LL_PART_EMISSIVE_MASK & mPartData.mFlags) ? 1 : 0; sd["LL_PART_BEAM_MASK"] = (LLPartData::LL_PART_BEAM_MASK & mPartData.mFlags) ? 1 : 0; - sd["SourceMaxage"] = mPartData.mMaxAge; - sd["Startcolor"] = ll_sd_from_color4(mPartData.mStartColor); - sd["Endcolor"] = ll_sd_from_color4(mPartData.mEndColor); - sd["Startscale"] = ll_sd_from_vector2(mPartData.mStartScale); - sd["Endscale"] = ll_sd_from_vector2(mPartData.mEndScale); + sd["ParticleMaxAge"] = mPartData.mMaxAge; + sd["StartColor"] = ll_sd_from_color4(mPartData.mStartColor); + sd["EndColor"] = ll_sd_from_color4(mPartData.mEndColor); + sd["StartScale"] = ll_sd_from_vector2(mPartData.mStartScale); + sd["EndScale"] = ll_sd_from_vector2(mPartData.mEndScale); - sd["ParticleMaxAge"] = mMaxAge; - sd["ParticleStartAge"] = mStartAge; + sd["SourceMaxAge"] = mMaxAge; + sd["SourceStartAge"] = mStartAge; sd["LL_PART_SRC_PATTERN_DROP"] = ( mPattern & LL_PART_SRC_PATTERN_DROP) ? 1 : 0; @@ -406,14 +406,14 @@ bool LLPartSysData::fromLLSD(LLSD& sd) if (sd["LL_PART_EMISSIVE_MASK"]) mPartData.mFlags |= LLPartData::LL_PART_EMISSIVE_MASK; if (sd["LL_PART_BEAM_MASK"]) mPartData.mFlags |= LLPartData::LL_PART_BEAM_MASK; - mPartData.mMaxAge = (F32)sd["SourceMaxage"].asReal(); - mPartData.mStartColor = ll_color4_from_sd(sd["Startcolor"]); - mPartData.mEndColor = ll_color4_from_sd(sd["Endcolor"]); - mPartData.mStartScale = ll_vector2_from_sd(sd["Startscale"]); - mPartData.mEndScale = ll_vector2_from_sd(sd["Endscale"]); + mPartData.mMaxAge = (F32)sd["ParticleMaxAge"].asReal(); + mPartData.mStartColor = ll_color4_from_sd(sd["StartColor"]); + mPartData.mEndColor = ll_color4_from_sd(sd["EndColor"]); + mPartData.mStartScale = ll_vector2_from_sd(sd["StartScale"]); + mPartData.mEndScale = ll_vector2_from_sd(sd["EndScale"]); - mMaxAge = (F32)sd["ParticleMaxAge"].asReal(); - mStartAge = (F32)sd["ParticleStartAge"].asReal(); + mMaxAge = (F32)sd["SourceMaxAge"].asReal(); + mStartAge = (F32)sd["SourceStartAge"].asReal(); mPattern = 0; if (sd["LL_PART_SRC_PATTERN_DROP"]) mPattern |= LL_PART_SRC_PATTERN_DROP; diff --git a/linden/indra/newview/app_settings/cloud.xml b/linden/indra/newview/app_settings/cloud.xml index ff9492b..e62bcf1 100644 --- a/linden/indra/newview/app_settings/cloud.xml +++ b/linden/indra/newview/app_settings/cloud.xml @@ -1,33 +1,87 @@ + + + + + SourceMaxAge + 0 + SourceStartAge + 0 + AngularVelocity 0 0 0 + InnerAngle + 3.1415927410125732421875 + OuterAngle + 0 + BurstPartCount 1 BurstRadius 0.3 BurstRate 0.02 + BurstSpeedMin + 0.1 BurstSpeedMax 1 - Endcolor + + + LL_PART_SRC_PATTERN_ANGLE + 0 + LL_PART_SRC_PATTERN_ANGLE_CONE + 1 + LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY + 0 + LL_PART_SRC_PATTERN_DROP + 0 + LL_PART_SRC_PATTERN_EXPLODE + 0 + + + + + ParticleMaxAge + 4 + + PartImageID + 0000000000000-0000-0000-000000000000 + + StartColor + + 0.9 + 0.0 + 0.8 + 0.7 + + EndColor 0.75 0.47 0.81 0 - Endscale + + StartScale + + 0.8 + 0.8 + + EndScale 0.02 0.02 - InnerAngle - 3.1415927410125732421875 + + TargetId + 00000000-0000-0000-0000-000000000000 + + LL_PART_BEAM_MASK 0 LL_PART_BOUNCE_MASK @@ -42,47 +96,13 @@ 1 LL_PART_INTERP_SCALE_MASK 1 - LL_PART_SRC_PATTERN_ANGLE - 0 - LL_PART_SRC_PATTERN_ANGLE_CONE - 1 - LL_PART_SRC_PATTERN_ANGLE_CONE_EMPTY - 0 - LL_PART_SRC_PATTERN_DROP - 0 - LL_PART_SRC_PATTERN_EXPLODE - 0 LL_PART_TARGET_LINEAR_MASK 0 LL_PART_TARGET_POS_MASK 1 LL_PART_WIND_MASK 0 - OuterAngle - 0 - PartImageID - 0000000000000-0000-0000-000000000000 - ParticleMaxAge - 0 - ParticleStartAge - 0 - SourceMaxage - 4 - Startcolor - - 0.9 - 0.0 - 0.8 - 0.7 - - Startscale - - 0.8 - 0.8 - - TargetId - 00000000-0000-0000-0000-000000000000 - BurstSpeedMin - 0.1 + + diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 204357f..c0ddac5 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -1496,8 +1496,16 @@ LLPartSysData LLVOAvatar::sCloud; void LLVOAvatar::initCloud() { // fancy particle cloud designed by Brent + std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "cloud.xml"); + if(!gDirUtilp->fileExists(filename)) + { + filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "cloud.xml"); + } + if(!gDirUtilp->fileExists(filename)) + { + filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cloud.xml"); + } - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "cloud.xml"); LLSD cloud; llifstream in_file(filename); LLSDSerialize::fromXMLDocument(cloud, in_file); -- cgit v1.1