summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-12-17 16:19:48 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-12-17 16:19:48 -0800
commite7467e8c01ef43ea14a3da9de436e9aa3dd02606 (patch)
tree06ff928a0c1949ed8563178cc11ea108f212be60 /indra/newview
parent09163617c2c5e79d8e51b5ceca5b5282effcb1f6 (diff)
parent138d4f5fcd4567c5d77230b6eadc21c246ceed59 (diff)
Pull and merge from ssh://hg@bitbucket.org/stinson_linden/viewer-chui-stinson-alt.
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llagent.cpp58
-rw-r--r--indra/newview/llflexibleobject.cpp2
-rw-r--r--indra/newview/llhudobject.cpp2
-rw-r--r--indra/newview/llhudobject.h4
-rwxr-xr-xindra/newview/llvoavatar.cpp16
-rw-r--r--indra/newview/llvoicevisualizer.cpp32
-rw-r--r--indra/newview/llvoicevisualizer.h27
7 files changed, 15 insertions, 126 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 22a21ffaeb..49c570c30b 100755
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2541,51 +2541,21 @@ void LLMaturityPreferencesResponder::error(U32 pStatus, const std::string& pReas
U8 LLMaturityPreferencesResponder::parseMaturityFromServerResponse(const LLSD &pContent)
{
- // stinson 05/24/2012 Pathfinding regions have re-defined the response behavior. In the old server code,
- // if you attempted to change the preferred maturity to the same value, the response content would be an
- // undefined LLSD block. In the new server code with pathfinding, the response content should always be
- // defined. Thus, the check for isUndefined() can be replaced with an assert after pathfinding is merged
- // into server trunk and fully deployed.
U8 maturity = SIM_ACCESS_MIN;
- if (pContent.isUndefined())
- {
- maturity = mPreferredMaturity;
- }
- else
- {
- llassert(!pContent.isUndefined());
- llassert(pContent.isMap());
-
- if (!pContent.isUndefined() && pContent.isMap())
- {
- // stinson 05/24/2012 Pathfinding regions have re-defined the response syntax. The if statement catches
- // the new syntax, and the else statement catches the old syntax. After pathfinding is merged into
- // server trunk and fully deployed, we can remove the else statement.
- if (pContent.has("access_prefs"))
- {
- llassert(pContent.has("access_prefs"));
- llassert(pContent.get("access_prefs").isMap());
- llassert(pContent.get("access_prefs").has("max"));
- llassert(pContent.get("access_prefs").get("max").isString());
- if (pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max") &&
- pContent.get("access_prefs").get("max").isString())
- {
- LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
- LLStringUtil::trim(actualPreference);
- maturity = LLViewerRegion::shortStringToAccess(actualPreference);
- }
- }
- else if (pContent.has("max"))
- {
- llassert(pContent.get("max").isString());
- if (pContent.get("max").isString())
- {
- LLSD::String actualPreference = pContent.get("max").asString();
- LLStringUtil::trim(actualPreference);
- maturity = LLViewerRegion::shortStringToAccess(actualPreference);
- }
- }
- }
+
+ llassert(!pContent.isUndefined());
+ llassert(pContent.isMap());
+ llassert(pContent.has("access_prefs"));
+ llassert(pContent.get("access_prefs").isMap());
+ llassert(pContent.get("access_prefs").has("max"));
+ llassert(pContent.get("access_prefs").get("max").isString());
+ if (!pContent.isUndefined() && pContent.isMap() && pContent.has("access_prefs")
+ && pContent.get("access_prefs").isMap() && pContent.get("access_prefs").has("max")
+ && pContent.get("access_prefs").get("max").isString())
+ {
+ LLSD::String actualPreference = pContent.get("access_prefs").get("max").asString();
+ LLStringUtil::trim(actualPreference);
+ maturity = LLViewerRegion::shortStringToAccess(actualPreference);
}
return maturity;
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index aae0990e4b..c2b9c77307 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -444,7 +444,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
return ;
}
- // stinson 11/12/2012: Need to check with davep on the following.
+ // Fix for MAINT-1894
// Skipping the flexible update if render res is negative. If we were to continue with a negative value,
// the subsequent S32 num_render_sections = 1<<mRenderRes; code will specify a really large number of
// render sections which will then create a length exception in the std::vector::resize() method.
diff --git a/indra/newview/llhudobject.cpp b/indra/newview/llhudobject.cpp
index 0960846510..95d57d08d8 100644
--- a/indra/newview/llhudobject.cpp
+++ b/indra/newview/llhudobject.cpp
@@ -232,11 +232,9 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
case LL_HUD_EFFECT_LOOKAT:
hud_objectp = new LLHUDEffectLookAt(type);
break;
-#ifdef XXX_STINSON_CHUI_REWORK
case LL_HUD_EFFECT_VOICE_VISUALIZER:
hud_objectp = new LLVoiceVisualizer(type);
break;
-#endif // XXX_STINSON_CHUI_REWORK
case LL_HUD_EFFECT_POINTAT:
hud_objectp = new LLHUDEffectPointAt(type);
break;
diff --git a/indra/newview/llhudobject.h b/indra/newview/llhudobject.h
index 32cffe6839..2f7a98c86c 100644
--- a/indra/newview/llhudobject.h
+++ b/indra/newview/llhudobject.h
@@ -39,8 +39,6 @@
#include "lldrawpool.h" // TODO: eliminate, unused below
#include <list>
-#define XXX_STINSON_CHUI_REWORK // temporarily re-enabling the in-world voice-dot
-
class LLViewerCamera;
class LLFontGL;
class LLFace;
@@ -96,9 +94,7 @@ public:
LL_HUD_EFFECT_EDIT,
LL_HUD_EFFECT_LOOKAT,
LL_HUD_EFFECT_POINTAT,
-#ifdef XXX_STINSON_CHUI_REWORK
LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella
-#endif // XXX_STINSON_CHUI_REWORK
LL_HUD_NAME_TAG,
LL_HUD_EFFECT_BLOB
};
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 7cc4e3ed04..19c7eda717 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -34,8 +34,6 @@
#include "llvoavatar.h"
-#define XXX_STINSON_CHUI_REWORK // temporarily re-enabling the in-world voice-dot
-
#include <stdio.h>
#include <ctype.h>
@@ -711,13 +709,9 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
LLMemType mt(LLMemType::MTYPE_AVATAR);
//VTResume(); // VTune
-#ifdef XXX_STINSON_CHUI_REWORK
// mVoiceVisualizer is created by the hud effects manager and uses the HUD Effects pipeline
const BOOL needsSendToSim = false; // currently, this HUD effect doesn't need to pack and unpack data to do its job
mVoiceVisualizer = ( LLVoiceVisualizer *)LLHUDManager::getInstance()->createViewerEffect( LLHUDObject::LL_HUD_EFFECT_VOICE_VISUALIZER, needsSendToSim );
-#else // XXX_STINSON_CHUI_REWORK
- mVoiceVisualizer = new LLVoiceVisualizer();
-#endif // XXX_STINSON_CHUI_REWORK
lldebugs << "LLVOAvatar Constructor (0x" << this << ") id:" << mID << llendl;
@@ -893,11 +887,7 @@ void LLVOAvatar::markDead()
mNameText = NULL;
sNumVisibleChatBubbles--;
}
-#ifdef XXX_STINSON_CHUI_REWORK
mVoiceVisualizer->markDead();
-#else // XXX_STINSON_CHUI_REWORK
- mVoiceVisualizer->setStopSpeaking();
-#endif // XXX_STINSON_CHUI_REWORK
LLLoadedCallbackEntry::cleanUpCallbackList(&mCallbackTextureList) ;
LLViewerObject::markDead();
}
@@ -1429,9 +1419,7 @@ void LLVOAvatar::initInstance(void)
//VTPause(); // VTune
-#ifdef XXX_STINSON_CHUI_REWORK
mVoiceVisualizer->setVoiceEnabled( LLVoiceClient::getInstance()->getVoiceEnabled( mID ) );
-#endif // XXX_STINSON_CHUI_REWORK
}
@@ -2529,7 +2517,6 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
{
-#ifdef XXX_STINSON_CHUI_REWORK
bool render_visualizer = voice_enabled;
// Don't render the user's own voice visualizer when in mouselook, or when opening the mic is disabled.
@@ -2542,7 +2529,6 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
}
mVoiceVisualizer->setVoiceEnabled(render_visualizer);
-#endif // XXX_STINSON_CHUI_REWORK
if ( voice_enabled )
{
@@ -2618,7 +2604,6 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
}
}
-#ifdef XXX_STINSON_CHUI_REWORK
//--------------------------------------------------------------------------------------------
// here we get the approximate head position and set as sound source for the voice symbol
// (the following version uses a tweak of "mHeadOffset" which handle sitting vs. standing)
@@ -2636,7 +2621,6 @@ void LLVOAvatar::idleUpdateVoiceVisualizer(bool voice_enabled)
tagPos[VZ] += ( mBodySize[VZ] + 0.125f );
mVoiceVisualizer->setVoiceSourceWorldPosition( tagPos );
}
-#endif // XXX_STINSON_CHUI_REWORK
}//if ( voiceEnabled )
}
diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp
index d380a8672f..b497f80560 100644
--- a/indra/newview/llvoicevisualizer.cpp
+++ b/indra/newview/llvoicevisualizer.cpp
@@ -45,7 +45,6 @@
//29de489d-0491-fb00-7dab-f9e686d31e83
-#ifdef XXX_STINSON_CHUI_REWORK
//--------------------------------------------------------------------------------------
// sound symbol constants
//--------------------------------------------------------------------------------------
@@ -61,7 +60,6 @@ const F32 BASE_BRIGHTNESS = 0.7f; // gray level of the voice indicator when qu
const F32 DOT_SIZE = 0.05f; // size of the dot billboard texture
const F32 DOT_OPACITY = 0.7f; // how opaque the dot is
const F32 WAVE_MOTION_RATE = 1.5f; // scalar applied to consecutive waves as a function of speaking amplitude
-#endif // XXX_STINSON_CHUI_REWORK
//--------------------------------------------------------------------------------------
// gesticulation constants
@@ -69,13 +67,11 @@ const F32 WAVE_MOTION_RATE = 1.5f; // scalar applied to consecutive waves as a
const F32 DEFAULT_MINIMUM_GESTICULATION_AMPLITUDE = 0.2f;
const F32 DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE = 1.0f;
-#ifdef XXX_STINSON_CHUI_REWORK
//--------------------------------------------------------------------------------------
// other constants
//--------------------------------------------------------------------------------------
const F32 ONE_HALF = 1.0f; // to clarify intent and reduce magic numbers in the code.
const LLVector3 WORLD_UPWARD_DIRECTION = LLVector3( 0.0f, 0.0f, 1.0f ); // Z is up in SL
-#endif // XXX_STINSON_CHUI_REWORK
//------------------------------------------------------------------
// Initialize the statics
@@ -98,28 +94,12 @@ F32 LLVoiceVisualizer::sAahPowerTransfersf = 0.0f;
//-----------------------------------------------
// constructor
//-----------------------------------------------
-#ifdef XXX_STINSON_CHUI_REWORK
LLVoiceVisualizer::LLVoiceVisualizer( const U8 type )
: LLHUDEffect(type)
-#else // XXX_STINSON_CHUI_REWORK
-LLVoiceVisualizer::LLVoiceVisualizer()
- : LLRefCount(),
- mTimer(),
- mStartTime(0.0),
- mCurrentlySpeaking(false),
- mSpeakingAmplitude(0.0f),
- mMaxGesticulationAmplitude(DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE),
- mMinGesticulationAmplitude(DEFAULT_MINIMUM_GESTICULATION_AMPLITUDE)
-#endif // XXX_STINSON_CHUI_REWORK
{
-#ifdef XXX_STINSON_CHUI_REWORK
mCurrentTime = mTimer.getTotalSeconds();
mPreviousTime = mCurrentTime;
mStartTime = mCurrentTime;
-#else // XXX_STINSON_CHUI_REWORK
- mStartTime = mTimer.getTotalSeconds();
-#endif // XXX_STINSON_CHUI_REWORK
-#ifdef XXX_STINSON_CHUI_REWORK
mVoiceSourceWorldPosition = LLVector3( 0.0f, 0.0f, 0.0f );
mSpeakingAmplitude = 0.0f;
mCurrentlySpeaking = false;
@@ -128,11 +108,9 @@ LLVoiceVisualizer::LLVoiceVisualizer()
mMaxGesticulationAmplitude = DEFAULT_MAXIMUM_GESTICULATION_AMPLITUDE;
mSoundSymbol.mActive = true;
mSoundSymbol.mPosition = LLVector3( 0.0f, 0.0f, 0.0f );
-#endif // XXX_STINSON_CHUI_REWORK
mTimer.reset();
-#ifdef XXX_STINSON_CHUI_REWORK
const char* sound_level_img[] =
{
"voice_meter_dot.j2c",
@@ -154,7 +132,6 @@ LLVoiceVisualizer::LLVoiceVisualizer()
}
mSoundSymbol.mTexture[0]->setFilteringOption(LLTexUnit::TFO_ANISOTROPIC);
-#endif // XXX_STINSON_CHUI_REWORK
// The first instance loads the initial state from prefs.
if (!sPrefsInitialized)
@@ -174,7 +151,6 @@ LLVoiceVisualizer::LLVoiceVisualizer()
}//---------------------------------------------------
-#ifdef XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
void LLVoiceVisualizer::setMinGesticulationAmplitude( F32 m )
{
@@ -195,16 +171,13 @@ void LLVoiceVisualizer::setVoiceEnabled( bool v )
mVoiceEnabled = v;
}//---------------------------------------------------
-#endif // XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
void LLVoiceVisualizer::setStartSpeaking()
{
mStartTime = mTimer.getTotalSeconds();
mCurrentlySpeaking = true;
-#ifdef XXX_STINSON_CHUI_REWORK
mSoundSymbol.mActive = true;
-#endif // XXX_STINSON_CHUI_REWORK
}//---------------------------------------------------
@@ -359,7 +332,6 @@ void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah )
}//---------------------------------------------------
-#ifdef XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
// this method is inherited from HUD Effect
//---------------------------------------------------
@@ -558,7 +530,6 @@ void LLVoiceVisualizer::setVoiceSourceWorldPosition( const LLVector3 &p )
mVoiceSourceWorldPosition = p;
}//---------------------------------------------------
-#endif // XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
VoiceGesticulationLevel LLVoiceVisualizer::getCurrentGesticulationLevel()
@@ -589,7 +560,6 @@ LLVoiceVisualizer::~LLVoiceVisualizer()
}//----------------------------------------------
-#ifdef XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
// "packData" is inherited from HUDEffect
//---------------------------------------------------
@@ -639,5 +609,3 @@ void LLVoiceVisualizer::markDead()
LLHUDEffect::markDead();
}//------------------------------------------------------------------
-
-#endif // XXX_STINSON_CHUI_REWORK
diff --git a/indra/newview/llvoicevisualizer.h b/indra/newview/llvoicevisualizer.h
index 5da592c48e..36c78252d1 100644
--- a/indra/newview/llvoicevisualizer.h
+++ b/indra/newview/llvoicevisualizer.h
@@ -42,12 +42,7 @@
#ifndef LL_VOICE_VISUALIZER_H
#define LL_VOICE_VISUALIZER_H
-#define XXX_STINSON_CHUI_REWORK // temporarily re-enabling the in-world voice-dot
-#ifdef XXX_STINSON_CHUI_REWORK
#include "llhudeffect.h"
-#else // XXX_STINSON_CHUI_REWORK
-#include "llpointer.h"
-#endif // XXX_STINSON_CHUI_REWORK
//-----------------------------------------------------------------------------------------------
// The values of voice gesticulation represent energy levels for avatar animation, based on
@@ -65,45 +60,30 @@ enum VoiceGesticulationLevel
NUM_VOICE_GESTICULATION_LEVELS
};
-#ifdef XXX_STINSON_CHUI_REWORK
const static int NUM_VOICE_SYMBOL_WAVES = 7;
-#endif // XXX_STINSON_CHUI_REWORK
//----------------------------------------------------
// LLVoiceVisualizer class
//----------------------------------------------------
-#ifdef XXX_STINSON_CHUI_REWORK
class LLVoiceVisualizer : public LLHUDEffect
-#else // XXX_STINSON_CHUI_REWORK
-class LLVoiceVisualizer : public LLRefCount
-#endif // XXX_STINSON_CHUI_REWORK
{
//---------------------------------------------------
// public methods
//---------------------------------------------------
public:
-#ifdef XXX_STINSON_CHUI_REWORK
LLVoiceVisualizer( const U8 type ); //constructor
-#else // XXX_STINSON_CHUI_REWORK
- LLVoiceVisualizer(); //constructor
-#endif // XXX_STINSON_CHUI_REWORK
~LLVoiceVisualizer(); //destructor
-#ifdef XXX_STINSON_CHUI_REWORK
void setVoiceSourceWorldPosition( const LLVector3 &p ); // this should be the position of the speaking avatar's head
void setMinGesticulationAmplitude( F32 ); // the lower range of meaningful amplitude for setting gesticulation level
void setMaxGesticulationAmplitude( F32 ); // the upper range of meaningful amplitude for setting gesticulation level
-#endif // XXX_STINSON_CHUI_REWORK
void setStartSpeaking(); // tell me when the av starts speaking
-#ifdef XXX_STINSON_CHUI_REWORK
void setVoiceEnabled( bool ); // tell me whether or not the user is voice enabled
-#endif // XXX_STINSON_CHUI_REWORK
void setSpeakingAmplitude( F32 ); // tell me how loud the av is speaking (ranges from 0 to 1)
void setStopSpeaking(); // tell me when the av stops speaking
bool getCurrentlySpeaking(); // the get for the above set
VoiceGesticulationLevel getCurrentGesticulationLevel(); // based on voice amplitude, I'll give you the current "energy level" of avatar speech
void lipSyncOohAah( F32& ooh, F32& aah );
-#ifdef XXX_STINSON_CHUI_REWORK
void render(); // inherited from HUD Effect
void packData(LLMessageSystem *mesgsys); // inherited from HUD Effect
void unpackData(LLMessageSystem *mesgsys, S32 blocknum); // inherited from HUD Effect
@@ -119,7 +99,6 @@ class LLVoiceVisualizer : public LLRefCount
//----------------------------------------------------------------------------------------------
void setMaxGesticulationAmplitude();
void setMinGesticulationAmplitude();
-#endif // XXX_STINSON_CHUI_REWORK
//---------------------------------------------------
// private members
@@ -129,7 +108,6 @@ class LLVoiceVisualizer : public LLRefCount
static void setPreferences( );
static void lipStringToF32s ( std::string& in_string, F32*& out_F32s, U32& count_F32s ); // convert a string of digits to an array of floats
-#ifdef XXX_STINSON_CHUI_REWORK
struct SoundSymbol
{
F32 mWaveExpansion [ NUM_VOICE_SYMBOL_WAVES ];
@@ -140,20 +118,15 @@ class LLVoiceVisualizer : public LLRefCount
bool mActive;
LLVector3 mPosition;
};
-#endif // XXX_STINSON_CHUI_REWORK
LLFrameTimer mTimer; // so I can ask the current time in seconds
F64 mStartTime; // time in seconds when speaking started
-#ifdef XXX_STINSON_CHUI_REWORK
F64 mCurrentTime; // current time in seconds, captured every step
F64 mPreviousTime; // copy of "current time" from last frame
SoundSymbol mSoundSymbol; // the sound symbol that appears over the avatar's head
bool mVoiceEnabled; // if off, no rendering should happen
-#endif // XXX_STINSON_CHUI_REWORK
bool mCurrentlySpeaking; // is the user currently speaking?
-#ifdef XXX_STINSON_CHUI_REWORK
LLVector3 mVoiceSourceWorldPosition; // give this to me every step - I need it to update the sound symbol
-#endif // XXX_STINSON_CHUI_REWORK
F32 mSpeakingAmplitude; // this should be set as often as possible when the user is speaking
F32 mMaxGesticulationAmplitude; // this is the upper-limit of the envelope of detectable gesticulation leves
F32 mMinGesticulationAmplitude; // this is the lower-limit of the envelope of detectable gesticulation leves