diff options
41 files changed, 539 insertions, 111 deletions
diff --git a/doc/contributions.txt b/doc/contributions.txt index 0c360e7f84..ca5c11bc48 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -85,6 +85,7 @@ Eddy Stryker  	VWR-15  	VWR-23  	VWR-1468 +	VWR-1475  EponymousDylan Ra  	VWR-1289  	VWR-1465 @@ -156,12 +157,14 @@ march Korda  	SVC-1020  Matthew Dowd  	VWR-1344 +	VWR-1651  	VWR-1736  	VWR-1737  	VWR-1761  McCabe Maxsted  	VWR-1318  Michelle2 Zenovka +	VWR-2652  	VWR-2834  Mr Greggan  	VWR-445 @@ -255,9 +258,11 @@ Renault Clio  Ryozu Kojima  	VWR-287  Seg Baphomet +	VWR-1475  	VWR-1525  	VWR-1585  	VWR-1586 +	VWR-3206  SignpostMarv Martin  	VWR-153  	VWR-154 @@ -319,3 +324,5 @@ Zi Ree  Zipherius Turas  	VWR-76  	VWR-77 +Kerutsen Sellery +        VWR-1350 diff --git a/indra/lib/python/indra/base/metrics.py b/indra/lib/python/indra/base/metrics.py new file mode 100644 index 0000000000..751757d5b0 --- /dev/null +++ b/indra/lib/python/indra/base/metrics.py @@ -0,0 +1,42 @@ +"""\ +@file metrics.py +@author Phoenix +@date 2007-11-27 +@brief simple interface for logging metrics + +$LicenseInfo:firstyear=2007&license=mit$ + +Copyright (c) 2007, Linden Research, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +$/LicenseInfo$ +""" + +import sys +from indra.base import llsd + +def log(location, stats, file=None): +    "Write a standard llmetrics log" +    metrics = {'location':location, 'stats':stats} +    if file is None: +        # do this check here in case sys.stdout changes at some +        # point. as a default parameter, it will never be +        # re-evaluated. +        file = sys.stdout +    print >>file, "LLMETRICS:", llsd.format_notation(metrics) diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h index 708f23f3b1..6ed1f26599 100644 --- a/indra/llcommon/llkeythrottle.h +++ b/indra/llcommon/llkeythrottle.h @@ -21,11 +21,16 @@  #include <map> +// forward declaration so LLKeyThrottleImpl can befriend it +template <class T> class LLKeyThrottle; + +  // Implementation utility class - use LLKeyThrottle, not this  template <class T>  class LLKeyThrottleImpl  { -public: +	friend class LLKeyThrottle<T>; +protected:  	struct Entry {  		U32		count;  		BOOL	blocked; @@ -47,7 +52,9 @@ public:  		// currMap started counting at this time  		// prevMap covers the previous interval -	LLKeyThrottleImpl() : prevMap(0), currMap(0) { } +	LLKeyThrottleImpl() : prevMap(0), currMap(0), +			      countLimit(0), interval_usec(0), +			      start_usec(0) { };  	static U64 getTime()  	{ diff --git a/indra/llcommon/llsecondlifeurls.cpp b/indra/llcommon/llsecondlifeurls.cpp index 4417b09723..bf09453c16 100644 --- a/indra/llcommon/llsecondlifeurls.cpp +++ b/indra/llcommon/llsecondlifeurls.cpp @@ -62,6 +62,9 @@ const char AMD_AGP_URL[] =  const char VIA_URL[] =   	"http://secondlife.com/support/"; +const char SUPPORT_URL[] =  +    "http://secondlife.com/support/"; +  const char INTEL_CHIPSET_URL[] =   	"http://secondlife.com/support/"; diff --git a/indra/llcommon/llsecondlifeurls.h b/indra/llcommon/llsecondlifeurls.h index 0eb3d647cb..b8d8aa2402 100644 --- a/indra/llcommon/llsecondlifeurls.h +++ b/indra/llcommon/llsecondlifeurls.h @@ -57,6 +57,9 @@ extern const char DIRECTX_9_URL[];  // Out of date VIA chipset  extern const char VIA_URL[]; +// Support URL +extern const char SUPPORT_URL[]; +  // Linden Blogs page  extern const char BLOGS_URL[]; diff --git a/indra/llcommon/lluri.cpp b/indra/llcommon/lluri.cpp index deeee3173d..0f6ddd9bc6 100644 --- a/indra/llcommon/lluri.cpp +++ b/indra/llcommon/lluri.cpp @@ -43,28 +43,68 @@  // system includes  #include <boost/tokenizer.hpp> +void encode_character(std::ostream& ostr, std::string::value_type val) +{ +	ostr << "%" << std::uppercase << std::hex << std::setw(2) << std::setfill('0')  +	     // VWR-4010 Cannot cast to U32 because sign-extension on  +	     // chars > 128 will result in FFFFFFC3 instead of F3. +	     << static_cast<S32>(static_cast<U8>(c)); +} +  // static -std::string LLURI::escape(const std::string& str, const std::string & allowed) +std::string LLURI::escape( +	const std::string& str, +	const std::string& allowed, +	bool is_allowed_sorted)  { -	std::ostringstream ostr; +	// *NOTE: This size determination feels like a good value to +	// me. If someone wante to come up with a more precise heuristic +	// with some data to back up the assertion that 'sort is good' +	// then feel free to change this test a bit. +	if(!is_allowed_sorted && (str.size() > 2 * allowed.size())) +	{ +		// if it's already sorted, or if the url is quite long, we +		// want to optimize this process. +		std::string sorted_allowed(allowed); +		std::sort(sorted_allowed.begin(), sorted_allowed.end()); +		return escape(str, sorted_allowed, true); +	} +	std::ostringstream ostr;  	std::string::const_iterator it = str.begin();  	std::string::const_iterator end = str.end(); -	for(; it != end; ++it) +	std::string::value_type c; +	if(is_allowed_sorted)  	{ -		std::string::value_type c = *it; -		if(allowed.find(c) == std::string::npos) -		  { -		    ostr << "%" -			 << std::uppercase << std::hex << std::setw(2) << std::setfill('0') -			 // VWR-4010 Cannot cast to U32 because sign-extension on  -			 // chars > 128 will result in FFFFFFC3 instead of F3. -			 << static_cast<S32>(static_cast<U8>(c)); -		  } -		else -		  { -		    ostr << c; -		  } +		std::string::const_iterator allowed_begin(allowed.begin()); +		std::string::const_iterator allowed_end(allowed.end()); +		for(; it != end; ++it) +		{ +			c = *it; +			if(std::binary_search(allowed_begin, allowed_end, c)) +			{ +				ostr << c; +			} +			else +			{ +				encode_character(ostr, c); +			} +		} +	} +	else +	{ +		for(; it != end; ++it) +		{ +			c = *it; +			if(allowed.find(c) == std::string::npos) +			{ +				encode_character(ostr, c); +			} +			else +			{ +				ostr << c; +			} +		}  	}  	return ostr.str();  } @@ -121,11 +161,18 @@ namespace  		{ return LLURI::escape(s, unreserved() + ":@!$'()*+,="); }	// sub_delims - "&;" + ":@"  } -// TODO: USE CURL!! After http textures gets merged everywhere. +// *TODO: Consider using curl. After http textures gets merged everywhere.  // static  std::string LLURI::escape(const std::string& str)  { -	return escape(str,unreserved()  + ":@!$'()*+,="); +	static std::string default_allowed(unreserved() + ":@!$'()*+,=/?&#;"); +	static bool initialized = false; +	if(!initialized) +	{ +		std::sort(default_allowed.begin(), default_allowed.end()); +		initialized = true; +	} +	return escape(str, default_allowed, true);  }  LLURI::LLURI() diff --git a/indra/llcommon/lluri.h b/indra/llcommon/lluri.h index bfe673c2f7..953e652704 100644 --- a/indra/llcommon/lluri.h +++ b/indra/llcommon/lluri.h @@ -125,12 +125,52 @@ public:  	/** @name Escaping Utilities */  	//@{ -	// Escape a string by urlencoding all the characters that aren't -	// in the allowed string. +	/** +	 * @brief Escape a raw url with a reasonable set of allowed characters. +	 * +	 * The default set was chosen to match HTTP urls and general +     *  guidelines for naming resources. Passing in a raw url does not +     *  produce well defined results because you really need to know +     *  which segments are path parts because path parts are supposed +     *  to be escaped individually. The default set chosen is: +	 * +	 *  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +	 *  0123456789 +	 *  -._~ +	 *  :@!$'()*+,=/?&#; +	 * +	 * *NOTE: This API is basically broken because it does not +     *  allow you to specify significant path characters. For example, +     *  if the filename actually contained a /, then you cannot use +     *  this function to generate the serialized url for that +     *  resource. +	 * +	 * @param str The raw URI to escape. +	 * @return Returns the escaped uri or an empty string. +	 */  	static std::string escape(const std::string& str); + +	/** +	 * @brief Escape a string with a specified set of allowed characters. +	 * +	 * Escape a string by urlencoding all the characters that aren't +	 * in the allowed string. +	 * @param str The raw URI to escape. +	 * @param allowed Character array of allowed characters +	 * @param is_allowed_sorted Optimization hint if allowed array is sorted. +	 * @return Returns the escaped uri or an empty string. +	 */  	static std::string escape(  		const std::string& str, -		const std::string & allowed);  +		const std::string& allowed, +		bool is_allowed_sorted = false); + +	/** +	 * @brief unescape an escaped URI string. +	 * +	 * @param str The escped URI to unescape. +	 * @return Returns the unescaped uri or an empty string. +	 */  	static std::string unescape(const std::string& str);  	//@} diff --git a/indra/llcommon/u64.cpp b/indra/llcommon/u64.cpp index f2efef1c01..f3422770ae 100644 --- a/indra/llcommon/u64.cpp +++ b/indra/llcommon/u64.cpp @@ -107,8 +107,8 @@ F64 U64_to_F64(const U64 value)  U64	llstrtou64(const char* str, char** end, S32 base)  {  #ifdef LL_WINDOWS -				return _strtoui64(str,end,base); +	return _strtoui64(str,end,base);  #else -				return strtoull(str,end,base); +	return strtoull(str,end,base);  #endif  } diff --git a/indra/llcommon/u64.h b/indra/llcommon/u64.h index ad93ebffe7..f4580513bc 100644 --- a/indra/llcommon/u64.h +++ b/indra/llcommon/u64.h @@ -32,11 +32,41 @@  #ifndef LL_U64_H  #define LL_U64_H +/** + * @brief Forgivingly parse a null terminated character array. + * + * @param str The string to parse. + * @return Returns the first U64 value found in the string or 0 on failure. + */  U64 str_to_U64(const char* str); + +/** + * @brief Given a U64 value, return a printable representation. + * + * The client of this function is expected to provide an allocated + * buffer. The function then snprintf() into that buffer, so providing + * NULL has undefined behavior. Providing a buffer which is too small + * will truncate the printable value, so usually you want to declare + * the buffer: + * + *  char result[U64_BUF]; + *  std::cout << "value: " << U64_to_str(value, result, U64_BUF); + * + * @param value The U64 to turn into a printable character array. + * @param result The buffer to use + * @param result_size The size of the buffer allocated. Use U64_BUF. + * @return Returns the result pointer. + */  char* U64_to_str(U64 value, char* result, S32 result_size); +/** + * @brief Convert a U64 to the closest F64 value. + */  F64 U64_to_F64(const U64 value); +/** + * @brief Helper function to wrap strtoull() which is not available on windows. + */  U64 llstrtou64(const char* str, char** end, S32 base);  #endif diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 7a323c8354..d7be118875 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -40,8 +40,10 @@  const char* fallbackEngineInfoLLImageJ2CImpl()  { -	return (std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ") -		+ opj_version()).c_str(); +	static std::string version_string = +		std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ") +		+ opj_version(); +	return version_string.c_str();  }  LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl() @@ -183,15 +185,25 @@ BOOL LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod  	for (S32 comp = first_channel, dest=0; comp < first_channel + channels;  		comp++, dest++)  	{ -		S32 offset = dest; -		for (S32 y = (height - 1); y >= 0; y--) +		if (image->comps[comp].data)  		{ -			for (S32 x = 0; x < width; x++) +			S32 offset = dest; +			for (S32 y = (height - 1); y >= 0; y--)  			{ -				rawp[offset] = image->comps[comp].data[y*comp_width + x]; -				offset += channels; +				for (S32 x = 0; x < width; x++) +				{ +					rawp[offset] = image->comps[comp].data[y*comp_width + x]; +					offset += channels; +				}  			}  		} +		else // Some rare OpenJPEG versions have this bug. +		{ +			fprintf(stderr, "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)\n"); +			opj_image_destroy(image); + +			return TRUE; // done +		}  	}  	/* free image data structure */ @@ -219,10 +231,29 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con  	/* set encoding parameters to default values */  	opj_set_default_encoder_parameters(¶meters); -	parameters.tcp_rates[0] = 0; -	parameters.tcp_numlayers++; -	parameters.cp_disto_alloc = 1;  	parameters.cod_format = 0; +	parameters.cp_disto_alloc = 1; + +	if (reversible) +	{ +		parameters.tcp_numlayers = 1; +		parameters.tcp_rates[0] = 0.0f; +	} +	else +	{ +		parameters.tcp_numlayers = 5; +                parameters.tcp_rates[0] = 1920.0f; +                parameters.tcp_rates[1] = 480.0f; +                parameters.tcp_rates[2] = 120.0f; +                parameters.tcp_rates[3] = 30.0f; +		parameters.tcp_rates[4] = 10.0f; +		parameters.irreversible = 1; +		if (raw_image.getComponents() >= 3) +		{ +			parameters.tcp_mct = 1; +		} +	} +  	if (!comment_text)  	{  		parameters.cp_comment = ""; @@ -298,7 +329,7 @@ BOOL LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con  	cio = opj_cio_open((opj_common_ptr)cinfo, NULL, 0);  	/* encode the image */ -	bool bSuccess = opj_encode(cinfo, cio, image, parameters.index); +	bool bSuccess = opj_encode(cinfo, cio, image, NULL);  	if (!bSuccess)  	{  		opj_cio_close(cio); diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 5efb8bed06..85d8f4b5c2 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -233,7 +233,7 @@ LLColor3 LLKeywords::readColor( const LLString& s )  // Walk through a string, applying the rules specified by the keyword token list and  // create a list of color segments. -void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWString& wtext) +void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWString& wtext, const LLColor4 &defaultColor)  {  	std::for_each(seg_list->begin(), seg_list->end(), DeletePointer());  	seg_list->clear(); @@ -245,7 +245,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS  	S32 text_len = wtext.size(); -	seg_list->push_back( new LLTextSegment( LLColor3(0,0,0), 0, text_len ) ); +	seg_list->push_back( new LLTextSegment( LLColor3(defaultColor), 0, text_len ) );   	const llwchar* base = wtext.c_str();  	const llwchar* cur = base; @@ -299,7 +299,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS  						//llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start) << "]" << llendl;  						LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );  						text_segment->setToken( cur_token ); -						insertSegment( seg_list, text_segment, text_len); +						insertSegment( seg_list, text_segment, text_len, defaultColor);  						line_done = TRUE; // to break out of second loop.  						break;  					} @@ -409,7 +409,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS  					//llinfos << "Seg: [" << (char*)LLString( base, seg_start, seg_end-seg_start ) << "]" << llendl;  					LLTextSegment* text_segment = new LLTextSegment( cur_delimiter->getColor(), seg_start, seg_end );  					text_segment->setToken( cur_delimiter ); -					insertSegment( seg_list, text_segment, text_len); +					insertSegment( seg_list, text_segment, text_len, defaultColor);  					// Note: we don't increment cur, since the end of one delimited seg may be immediately  					// followed by the start of another one. @@ -442,7 +442,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS  						LLTextSegment* text_segment = new LLTextSegment( cur_token->getColor(), seg_start, seg_end );  						text_segment->setToken( cur_token ); -						insertSegment( seg_list, text_segment, text_len); +						insertSegment( seg_list, text_segment, text_len, defaultColor);  					}  					cur += seg_len;   					continue; @@ -457,7 +457,7 @@ void LLKeywords::findSegments(std::vector<LLTextSegment *>* seg_list, const LLWS  	}  } -void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegment* new_segment, S32 text_len ) +void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor )  {  	LLTextSegment* last = seg_list->back();  	S32 new_seg_end = new_segment->getEnd(); @@ -475,7 +475,7 @@ void LLKeywords::insertSegment(std::vector<LLTextSegment*>* seg_list, LLTextSegm  	if( new_seg_end < text_len )  	{ -		seg_list->push_back( new LLTextSegment( LLColor3(0,0,0), new_seg_end, text_len ) ); +		seg_list->push_back( new LLTextSegment( defaultColor, new_seg_end, text_len ) );  	}  } diff --git a/indra/llui/llkeywords.h b/indra/llui/llkeywords.h index 4309f16cae..d279d2e627 100644 --- a/indra/llui/llkeywords.h +++ b/indra/llui/llkeywords.h @@ -84,7 +84,7 @@ public:  	BOOL		loadFromFile(const LLString& filename);  	BOOL		isLoaded()	{ return mLoaded; } -	void		findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text ); +	void		findSegments(std::vector<LLTextSegment *> *seg_list, const LLWString& text, const LLColor4 &defaultColor );  #ifdef _DEBUG  	void		dump(); @@ -98,7 +98,7 @@ public:  private:  	LLColor3	readColor(const LLString& s); -	void		insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len); +	void		insertSegment(std::vector<LLTextSegment *> *seg_list, LLTextSegment* new_segment, S32 text_len, const LLColor4 &defaultColor);  private:  	BOOL						 mLoaded; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 8b9353eb8e..7cd164ec14 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -302,6 +302,7 @@ LLTextEditor::LLTextEditor(  	mOnScrollEndData( NULL ),  	mCursorColor(		LLUI::sColorsGroup->getColor( "TextCursorColor" ) ),  	mFgColor(			LLUI::sColorsGroup->getColor( "TextFgColor" ) ), +	mDefaultColor(		LLUI::sColorsGroup->getColor( "TextDefaultColor" ) ),  	mReadOnlyFgColor(	LLUI::sColorsGroup->getColor( "TextFgReadOnlyColor" ) ),  	mWriteableBgColor(	LLUI::sColorsGroup->getColor( "TextBgWriteableColor" ) ),  	mReadOnlyBgColor(	LLUI::sColorsGroup->getColor( "TextBgReadOnlyColor" ) ), @@ -3799,7 +3800,7 @@ void LLTextEditor::loadKeywords(const LLString& filename,  			mKeywords.addToken(LLKeywordToken::WORD, name.c_str(), color, tooltips.get(i) );  		} -		mKeywords.findSegments( &mSegments, mWText ); +		mKeywords.findSegments( &mSegments, mWText, mDefaultColor );  		llassert( mSegments.front()->getStart() == 0 );  		llassert( mSegments.back()->getEnd() == getLength() ); @@ -3811,7 +3812,7 @@ void LLTextEditor::updateSegments()  	if (mKeywords.isLoaded())  	{  		// HACK:  No non-ascii keywords for now -		mKeywords.findSegments(&mSegments, mWText); +		mKeywords.findSegments(&mSegments, mWText, mDefaultColor);  	}  	else if (mAllowEmbeddedItems)  	{ @@ -4192,6 +4193,7 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const  	addColorXML(node, mCursorColor, "cursor_color", "TextCursorColor");  	addColorXML(node, mFgColor, "text_color", "TextFgColor"); +	addColorXML(node, mDefaultColor, "text_default_color", "TextDefaultColor");  	addColorXML(node, mReadOnlyFgColor, "text_readonly_color", "TextFgReadOnlyColor");  	addColorXML(node, mReadOnlyBgColor, "bg_readonly_color", "TextBgReadOnlyColor");  	addColorXML(node, mWriteableBgColor, "bg_writeable_color", "TextBgWriteableColor"); diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index a2ce0d2c47..838154655c 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -187,6 +187,7 @@ public:  	void 			setCursorColor(const LLColor4& c)			{ mCursorColor = c; }  	void 			setFgColor( const LLColor4& c )				{ mFgColor = c; } +	void			setTextDefaultColor( const LLColor4& c )				{ mDefaultColor = c; }  	void 			setReadOnlyFgColor( const LLColor4& c )		{ mReadOnlyFgColor = c; }  	void 			setWriteableBgColor( const LLColor4& c )	{ mWriteableBgColor = c; }  	void 			setReadOnlyBgColor( const LLColor4& c )		{ mReadOnlyBgColor = c; } @@ -429,6 +430,7 @@ protected:  	LLColor4		mCursorColor;  	LLColor4		mFgColor; +	LLColor4		mDefaultColor;  	LLColor4		mReadOnlyFgColor;  	LLColor4		mWriteableBgColor;  	LLColor4		mReadOnlyBgColor; diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 91d59a2c6b..4b9bf655b5 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -119,6 +119,7 @@ NVIDIA GeForce Go 6800			.*NVIDIA.*GeForce Go 68.*				2  NVIDIA GeForce Go 7300			.*NVIDIA.*GeForce Go 73.*				3  NVIDIA GeForce Go 7400			.*NVIDIA.*GeForce Go 74.*				3  NVIDIA GeForce Go 7600			.*NVIDIA.*GeForce Go 76.*				3 +NVIDIA GeForce Go 7700			.*NVIDIA.*GeForce Go 77.*				3  NVIDIA GeForce Go 7800			.*NVIDIA.*GeForce Go 78.*				3  NVIDIA GeForce Go 7900			.*NVIDIA.*GeForce Go 79.*				3  NVIDIA GeForce Go 6				.*GeForce Go 6.*						2 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index a692ef6a3e..f406d61a9e 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -305,7 +305,7 @@ LLAgent::LLAgent()  	mbAlwaysRun(FALSE),  	mShowAvatar(TRUE), - +	  	mCameraAnimating( FALSE ),  	mAnimationCameraStartGlobal(),  	mAnimationFocusStartGlobal(), @@ -410,6 +410,8 @@ LLAgent::LLAgent()  	mCameraUpVector = LLVector3::z_axis;// default is straight up   	mFollowCam.setMaxCameraDistantFromSubject( MAX_CAMERA_DISTANCE_FROM_AGENT );  	//end ventrella + +	mCustomAnim = FALSE ;  }  // Requires gSavedSettings to be initialized. @@ -2861,8 +2863,14 @@ void LLAgent::endAnimationUpdateUI()  		if (mAvatarObject)  		{ -			sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_STOP); -			sendAnimationRequest(ANIM_AGENT_CUSTOMIZE_DONE, ANIM_REQUEST_START); +			if(mCustomAnim) +			{ +				sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_STOP); +				sendAnimationRequest(ANIM_AGENT_CUSTOMIZE_DONE, ANIM_REQUEST_START); + +				mCustomAnim = FALSE ; +			} +			  		}  		setLookAt(LOOKAT_TARGET_CLEAR);  	} @@ -4188,7 +4196,7 @@ void LLAgent::changeCameraToThirdPerson(BOOL animate)  //-----------------------------------------------------------------------------  // changeCameraToCustomizeAvatar()  //----------------------------------------------------------------------------- -void LLAgent::changeCameraToCustomizeAvatar(BOOL animate) +void LLAgent::changeCameraToCustomizeAvatar(BOOL avatar_animate, BOOL camera_animate)  {  	setControlFlags(AGENT_CONTROL_STAND_UP); // force stand up  	gViewerWindow->getWindow()->resetBusyCount(); @@ -4203,16 +4211,16 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)  	gSavedSettings.setBOOL("ThirdPersonBtnState", FALSE);  	gSavedSettings.setBOOL("BuildBtnState", FALSE); -	if (animate) +	if (camera_animate)  	{  		startCameraAnimation();  	}  	// Remove any pitch from the avatar -	LLVector3 at = mFrameAgent.getAtAxis(); -	at.mV[VZ] = 0.f; -	at.normVec(); -	gAgent.resetAxes(at); +	//LLVector3 at = mFrameAgent.getAtAxis(); +	//at.mV[VZ] = 0.f; +	//at.normVec(); +	//gAgent.resetAxes(at);  	if( mCameraMode != CAMERA_MODE_CUSTOMIZE_AVATAR )  	{ @@ -4231,22 +4239,31 @@ void LLAgent::changeCameraToCustomizeAvatar(BOOL animate)  		LLVOAvatar::onCustomizeStart();  	} -	if (animate && !mAvatarObject.isNull()) +	if (!mAvatarObject.isNull())  	{ -		sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START); -		mAvatarObject->startMotion(ANIM_AGENT_CUSTOMIZE); -		LLMotion* turn_motion = mAvatarObject->findMotion(ANIM_AGENT_CUSTOMIZE); - -		if (turn_motion) +		if(avatar_animate)  		{ -			mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP; +				// Remove any pitch from the avatar +			LLVector3 at = mFrameAgent.getAtAxis(); +			at.mV[VZ] = 0.f; +			at.normVec(); +			gAgent.resetAxes(at); -		} -		else -		{ -			mAnimationDuration = gSavedSettings.getF32("ZoomTime"); -		} +			sendAnimationRequest(ANIM_AGENT_CUSTOMIZE, ANIM_REQUEST_START); +			mCustomAnim = TRUE ; +			mAvatarObject->startMotion(ANIM_AGENT_CUSTOMIZE); +			LLMotion* turn_motion = mAvatarObject->findMotion(ANIM_AGENT_CUSTOMIZE); + +			if (turn_motion) +			{ +				mAnimationDuration = turn_motion->getDuration() + CUSTOMIZE_AVATAR_CAMERA_ANIM_SLOP; +			} +			else +			{ +				mAnimationDuration = gSavedSettings.getF32("ZoomTime"); +			} +		} diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index 4e9b882250..5e5a58cffb 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -183,7 +183,7 @@ public:  	void			changeCameraToDefault();  	void			changeCameraToMouselook(BOOL animate = TRUE);  	void			changeCameraToThirdPerson(BOOL animate = TRUE); -	void			changeCameraToCustomizeAvatar(BOOL animate = TRUE);			// trigger transition animation +	void			changeCameraToCustomizeAvatar(BOOL avatar_animate = TRUE, BOOL camera_animate = TRUE);			// trigger transition animation  	// Ventrella  	void			changeCameraToFollow(BOOL animate = TRUE);  	//end Ventrella @@ -735,6 +735,7 @@ private:  	ECameraMode		mLastCameraMode;  	BOOL			mViewsPushed;					// keep track of whether or not we have pushed views. +	BOOL            mCustomAnim ;                   //current animation is ANIM_AGENT_CUSTOMIZE ?  	BOOL			mbAlwaysRun;					// should the avatar run rather than walk  	BOOL			mShowAvatar;					// should we render the avatar?  	BOOL			mCameraAnimating;				// camera is transitioning from one mode to another diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index be31d2481e..96d9670ac9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1263,7 +1263,7 @@ bool LLAppViewer::init()  	#if LL_WINDOWS && LL_LCD_COMPILE  		// start up an LCD window on a logitech keyboard, if there is one  		HINSTANCE hInstance = GetModuleHandle(NULL); -		gLcdScreen = new llLCD(hInstance); +		gLcdScreen = new LLLCD(hInstance);  		CreateLCDDebugWindows();  	#endif diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index b5570b1198..17593766b9 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1036,12 +1036,15 @@ F32 LLDrawable::getVisibilityRadius() const  	}  	else if (isLight())  	{ -		return llmax(getRadius(), getVOVolume()->getLightRadius()); -	} -	else -	{ -		return getRadius(); +		const LLVOVolume *vov = getVOVolume(); +		if (vov) +		{ +			return llmax(getRadius(), vov->getLightRadius()); +		} else { +			// llwarns ? +		}  	} +	return getRadius();  }  void LLDrawable::updateUVMinMax() diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 25a88e6e7c..b7b3cef76b 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -79,7 +79,7 @@  #ifndef LL_LOGITECH_LCD_H  #include "lllogitechlcd.h"  #endif -extern llLCD	*gLcdScreen;  +extern LLLCD	*gLcdScreen;   #endif  const S32 PREF_BORDER = 4; diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index eaf7832eab..ca0314cce1 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -2378,7 +2378,12 @@ BOOL LLPanelEstateInfo::checkRemovalButton(std::string name)  	}  	else if (name == "estate_manager_name_list")  	{ -		btn_name = "remove_estate_manager_btn"; +		//ONLY OWNER CAN ADD /DELET ESTATE MANAGER +		LLViewerRegion* region = gAgent.getRegion(); +		if (region && (region->getOwner() == gAgent.getID())) +		{ +			btn_name = "remove_estate_manager_btn"; +		}  	}  	// enable the remove button if something is selected diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index d8841afe22..0c8d17e1aa 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -211,6 +211,45 @@ void LLInvFVBridge::showProperties()  void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batch)  { +	// Deactivate gestures when moving them into Trash +	LLInvFVBridge* bridge; +	LLInventoryModel* model = mInventoryPanel->getModel(); +	LLViewerInventoryItem* item = NULL; +	LLViewerInventoryCategory* cat = NULL; +	LLInventoryModel::cat_array_t	descendent_categories; +	LLInventoryModel::item_array_t	descendent_items; +	S32 count = batch.count(); +	S32 i,j; +	for(i = 0; i < count; ++i) +	{	 +		bridge = (LLInvFVBridge*)(batch.get(i)); +		if(!bridge || !bridge->isItemRemovable()) continue; +		item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); +		if (item) +		{ +			if(LLAssetType::AT_GESTURE == item->getType()) +			{ +				gGestureManager.deactivateGesture(item->getUUID()); +			} +		} +	} +	for(i = 0; i < count; ++i) +	{		 +		bridge = (LLInvFVBridge*)(batch.get(i)); +		if(!bridge || !bridge->isItemRemovable()) continue; +		cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); +		if (cat) +		{ +			gInventory.collectDescendents( cat->getUUID(), descendent_categories, descendent_items, FALSE ); +			for (j=0; j<descendent_items.count(); j++) +			{ +				if(LLAssetType::AT_GESTURE == descendent_items[j]->getType()) +				{ +					gGestureManager.deactivateGesture(descendent_items[j]->getUUID()); +				} +			} +		} +	}  	removeBatchNoCheck(batch);  } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 08c33cb744..4ee155931c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -290,6 +290,7 @@ void LLPanelAvatarSecondLife::updatePartnerName()  			childSetTextArg("partner_edit", "[FIRST]", LLString(first));  			childSetTextArg("partner_edit", "[LAST]", LLString(last));  		} +		childSetEnabled("partner_info", TRUE);  	}  } @@ -394,6 +395,16 @@ void LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(S32 option, void* userda      LLWeb::loadURL("http://secondlife.com/partner");  } +// static +void LLPanelAvatarSecondLife::onClickPartnerInfo(void *data) +{ +	LLPanelAvatarSecondLife* self = (LLPanelAvatarSecondLife*) data; +	if (self->mPartnerID.notNull()) +	{ +		LLFloaterAvatarInfo::showFromProfile(self->mPartnerID, +											 self->getScreenRect()); +	} +}  //-----------------------------------------------------------------------------  // LLPanelAvatarFirstLife() @@ -421,6 +432,8 @@ BOOL LLPanelAvatarSecondLife::postBuild(void)  	childSetEnabled("born", FALSE);  	childSetEnabled("partner_edit", FALSE);  	childSetAction("partner_help",onClickPartnerHelp,this); +	childSetAction("partner_info", onClickPartnerInfo, this); +	childSetEnabled("partner_info", mPartnerID.notNull());  	childSetAction("?",onClickPublishHelp,this);  	BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index d4b935f09c..7d491c6143 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -119,6 +119,7 @@ public:  	static void onClickPublishHelp(void *userdata);  	static void onClickPartnerHelp(void *userdata);  	static void onClickPartnerHelpLoadURL(S32 option, void* userdata); +	static void onClickPartnerInfo(void *userdata);  	// Clear out the controls anticipating new network data.  	void clearControls(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 21c97c2678..96af7d2bd2 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -122,6 +122,7 @@  #include "llpanelgroupnotices.h"  #include "llpreview.h"  #include "llpreviewscript.h" +#include "llsecondlifeurls.h"  #include "llselectmgr.h"  #include "llsky.h"  #include "llsrv.h" @@ -153,6 +154,7 @@  #include "llviewerwindow.h"  #include "llvoavatar.h"  #include "llvoclouds.h" +#include "llweb.h"  #include "llworld.h"  #include "llworldmap.h"  #include "llxfermanager.h" @@ -166,7 +168,6 @@  #include "llnamelistctrl.h"  #include "llnamebox.h"  #include "llnameeditor.h" -#include "llurlsimstring.h"  #if LL_LIBXUL_ENABLED  #include "llmozlib.h" @@ -2537,17 +2538,22 @@ void set_startup_status(const F32 frac, const char *string, const char* msg)  void login_alert_status(S32 option, void* user_data)  { -	if (0 == option) -	{ -		// OK button -	} -	else if (1 == option) -	{ -		// Help button -		std::string help_path; -		help_path = gDirUtilp->getExpandedFilename(LL_PATH_HELP, "unable_to_connect.html"); -		load_url_local_file(help_path.c_str() ); -	} +    // Buttons +    switch( option ) +    { +        case 0:     // OK +            break; +        case 1:     // Help +            LLWeb::loadURL( SUPPORT_URL ); +            break; +        case 2:     // Teleport +            // Restart the login process, starting at our home locaton +            LLURLSimString::setString(LLURLSimString::sLocationStringHome); +            LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); +            break; +        default: +            llwarns << "Missing case in login_alert_status switch" << llendl; +    }  	LLPanelLogin::giveFocus();  } diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 88a97ba71a..d0f3e66fa9 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -48,9 +48,21 @@ class LLFrameTimer;  class LLStatGraph;  // used by LCD screen -class cLLRegionDetails +class LLRegionDetails  {  public: +	LLRegionDetails() +	{ +		mRegionName = LLString("Unknown"); +		mParcelName = "Unknown"; +		mAccesString = "Unknown"; +		mX = 0; +		mY = 0; +		mZ = 0; +		mArea = 0; +		mForSale = FALSE; +		snprintf(mOwner, MAX_STRING, "Unknown"); +	}  	LLString mRegionName;  	char	*mParcelName;  	char	*mAccesString; @@ -100,7 +112,7 @@ public:  	S32 getSquareMetersCredit() const;  	S32 getSquareMetersCommitted() const;  	S32 getSquareMetersLeft() const; -	cLLRegionDetails mRegionDetails; +	LLRegionDetails mRegionDetails;  private:  	// simple method to setup the part that holds the date diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index 413b26309d..baff994bdd 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1199,6 +1199,16 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,  		return TRUE;  	} +	// In case the inventory has not been updated (e.g. due to some recent operation +	// causing a dirty inventory), stall the user while fetching the inventory. +	if (hit_obj->isInventoryDirty()) +	{ +		hit_obj->fetchInventoryFromServer(); +		LLString::format_map_t args; +		args["[ERROR_MESSAGE]"] = "Unable to add texture.\nPlease wait a few seconds and try again."; +		gViewerWindow->alertXml("ErrorMessage", args); +		return FALSE; +	}  	if (hit_obj->getInventoryItemByAsset(item->getAssetUUID()))  	{  		// if the asset is already in the object's inventory  @@ -1259,6 +1269,8 @@ BOOL LLToolDragAndDrop::handleDropTextureProtections(LLViewerObject* hit_obj,  		// Add the texture item to the target object's inventory.  		hit_obj->updateInventory(new_item, TASK_INVENTORY_ITEM_KEY, true); +		// Force the object to update its refetch its inventory so it has this texture. +		hit_obj->fetchInventoryFromServer();   		// TODO: Check to see if adding the item was successful; if not, then  		// we should return false here.  	} diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index b5316d29e0..981605d1fa 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -47,7 +47,7 @@  #include "llviewerregion.h"  #include "llviewerobjectlist.h" - +#include "llpreviewgesture.h"  ///----------------------------------------------------------------------------  /// Local function declarations, constants, enums, and typedefs  ///---------------------------------------------------------------------------- @@ -643,6 +643,26 @@ void ActivateGestureCallback::fire(const LLUUID& inv_item)  	gGestureManager.activateGesture(inv_item);  } +void CreateGestureCallback::fire(const LLUUID& inv_item) +{ +	if (inv_item.isNull()) +		return; + +	gGestureManager.activateGesture(inv_item); +	 +	LLViewerInventoryItem* item = gInventory.getItem(inv_item); +	if (!item) return; +    gInventory.updateItem(item); +    gInventory.notifyObservers(); + +	if(!LLPreview::show(inv_item,FALSE)) +	{ +		LLPreviewGesture* preview = LLPreviewGesture::show(LLString("Gesture: ") + item->getName(), inv_item,  LLUUID::null); +		// Force to be entirely onscreen. +		gFloaterView->adjustToFitScreen(preview, FALSE); +	} +} +  LLInventoryCallbackManager gInventoryCallbacks;  void create_inventory_item(const LLUUID& agent_id, const LLUUID& session_id, diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index 2aba7f454f..fd6928243b 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -223,6 +223,12 @@ public:  	void fire(const LLUUID& inv_item);  }; +class CreateGestureCallback : public LLInventoryCallback +{ +public: +	void fire(const LLUUID& inv_item); +}; +  // misc functions  //void inventory_reliable_callback(void**, S32 status); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 54396d083e..4c7229b0d9 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -5272,7 +5272,7 @@ class LLShowFloater : public view_listener_t  		{  			if (gAgent.getWearablesLoaded())  			{ -				gAgent.changeCameraToCustomizeAvatar(); +				gAgent.changeCameraToCustomizeAvatar(gSavedSettings.getBOOL("AppearanceCameraMovement"));  			}  		}  		else if (floater_name == "friends") diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index dd786da4d3..2e799039ab 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -284,6 +284,7 @@ void process_logout_reply(LLMessageSystem* msg, void**)  void process_layer_data(LLMessageSystem *mesgsys, void **user_data)  { +	if(!gWorldp) return;  	LLViewerRegion *regionp = gWorldp->getRegion(mesgsys->getSender());  	if (!regionp || gNoRender) @@ -2609,6 +2610,7 @@ void process_teleport_finish(LLMessageSystem* msg, void**)  	// Viewer trusts the simulator.  	gMessageSystem->enableCircuit(sim_host, TRUE); +	if(!gWorldp) return;  	LLViewerRegion* regionp =  gWorldp->addRegion(region_handle, sim_host);  /* @@ -2716,6 +2718,7 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)  	F32 x, y;  	from_region_handle(region_handle, &x, &y); +	if(!gWorldp) return;  	LLViewerRegion* regionp = gWorldp->getRegionFromHandle(region_handle);  	if (!regionp)  	{ @@ -2889,6 +2892,7 @@ void process_crossed_region(LLMessageSystem* msg, void**)  	send_complete_agent_movement(sim_host); +	if(!gWorldp) return;  	LLViewerRegion* regionp = gWorldp->addRegion(region_handle, sim_host);  	regionp->setSeedCapability(std::string(seedCap));  } @@ -3273,6 +3277,7 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data)  	mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunDirection, sun_direction);  	mesgsys->getVector3Fast(_PREHASH_TimeInfo, _PREHASH_SunAngVelocity, sun_ang_velocity); +	if(!gWorldp) return;  	gWorldp->setSpaceTimeUSec(space_time_usec);  	//lldebugs << "time_synch() - " << sun_direction << ", " << sun_ang_velocity diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index f242b06d9b..3a0daba8aa 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -2343,8 +2343,19 @@ void LLViewerObject::requestInventory()  		doInventoryCallback();  	}  	// throw away duplicate requests -	else if (! mInventoryPending) +	else  	{ +		fetchInventoryFromServer(); +	} +} + +void LLViewerObject::fetchInventoryFromServer() +{ +	if (!mInventoryPending) +	{ +		delete mInventory; +		mInventory = NULL; +		mInventoryDirty = FALSE;  		LLMessageSystem* msg = gMessageSystem;  		msg->newMessageFast(_PREHASH_RequestTaskInventory);  		msg->nextBlockFast(_PREHASH_AgentData); @@ -2631,6 +2642,9 @@ LLInventoryObject* LLViewerObject::getInventoryRoot()  LLViewerInventoryItem* LLViewerObject::getInventoryItemByAsset(const LLUUID& asset_id)  { +	if (mInventoryDirty) +		llwarns << "Peforming inventory lookup for object " << mID << " that has dirty inventory!" << llendl; +  	LLViewerInventoryItem* rv = NULL;  	if(mInventory)  	{ diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index b30bf7e1b8..f2ddc173a0 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -373,6 +373,7 @@ public:  	BOOL isInventoryPending() { return mInventoryPending; }  	void clearInventoryListeners();  	void requestInventory(); +	void fetchInventoryFromServer();  	static void processTaskInv(LLMessageSystem* msg, void** user_data);  	void removeInventory(const LLUUID& item_id); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 0ffa37525f..2844cf9356 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -687,6 +687,7 @@ F32 LLViewerParcelMgr::agentDrawDistance() const  BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const  { +	if (!gWorldp) return FALSE;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global );  	if (!region) return FALSE; @@ -700,6 +701,7 @@ BOOL LLViewerParcelMgr::isOwnedAt(const LLVector3d& pos_global) const  BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const  { +	if (!gWorldp) return FALSE;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global );  	if (!region) return FALSE; @@ -713,6 +715,7 @@ BOOL LLViewerParcelMgr::isOwnedSelfAt(const LLVector3d& pos_global) const  BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const  { +	if (!gWorldp) return FALSE;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global );  	if (!region) return FALSE; @@ -726,6 +729,7 @@ BOOL LLViewerParcelMgr::isOwnedOtherAt(const LLVector3d& pos_global) const  BOOL LLViewerParcelMgr::isSoundLocal(const LLVector3d& pos_global) const  { +	if (!gWorldp) return FALSE;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos_global );  	if (!region) return FALSE; @@ -769,6 +773,7 @@ BOOL LLViewerParcelMgr::canHearSound(const LLVector3d &pos_global) const  BOOL LLViewerParcelMgr::inAgentParcel(const LLVector3d &pos_global) const  { +	if (!gWorldp) return FALSE;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(pos_global);  	if (region != gAgent.getRegion())  	{ @@ -826,7 +831,8 @@ void LLViewerParcelMgr::render()  	{  		// Rendering is done in agent-coordinates, so need to supply  		// an appropriate offset to the render code. -		LLViewerRegion *regionp = gWorldp->getRegionFromPosGlobal( mWestSouth ); +		if (!gWorldp) return; +		LLViewerRegion* regionp = gWorldp->getRegionFromPosGlobal(mWestSouth);  		if (!regionp) return;  		renderHighlightSegments(mHighlightSegments, regionp); @@ -858,6 +864,7 @@ void LLViewerParcelMgr::sendParcelAccessListRequest(U32 flags)  		return;  	} +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region) return; @@ -893,6 +900,7 @@ void LLViewerParcelMgr::sendParcelDwellRequest()  		return;  	} +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region) return; @@ -925,6 +933,7 @@ void LLViewerParcelMgr::sendParcelGodForceOwner(const LLUUID& owner_id)  	east_north_region_check.mdV[VX] -= 0.5;  	east_north_region_check.mdV[VY] -= 0.5; +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region)  	{ @@ -981,7 +990,8 @@ void LLViewerParcelMgr::sendParcelGodForceToContent()  		gViewerWindow->alertXml("CannotContentifyNothingSelected");  		return;  	} -	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); +	if(!gWorldp) return; +	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region)  	{  		gViewerWindow->alertXml("CannotContentifyNoRegion"); @@ -1006,6 +1016,7 @@ void LLViewerParcelMgr::sendParcelRelease()  		return;  	} +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region)  	{ @@ -1068,6 +1079,7 @@ LLViewerParcelMgr::ParcelBuyInfo* LLViewerParcelMgr::setupParcelBuy(  		return NULL;  	} +	if(!gWorldp) return NULL;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region)  	{ @@ -1178,6 +1190,7 @@ void LLViewerParcelMgr::sendParcelDeed(const LLUUID& group_id)  		gViewerWindow->alertXml("CannotDeedLandNoGroup");  		return;  	} +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region)  	{ @@ -1245,7 +1258,7 @@ const LLString& LLViewerParcelMgr::getAgentParcelName() const  void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel)  {  	if (!parcel) return; - +	if(!gWorldp) return;  	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region) return; @@ -1271,7 +1284,8 @@ void LLViewerParcelMgr::sendParcelPropertiesUpdate(LLParcel* parcel)  void LLViewerParcelMgr::requestHoverParcelProperties(const LLVector3d& pos)  { -	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( pos ); +	if(!gWorldp) return; +	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( pos );  	if (!region)  	{  		return; @@ -1519,7 +1533,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use  							(request_result == PARCEL_RESULT_MULTIPLE);  		// Select the whole parcel -		LLViewerRegion *region = gWorldp->getRegion( msg->getSender() ); +		if(!gWorldp) return; +		LLViewerRegion* region = gWorldp->getRegion( msg->getSender() );  		if (region)  		{  			if (!snap_selection) @@ -1975,7 +1990,8 @@ void LLViewerParcelMgr::sendParcelAccessListUpdate(U32 which)  		return;  	} -	LLViewerRegion *region = gWorldp->getRegionFromPosGlobal( mWestSouth ); +	if(!gWorldp) return; +	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal( mWestSouth );  	if (!region) return;  	LLMessageSystem* msg = gMessageSystem; @@ -2166,6 +2182,7 @@ void LLViewerParcelMgr::startReleaseLand()  	}  	LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; +	if(!gWorldp) return;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center);  	if (!region)  	{ @@ -2270,6 +2287,7 @@ void LLViewerParcelMgr::callbackDivideLand(S32 option, void* data)  	LLViewerParcelMgr* self = (LLViewerParcelMgr*)data;  	LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; +	if(!gWorldp) return;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center);  	if (!region)  	{ @@ -2328,6 +2346,7 @@ void LLViewerParcelMgr::callbackJoinLand(S32 option, void* data)  	LLViewerParcelMgr* self = (LLViewerParcelMgr*)data;  	LLVector3d parcel_center = (self->mWestSouth + self->mEastNorth) / 2.0; +	if(!gWorldp) return;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center);  	if (!region)  	{ @@ -2376,6 +2395,7 @@ void LLViewerParcelMgr::startDeedLandToGroup()  	}  	LLVector3d parcel_center = (mWestSouth + mEastNorth) / 2.0; +	if(!gWorldp) return;  	LLViewerRegion* region = gWorldp->getRegionFromPosGlobal(parcel_center);  	if (!region)  	{ diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 6001cd3e58..ef4ae7652c 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -846,6 +846,7 @@ public:  		const LLSD& context,  		const LLSD& input) const  	{ +		if(!gWorldp) return;  		LLHost host(input["sender"].asString());  		LLViewerRegion* region = gWorldp->getRegion(host);  		if( !region ) diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 5c613052ea..bd488577e3 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -1355,7 +1355,11 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, BOOL saved)  void LLViewerTextEditor::openEmbeddedTexture( LLInventoryItem* item )  {  	// See if we can bring an existing preview to the front -	if( !LLPreview::show( item->getUUID() ) ) +	// *NOTE:  Just for embedded Texture , we should use getAssetUUID(),  +	// not getUUID(), because LLPreviewTexture pass in AssetUUID into  +	// LLPreview constructor ItemUUID parameter. + +	if( !LLPreview::show( item->getAssetUUID() ) )  	{  		// There isn't one, so make a new preview  		if(item) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 2a496f6698..405a705b62 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1781,6 +1781,22 @@ void adjust_rect_bottom_center(const LLString& control, const LLRect& window)  	}  } + +void update_saved_window_size(const LLString& control,S32 delta_width, S32 delta_height) +{ +	if (delta_width || delta_height ) +	{ +		LLRect mXMLRect = gSavedSettings.getRect(control); +		//hard code it all follows the right and top +		mXMLRect.mRight += delta_width; +		mXMLRect.mTop += delta_height; +		mXMLRect.mLeft = llmax (0, mXMLRect.mLeft+delta_width); +		mXMLRect.mBottom = llmax(0,mXMLRect.mBottom+delta_height); +		gSavedSettings.setRect(control,mXMLRect); +	} +} + +  // Many rectangles can't be placed until we know the screen size.  // These rectangles have their bottom-left corner as 0,0  void LLViewerWindow::adjustRectanglesForFirstUse(const LLRect& window) @@ -2059,7 +2075,7 @@ void LLViewerWindow::reshape(S32 width, S32 height)  		glViewport(0, 0, width, height );  		if (height > 0 && gCamera) -		{ +		{   			gCamera->setViewHeightInPixels( height );  			if (mWindow->getFullscreen())  			{ @@ -2072,6 +2088,9 @@ void LLViewerWindow::reshape(S32 width, S32 height)  			}  		} +		// changes in window's width and hight +		S32 delta_width  = width - mWindowRect.getWidth(); +		S32 delta_height = height - mWindowRect.getHeight();  		// update our window rectangle  		mWindowRect.mRight = mWindowRect.mLeft + width;  		mWindowRect.mTop = mWindowRect.mBottom + height; @@ -2122,6 +2141,12 @@ void LLViewerWindow::reshape(S32 width, S32 height)  			{  				gSavedSettings.setS32("WindowWidth", window_size.mX);  				gSavedSettings.setS32("WindowHeight", window_size.mY); +				if (!gFloaterMap) +				{					 +					update_saved_window_size("FloaterWorldMapRect",delta_width, delta_height);	 +					update_saved_window_size("FloaterMapRect",delta_width, delta_height);		 +				} +				  			}  		} diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index 612484e2dc..1053234e8f 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -382,7 +382,7 @@ void toggle_flying(void*);  void toggle_first_person();  void toggle_build(void*);  void reset_viewer_state_on_sim(void); - +void update_saved_window_size(const LLString& control,S32 delta_width, S32 delta_height);  //  // Constants  // diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp index e76123557c..ead4654c7f 100644 --- a/indra/newview/llworld.cpp +++ b/indra/newview/llworld.cpp @@ -770,6 +770,7 @@ void LLWorld::printPacketsLost()  void LLWorld::processCoarseUpdate(LLMessageSystem* msg, void** user_data)  { +	if(!gWorldp) return;  	LLViewerRegion* region = gWorldp->getRegion(msg->getSender());  	if( region )  	{ @@ -1026,6 +1027,7 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)  	// Viewer trusts the simulator.  	msg->enableCircuit(sim, TRUE); +	if(!gWorldp) return;  	gWorldp->addRegion(handle, sim);  	// give the simulator a message it can use to get ip and port @@ -1063,6 +1065,7 @@ public:  		LLHost sim(input["body"]["sim-ip-and-port"].asString()); +		if(!gWorldp) return;  		LLViewerRegion* regionp = gWorldp->getRegion(sim);  		if (!regionp)  		{ @@ -1081,6 +1084,7 @@ void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data)  	LLHost host = mesgsys->getSender();  	//llinfos << "Disabling simulator with message from " << host << llendl; +	if(!gWorldp) return;  	gWorldp->removeRegion(host);  	mesgsys->disableCircuit(host); @@ -1090,6 +1094,7 @@ void process_disable_simulator(LLMessageSystem *mesgsys, void **user_data)  void process_region_handshake(LLMessageSystem* msg, void** user_data)  {  	LLHost host = msg->getSender(); +	if(!gWorldp) return;  	LLViewerRegion* regionp = gWorldp->getRegion(host);  	if (!regionp)  	{ diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ec277b1a1b..b188c70b70 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -100,6 +100,16 @@ S32 LLWorldMapView::sTrackingArrowY = 0;  F32 LLWorldMapView::sPixelsPerMeter = 1.f;  F32 CONE_SIZE = 0.6f; + +#define SIM_NULL_MAP_SCALE 1 // width in pixels, where we start drawing "null" sims +#define SIM_MAP_AGENT_SCALE 2 // width in pixels, where we start drawing agents +#define SIM_MAP_SCALE 1 // width in pixels, where we start drawing sim tiles + +// Updates for agent locations. +#define AGENTS_UPDATE_TIME 60.0 // in seconds + + +  void LLWorldMapView::initClass()  {  	LLUUID image_id; @@ -458,7 +468,7 @@ void LLWorldMapView::draw()  		LLViewerImage* simimage = info->mCurrentImage;  		LLViewerImage* overlayimage = info->mOverlayImage; -		if (gMapScale < 8.f) +		if (gMapScale < SIM_MAP_SCALE)  		{  			simimage->setBoostLevel(0);  			if (overlayimage) overlayimage->setBoostLevel(0); diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 28ffb421b0..f3c5d654b6 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -52,13 +52,6 @@ class LLCoordGL;  class LLViewerImage;  class LLTextBox; -#define SIM_NULL_MAP_SCALE 2 // width in pixels, where we start drawing "null" sims -#define SIM_MAP_AGENT_SCALE 20 // width in pixels, where we start drawing agents -#define SIM_MAP_SCALE 90 // width in pixels, where we start drawing sim tiles - -// Updates for agent locations. -#define AGENTS_UPDATE_TIME 60.0 // in seconds -  class LLWorldMapView : public LLPanel  {  | 
