diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-04-21 19:08:15 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-04-21 19:08:15 -0400 |
commit | 6aa3b75224f68fffc640253ced8bf5c162acdf2d (patch) | |
tree | 955baea20530cb822b8ce57c7c014175b0299281 /indra | |
parent | d692ed38bda3bf2d229cedb26b3dd7ef859daa42 (diff) |
For EXT-6953: improved default animations.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcharacter/llanimationstates.cpp | 7 | ||||
-rw-r--r-- | indra/llcharacter/llanimationstates.h | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 12 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 84 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 1 |
5 files changed, 84 insertions, 24 deletions
diff --git a/indra/llcharacter/llanimationstates.cpp b/indra/llcharacter/llanimationstates.cpp index ea3546fa1e..09deaf1932 100644 --- a/indra/llcharacter/llanimationstates.cpp +++ b/indra/llcharacter/llanimationstates.cpp @@ -39,6 +39,9 @@ #include "llanimationstates.h" #include "llstring.h" +// Would be nice to be able to toggle at run-time, but not gonna +// happen while we're using const LLUUIDs as keys. + const LLUUID ANIM_AGENT_AFRAID = LLUUID("6b61c8e8-4747-0d75-12d7-e49ff207a4ca"); const LLUUID ANIM_AGENT_AIM_BAZOOKA_R = LLUUID("b5b4a67d-0aee-30d2-72cd-77b333e932ef"); const LLUUID ANIM_AGENT_AIM_BOW_L = LLUUID("46bb4359-de38-4ed8-6a22-f1f52fe8f506"); @@ -91,6 +94,8 @@ const LLUUID ANIM_AGENT_EXPRESS_TOOTHSMILE = LLUUID("b92ec1a5-e7ce-a76b-2b05-bcd const LLUUID ANIM_AGENT_EXPRESS_WINK = LLUUID("da020525-4d94-59d6-23d7-81fdebf33148"); const LLUUID ANIM_AGENT_EXPRESS_WORRY = LLUUID("9c05e5c7-6f07-6ca4-ed5a-b230390c3950"); const LLUUID ANIM_AGENT_FALLDOWN = LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094"); +const LLUUID ANIM_AGENT_FEMALE_RUN_NEW = LLUUID("5c083e7f-6462-a637-8d33-afaefa7a97bc"); +const LLUUID ANIM_AGENT_FEMALE_WALK_NEW = LLUUID("14b7b3c8-8987-85ab-9f29-5a5956058e55"); const LLUUID ANIM_AGENT_FEMALE_WALK = LLUUID("f5fc7433-043d-e819-8298-f519a119b688"); const LLUUID ANIM_AGENT_FINGER_WAG = LLUUID("c1bc7f36-3ba0-d844-f93c-93be945d644f"); const LLUUID ANIM_AGENT_FIST_PUMP = LLUUID("7db00ccd-f380-f3ee-439d-61968ec69c8a"); @@ -130,6 +135,7 @@ const LLUUID ANIM_AGENT_RPS_COUNTDOWN = LLUUID("35db4f7e-28c2-6679-cea9-3ee108f const LLUUID ANIM_AGENT_RPS_PAPER = LLUUID("0836b67f-7f7b-f37b-c00a-460dc1521f5a"); const LLUUID ANIM_AGENT_RPS_ROCK = LLUUID("42dd95d5-0bc6-6392-f650-777304946c0f"); const LLUUID ANIM_AGENT_RPS_SCISSORS = LLUUID("16803a9f-5140-e042-4d7b-d28ba247c325"); +const LLUUID ANIM_AGENT_RUN_NEW = LLUUID("25f649b2-c600-9ae3-a8e7-9eca357a20ce"); const LLUUID ANIM_AGENT_RUN = LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445"); const LLUUID ANIM_AGENT_SAD = LLUUID("0eb702e2-cc5a-9a88-56a5-661a55c0676a"); const LLUUID ANIM_AGENT_SALUTE = LLUUID("cd7668a6-7011-d7e2-ead8-fc69eff1a104"); @@ -165,6 +171,7 @@ const LLUUID ANIM_AGENT_TRYON_SHIRT = LLUUID("83ff59fe-2346-f236-9009-4e3608af const LLUUID ANIM_AGENT_TURNLEFT = LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135"); const LLUUID ANIM_AGENT_TURNRIGHT = LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30"); const LLUUID ANIM_AGENT_TYPE = LLUUID("c541c47f-e0c0-058b-ad1a-d6ae3a4584d9"); +const LLUUID ANIM_AGENT_WALK_NEW = LLUUID("fa1e3197-5e7f-20d1-16d1-f5addc999ce7"); const LLUUID ANIM_AGENT_WALK = LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0"); const LLUUID ANIM_AGENT_WHISPER = LLUUID("7693f268-06c7-ea71-fa21-2b30d6533f8f"); const LLUUID ANIM_AGENT_WHISTLE = LLUUID("b1ed7982-c68e-a982-7561-52a88a5298c0"); diff --git a/indra/llcharacter/llanimationstates.h b/indra/llcharacter/llanimationstates.h index 1a85755a1e..18a19c3eb5 100644 --- a/indra/llcharacter/llanimationstates.h +++ b/indra/llcharacter/llanimationstates.h @@ -101,7 +101,9 @@ extern const LLUUID ANIM_AGENT_EXPRESS_TOOTHSMILE; extern const LLUUID ANIM_AGENT_EXPRESS_WINK; extern const LLUUID ANIM_AGENT_EXPRESS_WORRY; extern const LLUUID ANIM_AGENT_FALLDOWN; +extern const LLUUID ANIM_AGENT_FEMALE_RUN_NEW; extern const LLUUID ANIM_AGENT_FEMALE_WALK; +extern const LLUUID ANIM_AGENT_FEMALE_WALK_NEW; extern const LLUUID ANIM_AGENT_FINGER_WAG; extern const LLUUID ANIM_AGENT_FIST_PUMP; extern const LLUUID ANIM_AGENT_FLY; @@ -141,6 +143,7 @@ extern const LLUUID ANIM_AGENT_RPS_PAPER; extern const LLUUID ANIM_AGENT_RPS_ROCK; extern const LLUUID ANIM_AGENT_RPS_SCISSORS; extern const LLUUID ANIM_AGENT_RUN; +extern const LLUUID ANIM_AGENT_RUN_NEW; extern const LLUUID ANIM_AGENT_SAD; extern const LLUUID ANIM_AGENT_SALUTE; extern const LLUUID ANIM_AGENT_SHOOT_BOW_L; @@ -176,6 +179,7 @@ extern const LLUUID ANIM_AGENT_TURNLEFT; extern const LLUUID ANIM_AGENT_TURNRIGHT; extern const LLUUID ANIM_AGENT_TYPE; extern const LLUUID ANIM_AGENT_WALK; +extern const LLUUID ANIM_AGENT_WALK_NEW; extern const LLUUID ANIM_AGENT_WHISPER; extern const LLUUID ANIM_AGENT_WHISTLE; extern const LLUUID ANIM_AGENT_WINK; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index c9b5631d54..6f08cd7579 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10183,7 +10183,17 @@ <key>Value</key> <real>10.0</real> </map> - + <key>UseNewWalkRun</key> + <map> + <key>Comment</key> + <string>Replace standard walk/run animations with new ones.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>UseStartScreen</key> <map> <key>Comment</key> diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3f021d1f84..05cb914e90 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1225,7 +1225,11 @@ void LLVOAvatar::initInstance(void) registerMotion( ANIM_AGENT_EXPRESS_TOOTHSMILE, LLEmote::create ); registerMotion( ANIM_AGENT_EXPRESS_WINK, LLEmote::create ); registerMotion( ANIM_AGENT_EXPRESS_WORRY, LLEmote::create ); + registerMotion( ANIM_AGENT_FEMALE_RUN_NEW, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_FEMALE_WALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_FEMALE_WALK_NEW, LLKeyframeWalkMotion::create ); registerMotion( ANIM_AGENT_RUN, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_RUN_NEW, LLKeyframeWalkMotion::create ); registerMotion( ANIM_AGENT_STAND, LLKeyframeStandMotion::create ); registerMotion( ANIM_AGENT_STAND_1, LLKeyframeStandMotion::create ); registerMotion( ANIM_AGENT_STAND_2, LLKeyframeStandMotion::create ); @@ -1235,6 +1239,7 @@ void LLVOAvatar::initInstance(void) registerMotion( ANIM_AGENT_TURNLEFT, LLKeyframeWalkMotion::create ); registerMotion( ANIM_AGENT_TURNRIGHT, LLKeyframeWalkMotion::create ); registerMotion( ANIM_AGENT_WALK, LLKeyframeWalkMotion::create ); + registerMotion( ANIM_AGENT_WALK_NEW, LLKeyframeWalkMotion::create ); // motions without a start/stop bit registerMotion( ANIM_AGENT_BODY_NOISE, LLBodyNoiseMotion::create ); @@ -4369,34 +4374,74 @@ void LLVOAvatar::resetAnimations() flushAllMotions(); } -//----------------------------------------------------------------------------- -// startMotion() -// id is the asset if of the animation to start -// time_offset is the offset into the animation at which to start playing -//----------------------------------------------------------------------------- -BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) +// Override selectively based on avatar sex and whether we're using new +// animations. +LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) { - LLMemType mt(LLMemType::MTYPE_AVATAR); - + BOOL use_new_walk_run = gSavedSettings.getBOOL("UseNewWalkRun"); + LLUUID result = id; + // start special case female walk for female avatars if (getSex() == SEX_FEMALE) { if (id == ANIM_AGENT_WALK) { - return LLCharacter::startMotion(ANIM_AGENT_FEMALE_WALK, time_offset); + if (use_new_walk_run) + result = ANIM_AGENT_FEMALE_WALK_NEW; + else + result = ANIM_AGENT_FEMALE_WALK; + } + else if (id == ANIM_AGENT_RUN) + { + // There is no old female run animation, so only override + // in one case. + if (use_new_walk_run) + result = ANIM_AGENT_FEMALE_RUN_NEW; } else if (id == ANIM_AGENT_SIT) { - return LLCharacter::startMotion(ANIM_AGENT_SIT_FEMALE, time_offset); + result = ANIM_AGENT_SIT_FEMALE; } } + else + { + // Male avatar. + if (id == ANIM_AGENT_WALK) + { + if (use_new_walk_run) + result = ANIM_AGENT_WALK_NEW; + } + else if (id == ANIM_AGENT_RUN) + { + if (use_new_walk_run) + result = ANIM_AGENT_RUN_NEW; + } + + } - if (isSelf() && id == ANIM_AGENT_AWAY) + return result; + +} + +//----------------------------------------------------------------------------- +// startMotion() +// id is the asset if of the animation to start +// time_offset is the offset into the animation at which to start playing +//----------------------------------------------------------------------------- +BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) +{ + llinfos << "motion " << id.asString() << llendl; + + LLMemType mt(LLMemType::MTYPE_AVATAR); + + LLUUID remap_id = remapMotionID(id); + + if (isSelf() && remap_id == ANIM_AGENT_AWAY) { gAgent.setAFK(); } - return LLCharacter::startMotion(id, time_offset); + return LLCharacter::startMotion(remap_id, time_offset); } //----------------------------------------------------------------------------- @@ -4404,21 +4449,14 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) //----------------------------------------------------------------------------- BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) { + LLUUID remap_id = remapMotionID(id); + if (isSelf()) { - gAgent.onAnimStop(id); - } - - if (id == ANIM_AGENT_WALK) - { - LLCharacter::stopMotion(ANIM_AGENT_FEMALE_WALK, stop_immediate); - } - else if (id == ANIM_AGENT_SIT) - { - LLCharacter::stopMotion(ANIM_AGENT_SIT_FEMALE, stop_immediate); + gAgent.onAnimStop(remap_id); } - return LLCharacter::stopMotion(id, stop_immediate); + return LLCharacter::stopMotion(remap_id, stop_immediate); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index c80d59966c..f06bb458c5 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -157,6 +157,7 @@ public: virtual LLJoint* getCharacterJoint(U32 num); virtual BOOL allocateCharacterJoints(U32 num); + virtual LLUUID remapMotionID(const LLUUID& id); virtual BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f); virtual BOOL stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE); virtual void stopMotionFromSource(const LLUUID& source_id); |