merge changes for version 3.3.1
commit
95090c5d1e
11
.hgtags
11
.hgtags
|
|
@ -271,7 +271,18 @@ e9c82fca5ae6fb8a8af29012d78fb194a29323f3 3.2.9-beta1
|
|||
a01ef9bed28627f4ca543fbc1d70c79cc297a90f DRTVWR-118_3.2.9-beta2
|
||||
a01ef9bed28627f4ca543fbc1d70c79cc297a90f 3.2.9-beta2
|
||||
987425b1acf4752379b2e1eb20944b4b35d67a85 3.2.8-beta2
|
||||
d5f263687f43f278107363365938f0a214920a4b 3.3.0-start
|
||||
dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
|
||||
d5f263687f43f278107363365938f0a214920a4b DRTVWR-119
|
||||
d5f263687f43f278107363365938f0a214920a4b 3.3.0-beta1
|
||||
5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
|
||||
5e8d2662f38a66eca6c591295f5880d47afc73f7 3.3.0-release
|
||||
dffd0457ee0745de65bf95f0642a5c9e46b8e2f0 viewer-beta-candidate
|
||||
3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
|
||||
3e2fca4ed1a0dc9fe6d8a6664e71098bb035a367 viewer-beta-candidate
|
||||
1dc545e44617975da2a4a32fe303386c687a6ca1 viewer-beta-candidate
|
||||
1dc545e44617975da2a4a32fe303386c687a6ca1 3.3.1-beta2
|
||||
1dc545e44617975da2a4a32fe303386c687a6ca1 DRTVWR-139
|
||||
5e8d2662f38a66eca6c591295f5880d47afc73f7 viewer-release-candidate
|
||||
c623bbc854b6f7ee1b33a3718f76715046aa2937 viewer-release-candidate
|
||||
c623bbc854b6f7ee1b33a3718f76715046aa2937 3.3.1-release
|
||||
|
|
|
|||
45
BuildParams
45
BuildParams
|
|
@ -36,50 +36,25 @@ viewer-development.build_debug_release_separately = true
|
|||
# <username>_<reponame>.email = <email-address>
|
||||
|
||||
# =================================================================
|
||||
# Viewer Development (snowstorm canonical build owned by Oz Linden)
|
||||
# Canonical viewer integration builds - Oz Linden
|
||||
# =================================================================
|
||||
snowstorm_viewer-development.viewer_channel = "Second Life Development"
|
||||
snowstorm_viewer-development.login_channel = "Second Life Development"
|
||||
snowstorm_viewer-development.build_viewer_update_version_manager = false
|
||||
snowstorm_viewer-development.email = viewer-development-builds@lists.secondlife.com
|
||||
snowstorm_viewer-development.build_enforce_coding_policy = true
|
||||
snowstorm_viewer-development.codeticket_add_context = true
|
||||
integration_viewer-development.viewer_channel = "Second Life Development"
|
||||
integration_viewer-development.login_channel = "Second Life Development"
|
||||
integration_viewer-development.build_viewer_update_version_manager = false
|
||||
integration_viewer-development.email = viewer-development-builds@lists.secondlife.com
|
||||
integration_viewer-development.build_enforce_coding_policy = true
|
||||
integration_viewer-development.codeticket_add_context = true
|
||||
|
||||
Snowstorm_viewer-project-review.build_debug_release_separately = true
|
||||
Snowstorm_viewer-project-review.codeticket_add_context = true
|
||||
Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
|
||||
Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
|
||||
Snowstorm_viewer-project-review.codeticket_add_context = true
|
||||
|
||||
# ========================================
|
||||
# Viewer Beta (Owner: Dessie Linden)
|
||||
# ========================================
|
||||
viewer-beta.viewer_channel = "Second Life Beta Viewer"
|
||||
viewer-beta.login_channel = "Second Life Beta Viewer"
|
||||
viewer-beta.build_debug_release_separately = true
|
||||
viewer-beta.build_viewer_update_version_manager = true
|
||||
|
||||
viewer-pre-beta.viewer_channel = "Second Life Beta Viewer"
|
||||
viewer-pre-beta.login_channel = "Second Life Beta Viewer"
|
||||
viewer-pre-beta.build_debug_release_separately = true
|
||||
viewer-pre-beta.build_viewer_update_version_manager = true
|
||||
|
||||
|
||||
# ========================================
|
||||
# Viewer Release (Owner: Dessie Linden)
|
||||
# ========================================
|
||||
viewer-release.viewer_channel = "Second Life Release"
|
||||
viewer-release.login_channel = "Second Life Release"
|
||||
viewer-release.build_debug_release_separately = true
|
||||
viewer-release.build_viewer_update_version_manager = true
|
||||
|
||||
viewer-pre-release.viewer_channel = "Second Life Release"
|
||||
viewer-pre-release.login_channel = "Second Life Release"
|
||||
viewer-pre-release.build_debug_release_separately = true
|
||||
viewer-pre-release.build_viewer_update_version_manager = true
|
||||
#viewer-pre-release.release-viewer.jira = DRTVWR-92
|
||||
|
||||
|
||||
# ========================================
|
||||
# mesh-development
|
||||
# ========================================
|
||||
|
|
@ -140,6 +115,12 @@ viewer-mesh.email = shining@lists.lindenlab.com
|
|||
# oz
|
||||
# ================
|
||||
|
||||
Snowstorm_viewer-project-review.build_debug_release_separately = true
|
||||
Snowstorm_viewer-project-review.codeticket_add_context = true
|
||||
Snowstorm_viewer-project-review.viewer_channel = "Project Viewer - Snowstorm Team"
|
||||
Snowstorm_viewer-project-review.login_channel = "Project Viewer - Snowstorm Team"
|
||||
Snowstorm_viewer-project-review.codeticket_add_context = true
|
||||
|
||||
oz_viewer-devreview.build_debug_release_separately = true
|
||||
oz_viewer-devreview.codeticket_add_context = false
|
||||
oz_viewer-devreview.build_enforce_coding_policy = true
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ Aleric Inglewood
|
|||
STORM-163
|
||||
STORM-955
|
||||
STORM-960
|
||||
STORM-1793
|
||||
Ales Beaumont
|
||||
VWR-9352
|
||||
SNOW-240
|
||||
|
|
@ -466,6 +467,8 @@ Hiro Sommambulist
|
|||
VWR-132
|
||||
VWR-136
|
||||
VWR-143
|
||||
Hitomi Tiponi
|
||||
STORM-1741
|
||||
Holger Gilruth
|
||||
Horatio Freund
|
||||
Hoze Menges
|
||||
|
|
@ -594,22 +597,34 @@ Jonathan Yap
|
|||
STORM-1659
|
||||
STORM-1674
|
||||
STORM-1685
|
||||
STORM-1718
|
||||
STORM-1721
|
||||
STORM-1718
|
||||
STORM-1727
|
||||
STORM-1725
|
||||
STORM-1719
|
||||
STORM-1712
|
||||
STORM-1728
|
||||
STORM-1736
|
||||
STORM-1804
|
||||
STORM-1734
|
||||
STORM-1731
|
||||
STORM-653
|
||||
STORM-1737
|
||||
STORM-1733
|
||||
STORM-1741
|
||||
STORM-1790
|
||||
STORM-1795
|
||||
STORM-1788
|
||||
STORM-1803
|
||||
STORM-1795
|
||||
STORM-1799
|
||||
STORM-1796
|
||||
STORM-1807
|
||||
STORM-1808
|
||||
STORM-1809
|
||||
STORM-1793
|
||||
STORM-1810
|
||||
Kadah Coba
|
||||
STORM-1060
|
||||
Jondan Lundquist
|
||||
|
|
@ -645,6 +660,7 @@ Kitty Barnett
|
|||
STORM-1001
|
||||
STORM-1175
|
||||
VWR-24217
|
||||
STORM-1804
|
||||
Kolor Fall
|
||||
Komiko Okamoto
|
||||
Korvel Noh
|
||||
|
|
@ -1239,6 +1255,8 @@ WolfPup Lowenhar
|
|||
VWR-20741
|
||||
VWR-20933
|
||||
Wundur Primbee
|
||||
Xellessanova Zenith
|
||||
STORM-1793
|
||||
Xiki Luik
|
||||
xstorm Radek
|
||||
YongYong Francois
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ BOOL LLVorbisDecodeState::initDecode()
|
|||
return(FALSE);
|
||||
}
|
||||
|
||||
S32 sample_count = ov_pcm_total(&mVF, -1);
|
||||
S32 sample_count = (S32)ov_pcm_total(&mVF, -1);
|
||||
size_t size_guess = (size_t)sample_count;
|
||||
vorbis_info* vi = ov_info(&mVF, -1);
|
||||
size_guess *= (vi? vi->channels : 1);
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#include "lluuid.h"
|
||||
#include "llframetimer.h"
|
||||
#include "llassettype.h"
|
||||
#include "llextendedstatus.h"
|
||||
|
||||
#include "lllistener.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1570,7 +1570,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
|||
constraint_it++)
|
||||
{
|
||||
U8 byte = constraint_it->mChainLength;
|
||||
dp.packU8(byte, "chain_lenght");
|
||||
dp.packU8(byte, "chain_length");
|
||||
|
||||
byte = constraint_it->mConstraintType;
|
||||
dp.packU8(byte, "constraint_type");
|
||||
|
|
|
|||
|
|
@ -52,34 +52,11 @@
|
|||
#include <ctime>
|
||||
#include <iosfwd>
|
||||
|
||||
// Work around Microsoft compiler warnings in STL headers
|
||||
#ifdef LL_WINDOWS
|
||||
#pragma warning (disable : 4702) // unreachable code
|
||||
#pragma warning (disable : 4244) // conversion from time_t to S32
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
// *TODO: Eliminate these, most library .cpp files don't need them.
|
||||
// Add them to llviewerprecompiledheaders.h if necessary.
|
||||
#include <list>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifdef LL_WINDOWS
|
||||
// Reenable warnings we disabled above
|
||||
#pragma warning (3 : 4702) // unreachable code, we like level 3, not 4
|
||||
// moved msvc warnings to llpreprocessor.h *TODO - delete this comment after merge conflicts are unlikely -brad
|
||||
#endif // LL_WINDOWS
|
||||
|
||||
// Linden only libs in alpha-order other than stdtypes.h
|
||||
// *NOTE: Please keep includes here to a minimum, see above.
|
||||
#include "stdtypes.h"
|
||||
#include "lldefs.h"
|
||||
#include "llerror.h"
|
||||
#include "llextendedstatus.h"
|
||||
// Don't do this, adds 15K lines of header code to every library file.
|
||||
//#include "llfasttimer.h"
|
||||
#include "llfile.h"
|
||||
#include "llformat.h"
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -106,6 +106,11 @@ std::string LLAvatarName::getCompleteName() const
|
|||
|
||||
std::string LLAvatarName::getLegacyName() const
|
||||
{
|
||||
if (mLegacyFirstName.empty() && mLegacyLastName.empty()) // display names disabled?
|
||||
{
|
||||
return mDisplayName;
|
||||
}
|
||||
|
||||
std::string name;
|
||||
name.reserve( mLegacyFirstName.size() + 1 + mLegacyLastName.size() );
|
||||
name = mLegacyFirstName;
|
||||
|
|
|
|||
|
|
@ -430,13 +430,13 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL
|
|||
{
|
||||
// The new node isn't last. Place it between the previous node and
|
||||
// the successor.
|
||||
newNode = (myprev + mydmi->second)/2.0;
|
||||
newNode = (myprev + mydmi->second)/2.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// The new node is last. Bump myprev up to the next integer, add
|
||||
// 1.0 and use that.
|
||||
newNode = std::ceil(myprev) + 1.0;
|
||||
newNode = std::ceil(myprev) + 1.f;
|
||||
}
|
||||
// Now that newNode has a value that places it appropriately in mSignal,
|
||||
// connect it.
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ void LLMD5::update(std::istream& stream){
|
|||
|
||||
while (stream.good()){
|
||||
stream.read( (char*)buffer, BLOCK_LEN); /* Flawfinder: ignore */ // note that return value of read is unusable.
|
||||
len=stream.gcount();
|
||||
len=(int)stream.gcount();
|
||||
update(buffer, len);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
#pragma warning( 3 : 4265 ) // "class has virtual functions, but destructor is not virtual"
|
||||
#pragma warning( 3 : 4266 ) // 'function' : no override available for virtual member function from base 'type'; function is hidden
|
||||
#pragma warning (disable : 4180) // qualifier applied to function type has no meaning; ignored
|
||||
#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
|
||||
//#pragma warning( disable : 4284 ) // silly MS warning deep inside their <map> include file
|
||||
#pragma warning( disable : 4503 ) // 'decorated name length exceeded, name was truncated'. Does not seem to affect compilation.
|
||||
#pragma warning( disable : 4800 ) // 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
|
||||
#pragma warning( disable : 4996 ) // warning: deprecated
|
||||
|
|
@ -152,6 +152,7 @@
|
|||
#pragma warning (disable : 4251) // member needs to have dll-interface to be used by clients of class
|
||||
#pragma warning (disable : 4275) // non dll-interface class used as base for dll-interface class
|
||||
#pragma warning (disable : 4018) // '<' : signed/unsigned mismatch
|
||||
|
||||
#endif // LL_MSVC
|
||||
|
||||
#if LL_WINDOWS
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, S32 max_bytes)
|
|||
if (!strncasecmp(LEGACY_NON_HEADER, hdr_buf, strlen(LEGACY_NON_HEADER))) /* Flawfinder: ignore */
|
||||
{
|
||||
legacy_no_header = true;
|
||||
inbuf = str.gcount();
|
||||
inbuf = (int)str.gcount();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -343,7 +343,7 @@ std::istream& LLSDParser::get(
|
|||
char delim) const
|
||||
{
|
||||
istr.get(s, n, delim);
|
||||
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
|
||||
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
|
||||
return istr;
|
||||
}
|
||||
|
||||
|
|
@ -353,7 +353,7 @@ std::istream& LLSDParser::get(
|
|||
char delim) const
|
||||
{
|
||||
istr.get(sb, delim);
|
||||
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
|
||||
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
|
||||
return istr;
|
||||
}
|
||||
|
||||
|
|
@ -377,7 +377,7 @@ std::istream& LLSDParser::read(
|
|||
std::streamsize n) const
|
||||
{
|
||||
istr.read(s, n);
|
||||
if(mCheckLimits) mMaxBytesLeft -= istr.gcount();
|
||||
if(mCheckLimits) mMaxBytesLeft -= (int)istr.gcount();
|
||||
return istr;
|
||||
}
|
||||
|
||||
|
|
@ -789,7 +789,7 @@ bool LLSDNotationParser::parseBinary(std::istream& istr, LLSD& data) const
|
|||
if(len)
|
||||
{
|
||||
value.resize(len);
|
||||
account(fullread(istr, (char *)&value[0], len));
|
||||
account((int)fullread(istr, (char *)&value[0], len));
|
||||
}
|
||||
c = get(istr); // strip off the trailing double-quote
|
||||
data = value;
|
||||
|
|
@ -1069,7 +1069,7 @@ S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data) const
|
|||
if(size > 0)
|
||||
{
|
||||
value.resize(size);
|
||||
account(fullread(istr, (char*)&value[0], size));
|
||||
account((int)fullread(istr, (char*)&value[0], size));
|
||||
}
|
||||
data = value;
|
||||
}
|
||||
|
|
@ -1200,7 +1200,7 @@ bool LLSDBinaryParser::parseString(
|
|||
if(size)
|
||||
{
|
||||
buf.resize(size);
|
||||
account(fullread(istr, &buf[0], size));
|
||||
account((int)fullread(istr, &buf[0], size));
|
||||
value.assign(buf.begin(), buf.end());
|
||||
}
|
||||
return true;
|
||||
|
|
@ -1642,7 +1642,7 @@ int deserialize_string_raw(
|
|||
const S32 BUF_LEN = 20;
|
||||
char buf[BUF_LEN]; /* Flawfinder: ignore */
|
||||
istr.get(buf, BUF_LEN - 1, ')');
|
||||
count += istr.gcount();
|
||||
count += (int)istr.gcount();
|
||||
int c = istr.get();
|
||||
c = istr.get();
|
||||
count += 2;
|
||||
|
|
@ -1657,7 +1657,7 @@ int deserialize_string_raw(
|
|||
if(len)
|
||||
{
|
||||
buf.resize(len);
|
||||
count += fullread(istr, (char *)&buf[0], len);
|
||||
count += (int)fullread(istr, (char *)&buf[0], len);
|
||||
value.assign(buf.begin(), buf.end());
|
||||
}
|
||||
c = istr.get();
|
||||
|
|
|
|||
|
|
@ -464,7 +464,7 @@ S32 LLSDXMLParser::Impl::parseLines(std::istream& input, LLSD& data)
|
|||
}
|
||||
}
|
||||
|
||||
status = XML_ParseBuffer(mParser, num_read, false);
|
||||
status = XML_ParseBuffer(mParser, (int)num_read, false);
|
||||
if (status == XML_STATUS_ERROR)
|
||||
{
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ class LLSDParam<T> \
|
|||
{ \
|
||||
public: \
|
||||
LLSDParam(const LLSD& value): \
|
||||
_value(value.AS()) \
|
||||
_value((T)value.AS()) \
|
||||
{} \
|
||||
\
|
||||
operator T() const { return _value; } \
|
||||
|
|
|
|||
|
|
@ -593,7 +593,7 @@ void LLStatTime::stop()
|
|||
{
|
||||
if ( LLStatAccum::SCALE_PER_FRAME == scale )
|
||||
{
|
||||
return mTotalTimeInFrame;
|
||||
return (F32)mTotalTimeInFrame;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ U32 micro_sleep(U64 us, U32 max_yields)
|
|||
{
|
||||
// max_yields is unused; just fiddle with it to avoid warnings.
|
||||
max_yields = 0;
|
||||
ms_sleep(us / 1000);
|
||||
ms_sleep((U32)(us / 1000));
|
||||
return 0;
|
||||
}
|
||||
#elif LL_LINUX || LL_SOLARIS || LL_DARWIN
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
const S32 LL_VERSION_MAJOR = 3;
|
||||
const S32 LL_VERSION_MINOR = 3;
|
||||
const S32 LL_VERSION_PATCH = 0;
|
||||
const S32 LL_VERSION_PATCH = 1;
|
||||
const S32 LL_VERSION_BUILD = 0;
|
||||
|
||||
const char * const LL_CHANNEL = "Second Life Developer";
|
||||
|
|
|
|||
|
|
@ -250,7 +250,7 @@ void LLCrashLogger::gatherFiles()
|
|||
if(minidump_stream.is_open())
|
||||
{
|
||||
minidump_stream.seekg(0, std::ios::end);
|
||||
size_t length = minidump_stream.tellg();
|
||||
size_t length = (size_t)minidump_stream.tellg();
|
||||
minidump_stream.seekg(0, std::ios::beg);
|
||||
|
||||
LLSD::Binary data;
|
||||
|
|
|
|||
|
|
@ -501,10 +501,10 @@ void LLImageCompressionTester::outputTestRecord(LLSD *sd)
|
|||
F32 decompressionRate = 0.0f;
|
||||
F32 compressionRate = 0.0f;
|
||||
|
||||
F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.0;
|
||||
F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.0;
|
||||
F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.0;
|
||||
F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.0;
|
||||
F32 totalkBInDecompression = (F32)(mTotalBytesInDecompression) / 1000.f;
|
||||
F32 totalkBOutDecompression = (F32)(mTotalBytesOutDecompression) / 1000.f;
|
||||
F32 totalkBInCompression = (F32)(mTotalBytesInCompression) / 1000.f;
|
||||
F32 totalkBOutCompression = (F32)(mTotalBytesOutCompression) / 1000.f;
|
||||
|
||||
if (!is_approx_zero(mTotalTimeDecompression))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ U32 LLInventoryItem::getCRC32() const
|
|||
//lldebugs << "7 crc: " << std::hex << crc << std::dec << llendl;
|
||||
crc += mSaleInfo.getCRC32();
|
||||
//lldebugs << "8 crc: " << std::hex << crc << std::dec << llendl;
|
||||
crc += mCreationDate;
|
||||
crc += (U32)mCreationDate;
|
||||
//lldebugs << "9 crc: " << std::hex << crc << std::dec << llendl;
|
||||
return crc;
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ void LLInventoryItem::packMessage(LLMessageSystem* msg) const
|
|||
mSaleInfo.packMessage(msg);
|
||||
msg->addStringFast(_PREHASH_Name, mName);
|
||||
msg->addStringFast(_PREHASH_Description, mDescription);
|
||||
msg->addS32Fast(_PREHASH_CreationDate, mCreationDate);
|
||||
msg->addS32Fast(_PREHASH_CreationDate, (S32)mCreationDate);
|
||||
U32 crc = getCRC32();
|
||||
msg->addU32Fast(_PREHASH_CRC, crc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ private:
|
|||
F32 _log(const F32& a) const { return log(a); }
|
||||
F32 _exp(const F32& a) const { return exp(a); }
|
||||
F32 _fabs(const F32& a) const { return fabs(a); }
|
||||
F32 _floor(const F32& a) const { return llfloor(a); }
|
||||
F32 _floor(const F32& a) const { return (F32)llfloor(a); }
|
||||
F32 _ceil(const F32& a) const { return llceil(a); }
|
||||
|
||||
F32 _atan2(const F32& a,const F32& b) const { return atan2(a,b); }
|
||||
|
|
|
|||
|
|
@ -26,80 +26,80 @@
|
|||
#ifndef LL_LLCOORD_H
|
||||
#define LL_LLCOORD_H
|
||||
|
||||
struct LLCoordCommon
|
||||
{
|
||||
LLCoordCommon(S32 x, S32 y) : mX(x), mY(y) {}
|
||||
LLCoordCommon() : mX(0), mY(0) {}
|
||||
S32 mX;
|
||||
S32 mY;
|
||||
};
|
||||
|
||||
// A two-dimensional pixel value
|
||||
class LLCoord
|
||||
template<typename COORD_FRAME>
|
||||
class LLCoord : protected COORD_FRAME
|
||||
{
|
||||
public:
|
||||
S32 mX;
|
||||
S32 mY;
|
||||
typedef LLCoord<COORD_FRAME> self_t;
|
||||
typename COORD_FRAME::value_t mX;
|
||||
typename COORD_FRAME::value_t mY;
|
||||
|
||||
LLCoord(): mX(0), mY(0)
|
||||
{}
|
||||
LLCoord(S32 x, S32 y): mX(x), mY(y)
|
||||
{}
|
||||
virtual ~LLCoord()
|
||||
{}
|
||||
|
||||
virtual void set(S32 x, S32 y) { mX = x; mY = y; }
|
||||
LLCoord(const LLCoordCommon& other)
|
||||
{
|
||||
COORD_FRAME::convertFromCommon(other);
|
||||
}
|
||||
|
||||
LLCoordCommon convert() const
|
||||
{
|
||||
return COORD_FRAME::convertToCommon();
|
||||
}
|
||||
|
||||
void set(S32 x, S32 y) { mX = x; mY = y;}
|
||||
bool operator==(const self_t& other) const { return mX == other.mX && mY == other.mY; }
|
||||
bool operator!=(const self_t& other) const { return !(*this == other); }
|
||||
|
||||
};
|
||||
|
||||
|
||||
// GL coordinates start in the client region of a window,
|
||||
// with left, bottom = 0, 0
|
||||
class LLCoordGL : public LLCoord
|
||||
struct LL_COORD_TYPE_GL
|
||||
{
|
||||
public:
|
||||
LLCoordGL() : LLCoord()
|
||||
{}
|
||||
LLCoordGL(S32 x, S32 y) : LLCoord(x, y)
|
||||
{}
|
||||
bool operator==(const LLCoordGL& other) const { return mX == other.mX && mY == other.mY; }
|
||||
bool operator!=(const LLCoordGL& other) const { return !(*this == other); }
|
||||
typedef S32 value_t;
|
||||
|
||||
LLCoordCommon convertToCommon() const
|
||||
{
|
||||
const LLCoord<LL_COORD_TYPE_GL>& self = static_cast<const LLCoord<LL_COORD_TYPE_GL>&>(*this);
|
||||
return LLCoordCommon(self.mX, self.mY);
|
||||
}
|
||||
|
||||
void convertFromCommon(const LLCoordCommon& from)
|
||||
{
|
||||
LLCoord<LL_COORD_TYPE_GL>& self = static_cast<LLCoord<LL_COORD_TYPE_GL>&>(*this);
|
||||
self.mX = from.mX;
|
||||
self.mY = from.mY;
|
||||
}
|
||||
};
|
||||
|
||||
//bool operator ==(const LLCoordGL& a, const LLCoordGL& b);
|
||||
|
||||
// Window coords include things like window borders,
|
||||
// menu regions, etc.
|
||||
class LLCoordWindow : public LLCoord
|
||||
struct LL_COORD_TYPE_WINDOW
|
||||
{
|
||||
public:
|
||||
LLCoordWindow() : LLCoord()
|
||||
{}
|
||||
LLCoordWindow(S32 x, S32 y) : LLCoord(x, y)
|
||||
{}
|
||||
bool operator==(const LLCoordWindow& other) const { return mX == other.mX && mY == other.mY; }
|
||||
bool operator!=(const LLCoordWindow& other) const { return !(*this == other); }
|
||||
typedef S32 value_t;
|
||||
|
||||
LLCoordCommon convertToCommon() const;
|
||||
void convertFromCommon(const LLCoordCommon& from);
|
||||
};
|
||||
|
||||
|
||||
// Screen coords start at left, top = 0, 0
|
||||
class LLCoordScreen : public LLCoord
|
||||
struct LL_COORD_TYPE_SCREEN
|
||||
{
|
||||
public:
|
||||
LLCoordScreen() : LLCoord()
|
||||
{}
|
||||
LLCoordScreen(S32 x, S32 y) : LLCoord(x, y)
|
||||
{}
|
||||
bool operator==(const LLCoordScreen& other) const { return mX == other.mX && mY == other.mY; }
|
||||
bool operator!=(const LLCoordScreen& other) const { return !(*this == other); }
|
||||
typedef S32 value_t;
|
||||
|
||||
LLCoordCommon convertToCommon() const;
|
||||
void convertFromCommon(const LLCoordCommon& from);
|
||||
};
|
||||
|
||||
class LLCoordFont : public LLCoord
|
||||
{
|
||||
public:
|
||||
F32 mZ;
|
||||
|
||||
LLCoordFont() : LLCoord(), mZ(0.f)
|
||||
{}
|
||||
LLCoordFont(S32 x, S32 y, F32 z = 0) : LLCoord(x,y), mZ(z)
|
||||
{}
|
||||
|
||||
void set(S32 x, S32 y) { LLCoord::set(x,y); mZ = 0.f; }
|
||||
void set(S32 x, S32 y, F32 z) { mX = x; mY = y; mZ = z; }
|
||||
bool operator==(const LLCoordFont& other) const { return mX == other.mX && mY == other.mY; }
|
||||
bool operator!=(const LLCoordFont& other) const { return !(*this == other); }
|
||||
};
|
||||
|
||||
typedef LLCoord<LL_COORD_TYPE_GL> LLCoordGL;
|
||||
typedef LLCoord<LL_COORD_TYPE_WINDOW> LLCoordWindow;
|
||||
typedef LLCoord<LL_COORD_TYPE_SCREEN> LLCoordScreen;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -2904,7 +2904,7 @@ F32 LLVolume::sculptGetSurfaceArea()
|
|||
// compute the area of the quad by taking the length of the cross product of the two triangles
|
||||
LLVector3 cross1 = (p1 - p2) % (p1 - p3);
|
||||
LLVector3 cross2 = (p4 - p2) % (p4 - p3);
|
||||
area += (cross1.magVec() + cross2.magVec()) / 2.0;
|
||||
area += (cross1.magVec() + cross2.magVec()) / 2.f;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5890,7 +5890,7 @@ F32 find_vertex_score(LLVCacheVertexData& data)
|
|||
}
|
||||
|
||||
//bonus points for having low valence
|
||||
F32 valence_boost = powf(data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
|
||||
F32 valence_boost = powf((F32)data.mActiveTriangles, -FindVertexScore_ValenceBoostPower);
|
||||
score += FindVertexScore_ValenceBoostScale * valence_boost;
|
||||
|
||||
return score;
|
||||
|
|
|
|||
|
|
@ -858,25 +858,25 @@ LLSD LLMatrix4::getValue() const
|
|||
|
||||
void LLMatrix4::setValue(const LLSD& data)
|
||||
{
|
||||
mMatrix[0][0] = data[0].asReal();
|
||||
mMatrix[0][1] = data[1].asReal();
|
||||
mMatrix[0][2] = data[2].asReal();
|
||||
mMatrix[0][3] = data[3].asReal();
|
||||
mMatrix[0][0] = (F32)data[0].asReal();
|
||||
mMatrix[0][1] = (F32)data[1].asReal();
|
||||
mMatrix[0][2] = (F32)data[2].asReal();
|
||||
mMatrix[0][3] = (F32)data[3].asReal();
|
||||
|
||||
mMatrix[1][0] = data[4].asReal();
|
||||
mMatrix[1][1] = data[5].asReal();
|
||||
mMatrix[1][2] = data[6].asReal();
|
||||
mMatrix[1][3] = data[7].asReal();
|
||||
mMatrix[1][0] = (F32)data[4].asReal();
|
||||
mMatrix[1][1] = (F32)data[5].asReal();
|
||||
mMatrix[1][2] = (F32)data[6].asReal();
|
||||
mMatrix[1][3] = (F32)data[7].asReal();
|
||||
|
||||
mMatrix[2][0] = data[8].asReal();
|
||||
mMatrix[2][1] = data[9].asReal();
|
||||
mMatrix[2][2] = data[10].asReal();
|
||||
mMatrix[2][3] = data[11].asReal();
|
||||
mMatrix[2][0] = (F32)data[8].asReal();
|
||||
mMatrix[2][1] = (F32)data[9].asReal();
|
||||
mMatrix[2][2] = (F32)data[10].asReal();
|
||||
mMatrix[2][3] = (F32)data[11].asReal();
|
||||
|
||||
mMatrix[3][0] = data[12].asReal();
|
||||
mMatrix[3][1] = data[13].asReal();
|
||||
mMatrix[3][2] = data[14].asReal();
|
||||
mMatrix[3][3] = data[15].asReal();
|
||||
mMatrix[3][0] = (F32)data[12].asReal();
|
||||
mMatrix[3][1] = (F32)data[13].asReal();
|
||||
mMatrix[3][2] = (F32)data[14].asReal();
|
||||
mMatrix[3][3] = (F32)data[15].asReal();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -271,10 +271,10 @@ void LLCurl::Easy::releaseEasyHandle(CURL* handle)
|
|||
|
||||
if(sFreeHandles.size() < MAX_NUM_FREE_HANDLES)
|
||||
{
|
||||
sFreeHandles.insert(handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
sFreeHandles.insert(handle);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLCurl::deleteEasyHandle(handle) ;
|
||||
}
|
||||
}
|
||||
|
|
@ -453,9 +453,9 @@ size_t curlReadCallback(char* data, size_t size, size_t nmemb, void* user_data)
|
|||
LLCurl::Easy* easy = (LLCurl::Easy*)user_data;
|
||||
|
||||
S32 n = size * nmemb;
|
||||
S32 startpos = easy->getInput().tellg();
|
||||
S32 startpos = (S32)easy->getInput().tellg();
|
||||
easy->getInput().seekg(0, std::ios::end);
|
||||
S32 endpos = easy->getInput().tellg();
|
||||
S32 endpos = (S32)easy->getInput().tellg();
|
||||
easy->getInput().seekg(startpos, std::ios::beg);
|
||||
S32 maxn = endpos - startpos;
|
||||
n = llmin(n, maxn);
|
||||
|
|
@ -560,16 +560,16 @@ LLCurl::Multi::Multi(F32 idle_time_out)
|
|||
}
|
||||
|
||||
//llassert_always(mCurlMultiHandle);
|
||||
|
||||
|
||||
if(mCurlMultiHandle)
|
||||
{
|
||||
if(LLCurl::getCurlThread()->getThreaded())
|
||||
{
|
||||
mMutexp = new LLMutex(NULL) ;
|
||||
mDeletionMutexp = new LLMutex(NULL) ;
|
||||
mEasyMutexp = new LLMutex(NULL) ;
|
||||
}
|
||||
LLCurl::getCurlThread()->addMulti(this) ;
|
||||
if(LLCurl::getCurlThread()->getThreaded())
|
||||
{
|
||||
mMutexp = new LLMutex(NULL) ;
|
||||
mDeletionMutexp = new LLMutex(NULL) ;
|
||||
mEasyMutexp = new LLMutex(NULL) ;
|
||||
}
|
||||
LLCurl::getCurlThread()->addMulti(this) ;
|
||||
|
||||
mIdleTimeOut = idle_time_out ;
|
||||
if(mIdleTimeOut < LLCurl::sCurlRequestTimeOut)
|
||||
|
|
@ -577,8 +577,8 @@ LLCurl::Multi::Multi(F32 idle_time_out)
|
|||
mIdleTimeOut = LLCurl::sCurlRequestTimeOut ;
|
||||
}
|
||||
|
||||
++gCurlMultiCount;
|
||||
}
|
||||
++gCurlMultiCount;
|
||||
}
|
||||
}
|
||||
|
||||
LLCurl::Multi::~Multi()
|
||||
|
|
@ -617,7 +617,7 @@ void LLCurl::Multi::cleanup()
|
|||
mDeletionMutexp = NULL ;
|
||||
delete mEasyMutexp ;
|
||||
mEasyMutexp = NULL ;
|
||||
|
||||
|
||||
mQueued = 0 ;
|
||||
mState = STATE_COMPLETED;
|
||||
|
||||
|
|
@ -738,7 +738,7 @@ bool LLCurl::Multi::doPerform()
|
|||
}
|
||||
|
||||
mQueued = q;
|
||||
setState(STATE_COMPLETED) ;
|
||||
setState(STATE_COMPLETED) ;
|
||||
mIdleTimer.reset() ;
|
||||
}
|
||||
else if(mIdleTimer.getElapsedTimeF32() > mIdleTimeOut) //idle for too long, remove it.
|
||||
|
|
@ -911,8 +911,8 @@ bool LLCurlThread::CurlRequest::processRequest()
|
|||
|
||||
if(!completed)
|
||||
{
|
||||
setPriority(LLQueuedThread::PRIORITY_LOW) ;
|
||||
}
|
||||
setPriority(LLQueuedThread::PRIORITY_LOW) ;
|
||||
}
|
||||
}
|
||||
|
||||
return completed ;
|
||||
|
|
@ -922,7 +922,7 @@ void LLCurlThread::CurlRequest::finishRequest(bool completed)
|
|||
{
|
||||
if(mMulti->isDead())
|
||||
{
|
||||
mCurlThread->deleteMulti(mMulti) ;
|
||||
mCurlThread->deleteMulti(mMulti) ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -968,8 +968,8 @@ void LLCurlThread::killMulti(LLCurl::Multi* multi)
|
|||
|
||||
if(multi->isValid())
|
||||
{
|
||||
multi->markDead() ;
|
||||
}
|
||||
multi->markDead() ;
|
||||
}
|
||||
else
|
||||
{
|
||||
deleteMulti(multi) ;
|
||||
|
|
@ -1033,7 +1033,7 @@ void LLCurlRequest::addMulti()
|
|||
mActiveRequestCount = 0 ;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
mMultiSet.insert(multi);
|
||||
mActiveMulti = multi;
|
||||
mActiveRequestCount = 0;
|
||||
|
|
@ -1229,15 +1229,15 @@ LLCurlEasyRequest::LLCurlEasyRequest()
|
|||
|
||||
if(mMulti->isValid())
|
||||
{
|
||||
mEasy = mMulti->allocEasy();
|
||||
if (mEasy)
|
||||
{
|
||||
mEasy->setErrorBuffer();
|
||||
mEasy->setCA();
|
||||
// Set proxy settings if configured to do so.
|
||||
LLProxy::getInstance()->applyProxySettings(mEasy);
|
||||
}
|
||||
mEasy = mMulti->allocEasy();
|
||||
if (mEasy)
|
||||
{
|
||||
mEasy->setErrorBuffer();
|
||||
mEasy->setCA();
|
||||
// Set proxy settings if configured to do so.
|
||||
LLProxy::getInstance()->applyProxySettings(mEasy);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LLCurl::getCurlThread()->killMulti(mMulti) ;
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ namespace
|
|||
if(fstream.is_open())
|
||||
{
|
||||
fstream.seekg(0, std::ios::end);
|
||||
U32 fileSize = fstream.tellg();
|
||||
U32 fileSize = (U32)fstream.tellg();
|
||||
fstream.seekg(0, std::ios::beg);
|
||||
std::vector<char> fileBuffer(fileSize);
|
||||
fstream.read(&fileBuffer[0], fileSize);
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ bool LLMimeParser::Impl::parseHeaders(
|
|||
// not to read past limit when we get() the newline.
|
||||
S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
|
||||
istr.getline(mBuffer, max_get, '\r');
|
||||
mScanCount += istr.gcount();
|
||||
mScanCount += (S32)istr.gcount();
|
||||
int c = istr.get();
|
||||
if(EOF == c)
|
||||
{
|
||||
|
|
@ -496,7 +496,7 @@ void LLMimeParser::Impl::scanPastSeparator(
|
|||
// past limit when we get() the newline.
|
||||
S32 max_get = llmin((S32)LINE_BUFFER_LENGTH, limit - mScanCount - 1);
|
||||
istr.getline(mBuffer, max_get, '\r');
|
||||
mScanCount += istr.gcount();
|
||||
mScanCount += (S32)istr.gcount();
|
||||
if(istr.gcount() >= LINE_BUFFER_LENGTH - 1)
|
||||
{
|
||||
// that's way too long to be a separator, so ignore it.
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ bool LLSDMessage::httpListener(const LLSD& request)
|
|||
request,
|
||||
url, "POST", reply, error),
|
||||
LLSD(), // headers
|
||||
timeout);
|
||||
(F32)timeout);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ void LLSDMessageBuilder::copyFromMessageData(const LLMsgData& data)
|
|||
|
||||
// S64 not supported in LLSD so we just truncate it
|
||||
case MVT_S64:
|
||||
addS32(varname, *(S64*)mvci.getData());
|
||||
addS32(varname, (S32)*(S64*)mvci.getData());
|
||||
break;
|
||||
|
||||
case MVT_F32:
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "message.h"
|
||||
#include "lltimer.h"
|
||||
#include "llextendedstatus.h"
|
||||
|
||||
const S32 LL_XFER_LARGE_PAYLOAD = 7680;
|
||||
|
||||
|
|
|
|||
|
|
@ -3147,7 +3147,7 @@ bool LLMessageSystem::generateDigestForWindowAndUUIDs(char* digest, const S32 wi
|
|||
LL_ERRS("Messaging") << "Trying to generate complex digest on a machine without a shared secret!" << llendl;
|
||||
}
|
||||
|
||||
U32 now = time(NULL);
|
||||
U32 now = (U32)time(NULL);
|
||||
|
||||
now /= window;
|
||||
|
||||
|
|
@ -3167,7 +3167,7 @@ bool LLMessageSystem::isMatchingDigestForWindowAndUUIDs(const char* digest, cons
|
|||
}
|
||||
|
||||
char our_digest[MD5HEX_STR_SIZE]; /* Flawfinder: ignore */
|
||||
U32 now = time(NULL);
|
||||
U32 now = (U32)time(NULL);
|
||||
|
||||
now /= window;
|
||||
|
||||
|
|
@ -3213,7 +3213,7 @@ bool LLMessageSystem::generateDigestForWindow(char* digest, const S32 window) co
|
|||
LL_ERRS("Messaging") << "Trying to generate simple digest on a machine without a shared secret!" << llendl;
|
||||
}
|
||||
|
||||
U32 now = time(NULL);
|
||||
U32 now = (U32)time(NULL);
|
||||
|
||||
now /= window;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,8 +56,9 @@ std::string LLFontGL::sAppDir;
|
|||
LLColor4 LLFontGL::sShadowColor(0.f, 0.f, 0.f, 1.f);
|
||||
LLFontRegistry* LLFontGL::sFontRegistry = NULL;
|
||||
|
||||
LLCoordFont LLFontGL::sCurOrigin;
|
||||
std::vector<LLCoordFont> LLFontGL::sOriginStack;
|
||||
LLCoordGL LLFontGL::sCurOrigin;
|
||||
F32 LLFontGL::sCurDepth;
|
||||
std::vector<std::pair<LLCoordGL, F32> > LLFontGL::sOriginStack;
|
||||
|
||||
const F32 EXT_X_BEARING = 1.f;
|
||||
const F32 EXT_Y_BEARING = 0.f;
|
||||
|
|
@ -68,20 +69,6 @@ const F32 PIXEL_CORRECTION_DISTANCE = 0.01f;
|
|||
const F32 PAD_UVY = 0.5f; // half of vertical padding between glyphs in the glyph texture
|
||||
const F32 DROP_SHADOW_SOFT_STRENGTH = 0.3f;
|
||||
|
||||
static F32 llfont_round_x(F32 x)
|
||||
{
|
||||
//return llfloor((x-LLFontGL::sCurOrigin.mX)/LLFontGL::sScaleX+0.5f)*LLFontGL::sScaleX+LLFontGL::sCurOrigin.mX;
|
||||
//return llfloor(x/LLFontGL::sScaleX+0.5f)*LLFontGL::sScaleY;
|
||||
return x;
|
||||
}
|
||||
|
||||
static F32 llfont_round_y(F32 y)
|
||||
{
|
||||
//return llfloor((y-LLFontGL::sCurOrigin.mY)/LLFontGL::sScaleY+0.5f)*LLFontGL::sScaleY+LLFontGL::sCurOrigin.mY;
|
||||
//return llfloor(y+0.5f);
|
||||
return y;
|
||||
}
|
||||
|
||||
LLFontGL::LLFontGL()
|
||||
{
|
||||
}
|
||||
|
|
@ -115,23 +102,23 @@ static LLFastTimer::DeclareTimer FTM_RENDER_FONTS("Fonts");
|
|||
S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, const LLRect& rect, const LLColor4 &color, HAlign halign, VAlign valign, U8 style,
|
||||
ShadowType shadow, S32 max_chars, F32* right_x, BOOL use_ellipses) const
|
||||
{
|
||||
F32 x = rect.mLeft;
|
||||
F32 x = (F32)rect.mLeft;
|
||||
F32 y = 0.f;
|
||||
|
||||
switch(valign)
|
||||
{
|
||||
case TOP:
|
||||
y = rect.mTop;
|
||||
y = (F32)rect.mTop;
|
||||
break;
|
||||
case VCENTER:
|
||||
y = rect.getCenterY();
|
||||
y = (F32)rect.getCenterY();
|
||||
break;
|
||||
case BASELINE:
|
||||
case BOTTOM:
|
||||
y = rect.mBottom;
|
||||
y = (F32)rect.mBottom;
|
||||
break;
|
||||
default:
|
||||
y = rect.mBottom;
|
||||
y = (F32)rect.mBottom;
|
||||
break;
|
||||
}
|
||||
return render(wstr, begin_offset, x, y, color, halign, valign, style, shadow, max_chars, rect.getWidth(), right_x, use_ellipses);
|
||||
|
|
@ -177,21 +164,11 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
|
||||
gGL.loadUIIdentity();
|
||||
|
||||
//gGL.translateUI(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY), sCurOrigin.mZ);
|
||||
|
||||
// this code snaps the text origin to a pixel grid to start with
|
||||
//F32 pixel_offset_x = llround((F32)sCurOrigin.mX) - (sCurOrigin.mX);
|
||||
//F32 pixel_offset_y = llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
|
||||
//gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f);
|
||||
|
||||
LLVector2 origin(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY));
|
||||
// snap the text origin to a pixel grid to start with
|
||||
origin.mV[VX] -= llround((F32)sCurOrigin.mX) - (sCurOrigin.mX);
|
||||
origin.mV[VY] -= llround((F32)sCurOrigin.mY) - (sCurOrigin.mY);
|
||||
|
||||
// Depth translation, so that floating text appears 'inworld'
|
||||
// and is correclty occluded.
|
||||
gGL.translatef(0.f,0.f,sCurOrigin.mZ);
|
||||
// Depth translation, so that floating text appears 'in-world'
|
||||
// and is correctly occluded.
|
||||
gGL.translatef(0.f,0.f,sCurDepth);
|
||||
|
||||
S32 chars_drawn = 0;
|
||||
S32 i;
|
||||
|
|
@ -215,16 +192,17 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
cur_y = ((F32)y * sScaleY) + origin.mV[VY];
|
||||
|
||||
// Offset y by vertical alignment.
|
||||
// use unscaled font metrics here
|
||||
switch (valign)
|
||||
{
|
||||
case TOP:
|
||||
cur_y -= mFontFreetype->getAscenderHeight();
|
||||
cur_y -= llceil(mFontFreetype->getAscenderHeight());
|
||||
break;
|
||||
case BOTTOM:
|
||||
cur_y += mFontFreetype->getDescenderHeight();
|
||||
cur_y += llceil(mFontFreetype->getDescenderHeight());
|
||||
break;
|
||||
case VCENTER:
|
||||
cur_y -= (mFontFreetype->getAscenderHeight() - mFontFreetype->getDescenderHeight()) / 2.f;
|
||||
cur_y -= llceil((llceil(mFontFreetype->getAscenderHeight()) - llceil(mFontFreetype->getDescenderHeight())) / 2.f);
|
||||
break;
|
||||
case BASELINE:
|
||||
// Baseline, do nothing.
|
||||
|
|
@ -250,7 +228,7 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
cur_render_y = cur_y;
|
||||
cur_render_x = cur_x;
|
||||
|
||||
F32 start_x = llround(cur_x);
|
||||
F32 start_x = (F32)llround(cur_x);
|
||||
|
||||
const LLFontBitmapCache* font_bitmap_cache = mFontFreetype->getFontBitmapCache();
|
||||
|
||||
|
|
@ -334,10 +312,10 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
(fgi->mXBitmapOffset + fgi->mWidth) * inv_width,
|
||||
(fgi->mYBitmapOffset - PAD_UVY) * inv_height);
|
||||
// snap glyph origin to whole screen pixel
|
||||
LLRectf screen_rect(llround(cur_render_x + (F32)fgi->mXBearing),
|
||||
llround(cur_render_y + (F32)fgi->mYBearing),
|
||||
llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
|
||||
llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
|
||||
LLRectf screen_rect((F32)llround(cur_render_x + (F32)fgi->mXBearing),
|
||||
(F32)llround(cur_render_y + (F32)fgi->mYBearing),
|
||||
(F32)llround(cur_render_x + (F32)fgi->mXBearing) + (F32)fgi->mWidth,
|
||||
(F32)llround(cur_render_y + (F32)fgi->mYBearing) - (F32)fgi->mHeight);
|
||||
|
||||
if (glyph_count >= GLYPH_BATCH_SIZE)
|
||||
{
|
||||
|
|
@ -390,12 +368,12 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons
|
|||
//FIXME: add underline as glyph?
|
||||
if (style_to_add & UNDERLINE)
|
||||
{
|
||||
F32 descender = mFontFreetype->getDescenderHeight();
|
||||
F32 descender = (F32)llfloor(mFontFreetype->getDescenderHeight());
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.begin(LLRender::LINES);
|
||||
gGL.vertex2f(start_x, cur_y - (descender));
|
||||
gGL.vertex2f(cur_x, cur_y - (descender));
|
||||
gGL.vertex2f(start_x, cur_y - descender);
|
||||
gGL.vertex2f(cur_x, cur_y - descender);
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
|
|
@ -444,19 +422,9 @@ S32 LLFontGL::renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y
|
|||
}
|
||||
|
||||
// font metrics - override for LLFontFreetype that returns units of virtual pixels
|
||||
F32 LLFontGL::getLineHeight() const
|
||||
S32 LLFontGL::getLineHeight() const
|
||||
{
|
||||
return (F32)llround(mFontFreetype->getLineHeight() / sScaleY);
|
||||
}
|
||||
|
||||
F32 LLFontGL::getAscenderHeight() const
|
||||
{
|
||||
return (F32)llround(mFontFreetype->getAscenderHeight() / sScaleY);
|
||||
}
|
||||
|
||||
F32 LLFontGL::getDescenderHeight() const
|
||||
{
|
||||
return (F32)llround(mFontFreetype->getDescenderHeight() / sScaleY);
|
||||
return llceil(mFontFreetype->getAscenderHeight() / sScaleY) + llceil(mFontFreetype->getDescenderHeight() / sScaleY);
|
||||
}
|
||||
|
||||
S32 LLFontGL::getWidth(const std::string& utf8text) const
|
||||
|
|
@ -645,7 +613,7 @@ S32 LLFontGL::maxDrawableChars(const llwchar* wchars, F32 max_pixels, S32 max_ch
|
|||
}
|
||||
|
||||
// Round after kerning.
|
||||
cur_x = llround(cur_x);
|
||||
cur_x = (F32)llround(cur_x);
|
||||
drawn_x = cur_x;
|
||||
}
|
||||
|
||||
|
|
@ -716,7 +684,7 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_
|
|||
}
|
||||
|
||||
// Round after kerning.
|
||||
total_width = llround(total_width);
|
||||
total_width = (F32)llround(total_width);
|
||||
}
|
||||
|
||||
if (drawable_chars == 0)
|
||||
|
|
@ -799,7 +767,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t
|
|||
|
||||
|
||||
// Round after kerning.
|
||||
cur_x = llround(cur_x);
|
||||
cur_x = (F32)llround(cur_x);
|
||||
}
|
||||
|
||||
return llmin(max_chars, pos - begin_offset);
|
||||
|
|
@ -1146,22 +1114,22 @@ void LLFontGL::renderQuad(LLVector3* vertex_out, LLVector2* uv_out, LLColor4U* c
|
|||
{
|
||||
S32 index = 0;
|
||||
|
||||
vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mTop), 0.f);
|
||||
vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mTop, 0.f);
|
||||
uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mTop);
|
||||
colors_out[index] = color;
|
||||
index++;
|
||||
|
||||
vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mTop), 0.f);
|
||||
vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 0.f);
|
||||
uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mTop);
|
||||
colors_out[index] = color;
|
||||
index++;
|
||||
|
||||
vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mLeft), llfont_round_y(screen_rect.mBottom), 0.f);
|
||||
vertex_out[index] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 0.f);
|
||||
uv_out[index] = LLVector2(uv_rect.mLeft, uv_rect.mBottom);
|
||||
colors_out[index] = color;
|
||||
index++;
|
||||
|
||||
vertex_out[index] = LLVector3(llfont_round_x(screen_rect.mRight), llfont_round_y(screen_rect.mBottom), 0.f);
|
||||
vertex_out[index] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 0.f);
|
||||
uv_out[index] = LLVector2(uv_rect.mRight, uv_rect.mBottom);
|
||||
colors_out[index] = color;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -115,9 +115,7 @@ public:
|
|||
S32 renderUTF8(const std::string &text, S32 begin_offset, S32 x, S32 y, const LLColor4 &color, HAlign halign, VAlign valign, U8 style = NORMAL, ShadowType shadow = NO_SHADOW) const;
|
||||
|
||||
// font metrics - override for LLFontFreetype that returns units of virtual pixels
|
||||
F32 getLineHeight() const;
|
||||
F32 getAscenderHeight() const;
|
||||
F32 getDescenderHeight() const;
|
||||
S32 getLineHeight() const;
|
||||
|
||||
S32 getWidth(const std::string& utf8text) const;
|
||||
S32 getWidth(const llwchar* wchars) const;
|
||||
|
|
@ -188,8 +186,9 @@ public:
|
|||
static std::string getFontPathLocal();
|
||||
static std::string getFontPathSystem();
|
||||
|
||||
static LLCoordFont sCurOrigin;
|
||||
static std::vector<LLCoordFont> sOriginStack;
|
||||
static LLCoordGL sCurOrigin;
|
||||
static F32 sCurDepth;
|
||||
static std::vector<std::pair<LLCoordGL, F32> > sOriginStack;
|
||||
|
||||
static LLColor4 sShadowColor;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,10 +64,23 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
|
|||
}
|
||||
|
||||
LLShaderFeatures::LLShaderFeatures()
|
||||
: calculatesLighting(false), isShiny(false), isFullbright(false), hasWaterFog(false),
|
||||
hasTransport(false), hasSkinning(false), hasObjectSkinning(false), hasAtmospherics(false), isSpecular(false),
|
||||
hasGamma(false), hasLighting(false), isAlphaLighting(false), calculatesAtmospherics(false), mIndexedTextureChannels(0), disableTextureIndex(false),
|
||||
hasAlphaMask(false)
|
||||
: atmosphericHelpers(false)
|
||||
, calculatesLighting(false)
|
||||
, calculatesAtmospherics(false)
|
||||
, hasLighting(false)
|
||||
, isAlphaLighting(false)
|
||||
, isShiny(false)
|
||||
, isFullbright(false)
|
||||
, isSpecular(false)
|
||||
, hasWaterFog(false)
|
||||
, hasTransport(false)
|
||||
, hasSkinning(false)
|
||||
, hasObjectSkinning(false)
|
||||
, hasAtmospherics(false)
|
||||
, hasGamma(false)
|
||||
, mIndexedTextureChannels(0)
|
||||
, disableTextureIndex(false)
|
||||
, hasAlphaMask(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
class LLShaderFeatures
|
||||
{
|
||||
public:
|
||||
bool atmosphericHelpers;
|
||||
bool calculatesLighting;
|
||||
bool calculatesAtmospherics;
|
||||
bool hasLighting; // implies no transport (it's possible to have neither though)
|
||||
|
|
|
|||
|
|
@ -94,13 +94,16 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
|
|||
}
|
||||
}
|
||||
|
||||
if (features->calculatesLighting)
|
||||
if (features->calculatesLighting || features->atmosphericHelpers)
|
||||
{
|
||||
if (!shader->attachObject("windlight/atmosphericsHelpersV.glsl"))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (features->calculatesLighting)
|
||||
{
|
||||
if (features->isSpecular)
|
||||
{
|
||||
if (!shader->attachObject("lighting/lightFuncSpecularV.glsl"))
|
||||
|
|
|
|||
|
|
@ -53,31 +53,31 @@ U32 nhpo2(U32 v)
|
|||
//============================================================================
|
||||
|
||||
//static
|
||||
LLVBOPool LLVertexBuffer::sStreamVBOPool;
|
||||
LLVBOPool LLVertexBuffer::sDynamicVBOPool;
|
||||
LLVBOPool LLVertexBuffer::sStreamIBOPool;
|
||||
LLVBOPool LLVertexBuffer::sDynamicIBOPool;
|
||||
LLVBOPool LLVertexBuffer::sStreamVBOPool(GL_STREAM_DRAW_ARB, GL_ARRAY_BUFFER_ARB);
|
||||
LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW_ARB, GL_ARRAY_BUFFER_ARB);
|
||||
LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB);
|
||||
LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB);
|
||||
U32 LLVBOPool::sBytesPooled = 0;
|
||||
|
||||
LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL ;
|
||||
LLPrivateMemoryPool* LLVertexBuffer::sPrivatePoolp = NULL;
|
||||
U32 LLVertexBuffer::sBindCount = 0;
|
||||
U32 LLVertexBuffer::sSetCount = 0;
|
||||
S32 LLVertexBuffer::sCount = 0;
|
||||
S32 LLVertexBuffer::sGLCount = 0;
|
||||
S32 LLVertexBuffer::sMappedCount = 0;
|
||||
BOOL LLVertexBuffer::sDisableVBOMapping = FALSE ;
|
||||
BOOL LLVertexBuffer::sEnableVBOs = TRUE;
|
||||
bool LLVertexBuffer::sDisableVBOMapping = false;
|
||||
bool LLVertexBuffer::sEnableVBOs = true;
|
||||
U32 LLVertexBuffer::sGLRenderBuffer = 0;
|
||||
U32 LLVertexBuffer::sGLRenderArray = 0;
|
||||
U32 LLVertexBuffer::sGLRenderIndices = 0;
|
||||
U32 LLVertexBuffer::sLastMask = 0;
|
||||
BOOL LLVertexBuffer::sVBOActive = FALSE;
|
||||
BOOL LLVertexBuffer::sIBOActive = FALSE;
|
||||
bool LLVertexBuffer::sVBOActive = false;
|
||||
bool LLVertexBuffer::sIBOActive = false;
|
||||
U32 LLVertexBuffer::sAllocatedBytes = 0;
|
||||
BOOL LLVertexBuffer::sMapped = FALSE;
|
||||
BOOL LLVertexBuffer::sUseStreamDraw = TRUE;
|
||||
BOOL LLVertexBuffer::sUseVAO = FALSE;
|
||||
BOOL LLVertexBuffer::sPreferStreamDraw = FALSE;
|
||||
bool LLVertexBuffer::sMapped = false;
|
||||
bool LLVertexBuffer::sUseStreamDraw = true;
|
||||
bool LLVertexBuffer::sUseVAO = false;
|
||||
bool LLVertexBuffer::sPreferStreamDraw = false;
|
||||
|
||||
const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000; //1 ms
|
||||
|
||||
|
|
@ -204,15 +204,14 @@ void LLVBOPool::release(U32 name, volatile U8* buffer, U32 size)
|
|||
Record rec;
|
||||
rec.mGLName = name;
|
||||
rec.mClientData = buffer;
|
||||
|
||||
sBytesPooled += size;
|
||||
|
||||
if (!LLVertexBuffer::sDisableVBOMapping && mUsage == GL_DYNAMIC_DRAW_ARB)
|
||||
if (buffer == NULL)
|
||||
{
|
||||
glDeleteBuffersARB(1, &rec.mGLName);
|
||||
}
|
||||
else
|
||||
{
|
||||
sBytesPooled += size;
|
||||
mFreeList[i].push_back(rec);
|
||||
}
|
||||
}
|
||||
|
|
@ -283,7 +282,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
{
|
||||
if (sLastMask != data_mask)
|
||||
{
|
||||
BOOL error = FALSE;
|
||||
bool error = false;
|
||||
|
||||
if (LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
|
|
@ -344,7 +343,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
{
|
||||
if (gDebugSession)
|
||||
{
|
||||
error = TRUE;
|
||||
error = true;
|
||||
gFailLog << "Bad client state! " << array[i] << " disabled." << std::endl;
|
||||
}
|
||||
else
|
||||
|
|
@ -364,7 +363,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
|
|||
{ //needs to be disabled, make sure it was (DEBUG TEMPORARY)
|
||||
if (gDebugSession)
|
||||
{
|
||||
error = TRUE;
|
||||
error = true;
|
||||
gFailLog << "Bad client state! " << array[i] << " enabled." << std::endl;
|
||||
}
|
||||
else
|
||||
|
|
@ -430,7 +429,7 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
|
|||
|
||||
U32 count = pos.size();
|
||||
llassert_always(norm.size() >= pos.size());
|
||||
llassert_always(count > 0) ;
|
||||
llassert_always(count > 0);
|
||||
|
||||
unbind();
|
||||
|
||||
|
|
@ -548,7 +547,7 @@ void LLVertexBuffer::validateRange(U32 start, U32 end, U32 count, U32 indices_of
|
|||
void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indices_offset) const
|
||||
{
|
||||
validateRange(start, end, count, indices_offset);
|
||||
mMappable = FALSE;
|
||||
mMappable = false;
|
||||
gGL.syncMatrices();
|
||||
|
||||
llassert(mNumVerts >= 0);
|
||||
|
|
@ -603,7 +602,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi
|
|||
void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
|
||||
{
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
mMappable = FALSE;
|
||||
mMappable = false;
|
||||
gGL.syncMatrices();
|
||||
|
||||
llassert(mNumIndices >= 0);
|
||||
|
|
@ -649,7 +648,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const
|
|||
void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
|
||||
{
|
||||
llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShaderPtr != NULL);
|
||||
mMappable = FALSE;
|
||||
mMappable = false;
|
||||
gGL.syncMatrices();
|
||||
|
||||
llassert(mNumVerts >= 0);
|
||||
|
|
@ -689,23 +688,13 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const
|
|||
//static
|
||||
void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping)
|
||||
{
|
||||
sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ;
|
||||
sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ;
|
||||
sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject;
|
||||
sDisableVBOMapping = sEnableVBOs && no_vbo_mapping;
|
||||
|
||||
if(!sPrivatePoolp)
|
||||
if (!sPrivatePoolp)
|
||||
{
|
||||
sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC) ;
|
||||
sPrivatePoolp = LLPrivateMemoryPoolManager::getInstance()->newPool(LLPrivateMemoryPool::STATIC);
|
||||
}
|
||||
|
||||
sStreamVBOPool.mType = GL_ARRAY_BUFFER_ARB;
|
||||
sStreamVBOPool.mUsage= GL_STREAM_DRAW_ARB;
|
||||
sStreamIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
|
||||
sStreamIBOPool.mUsage= GL_STREAM_DRAW_ARB;
|
||||
|
||||
sDynamicVBOPool.mType = GL_ARRAY_BUFFER_ARB;
|
||||
sDynamicVBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
|
||||
sDynamicIBOPool.mType = GL_ELEMENT_ARRAY_BUFFER_ARB;
|
||||
sDynamicIBOPool.mUsage= GL_DYNAMIC_DRAW_ARB;
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -718,18 +707,18 @@ void LLVertexBuffer::unbind()
|
|||
#endif
|
||||
sGLRenderArray = 0;
|
||||
sGLRenderIndices = 0;
|
||||
sIBOActive = FALSE;
|
||||
sIBOActive = false;
|
||||
}
|
||||
|
||||
if (sVBOActive)
|
||||
{
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
sVBOActive = FALSE;
|
||||
sVBOActive = false;
|
||||
}
|
||||
if (sIBOActive)
|
||||
{
|
||||
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
|
||||
sIBOActive = FALSE;
|
||||
sIBOActive = false;
|
||||
}
|
||||
|
||||
sGLRenderBuffer = 0;
|
||||
|
|
@ -751,73 +740,80 @@ void LLVertexBuffer::cleanupClass()
|
|||
|
||||
if(sPrivatePoolp)
|
||||
{
|
||||
LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp) ;
|
||||
sPrivatePoolp = NULL ;
|
||||
LLPrivateMemoryPoolManager::getInstance()->deletePool(sPrivatePoolp);
|
||||
sPrivatePoolp = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
S32 LLVertexBuffer::determineUsage(S32 usage)
|
||||
{
|
||||
S32 ret_usage = usage;
|
||||
|
||||
if (!sEnableVBOs)
|
||||
{
|
||||
ret_usage = 0;
|
||||
}
|
||||
|
||||
if (ret_usage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
|
||||
{
|
||||
ret_usage = 0;
|
||||
}
|
||||
|
||||
if (ret_usage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
|
||||
{
|
||||
ret_usage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
|
||||
if (ret_usage == 0 && LLRender::sGLCoreProfile)
|
||||
{ //MUST use VBOs for all rendering
|
||||
ret_usage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
|
||||
if (ret_usage && ret_usage != GL_STREAM_DRAW_ARB)
|
||||
{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
|
||||
if (sDisableVBOMapping)
|
||||
{ //always use stream draw if VBO mapping is disabled
|
||||
ret_usage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
else
|
||||
{
|
||||
ret_usage = GL_DYNAMIC_DRAW_ARB;
|
||||
}
|
||||
}
|
||||
|
||||
return ret_usage;
|
||||
}
|
||||
|
||||
LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
|
||||
LLRefCount(),
|
||||
|
||||
mNumVerts(0),
|
||||
mNumIndices(0),
|
||||
mUsage(usage),
|
||||
mAlignedOffset(0),
|
||||
mAlignedIndexOffset(0),
|
||||
mSize(0),
|
||||
mIndicesSize(0),
|
||||
mTypeMask(typemask),
|
||||
mUsage(LLVertexBuffer::determineUsage(usage)),
|
||||
mGLBuffer(0),
|
||||
mGLIndices(0),
|
||||
mGLArray(0),
|
||||
mGLIndices(0),
|
||||
mMappedData(NULL),
|
||||
mMappedIndexData(NULL),
|
||||
mVertexLocked(FALSE),
|
||||
mIndexLocked(FALSE),
|
||||
mFinal(FALSE),
|
||||
mEmpty(TRUE),
|
||||
mMappedIndexData(NULL),
|
||||
mMappedDataUsingVBOs(false),
|
||||
mMappedIndexDataUsingVBOs(false),
|
||||
mVertexLocked(false),
|
||||
mIndexLocked(false),
|
||||
mFinal(false),
|
||||
mEmpty(true),
|
||||
mMappable(false),
|
||||
mFence(NULL)
|
||||
{
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR);
|
||||
mFence = NULL;
|
||||
if (!sEnableVBOs)
|
||||
{
|
||||
mUsage = 0 ;
|
||||
}
|
||||
|
||||
if (mUsage == GL_STREAM_DRAW_ARB && !sUseStreamDraw)
|
||||
{
|
||||
mUsage = 0;
|
||||
}
|
||||
|
||||
if (mUsage == GL_DYNAMIC_DRAW_ARB && sPreferStreamDraw)
|
||||
{
|
||||
mUsage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
|
||||
if (mUsage == 0 && LLRender::sGLCoreProfile)
|
||||
{ //MUST use VBOs for all rendering
|
||||
mUsage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
|
||||
if (mUsage && mUsage != GL_STREAM_DRAW_ARB)
|
||||
{ //only stream_draw and dynamic_draw are supported when using VBOs, dynamic draw is the default
|
||||
if (sDisableVBOMapping)
|
||||
{ //always use stream draw if VBO mapping is disabled
|
||||
mUsage = GL_STREAM_DRAW_ARB;
|
||||
}
|
||||
else
|
||||
{
|
||||
mUsage = GL_DYNAMIC_DRAW_ARB;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping)
|
||||
{
|
||||
mMappable = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
mMappable = FALSE;
|
||||
}
|
||||
mMappable = (mUsage == GL_DYNAMIC_DRAW_ARB && !sDisableVBOMapping);
|
||||
|
||||
//zero out offsets
|
||||
for (U32 i = 0; i < TYPE_MAX; i++)
|
||||
|
|
@ -825,12 +821,6 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) :
|
|||
mOffsets[i] = 0;
|
||||
}
|
||||
|
||||
mTypeMask = typemask;
|
||||
mSize = 0;
|
||||
mIndicesSize = 0;
|
||||
mAlignedOffset = 0;
|
||||
mAlignedIndexOffset = 0;
|
||||
|
||||
sCount++;
|
||||
}
|
||||
|
||||
|
|
@ -902,7 +892,7 @@ LLVertexBuffer::~LLVertexBuffer()
|
|||
|
||||
mFence = NULL;
|
||||
|
||||
llassert_always(!mMappedData && !mMappedIndexData) ;
|
||||
llassert_always(!mMappedData && !mMappedIndexData);
|
||||
};
|
||||
|
||||
void LLVertexBuffer::placeFence() const
|
||||
|
|
@ -1011,9 +1001,11 @@ void LLVertexBuffer::createGLBuffer(U32 size)
|
|||
return;
|
||||
}
|
||||
|
||||
mEmpty = TRUE;
|
||||
mEmpty = true;
|
||||
|
||||
if (useVBOs())
|
||||
mMappedDataUsingVBOs = useVBOs();
|
||||
|
||||
if (mMappedDataUsingVBOs)
|
||||
{
|
||||
genBuffer(size);
|
||||
}
|
||||
|
|
@ -1040,12 +1032,14 @@ void LLVertexBuffer::createGLIndices(U32 size)
|
|||
return;
|
||||
}
|
||||
|
||||
mEmpty = TRUE;
|
||||
mEmpty = true;
|
||||
|
||||
//pad by 16 bytes for aligned copies
|
||||
size += 16;
|
||||
|
||||
if (useVBOs())
|
||||
mMappedIndexDataUsingVBOs = useVBOs();
|
||||
|
||||
if (mMappedIndexDataUsingVBOs)
|
||||
{
|
||||
//pad by another 16 bytes for VBO pointer adjustment
|
||||
size += 16;
|
||||
|
|
@ -1065,15 +1059,15 @@ void LLVertexBuffer::destroyGLBuffer()
|
|||
LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_BUFFER);
|
||||
if (mGLBuffer)
|
||||
{
|
||||
if (useVBOs())
|
||||
if (mMappedDataUsingVBOs)
|
||||
{
|
||||
releaseBuffer();
|
||||
}
|
||||
else
|
||||
{
|
||||
FREE_MEM(sPrivatePoolp, (void*) mMappedData) ;
|
||||
FREE_MEM(sPrivatePoolp, (void*) mMappedData);
|
||||
mMappedData = NULL;
|
||||
mEmpty = TRUE;
|
||||
mEmpty = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1086,15 +1080,15 @@ void LLVertexBuffer::destroyGLIndices()
|
|||
LLMemType mt2(LLMemType::MTYPE_VERTEX_DESTROY_INDICES);
|
||||
if (mGLIndices)
|
||||
{
|
||||
if (useVBOs())
|
||||
if (mMappedIndexDataUsingVBOs)
|
||||
{
|
||||
releaseIndices();
|
||||
}
|
||||
else
|
||||
{
|
||||
FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData) ;
|
||||
FREE_MEM(sPrivatePoolp, (void*) mMappedIndexData);
|
||||
mMappedIndexData = NULL;
|
||||
mEmpty = TRUE;
|
||||
mEmpty = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1279,16 +1273,10 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices)
|
|||
}
|
||||
}
|
||||
|
||||
BOOL LLVertexBuffer::useVBOs() const
|
||||
bool LLVertexBuffer::useVBOs() const
|
||||
{
|
||||
//it's generally ineffective to use VBO for things that are streaming on apple
|
||||
|
||||
if (!mUsage)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return (mUsage != 0);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -1368,7 +1356,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
|
|||
if (!mVertexLocked)
|
||||
{
|
||||
LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES);
|
||||
mVertexLocked = TRUE;
|
||||
mVertexLocked = true;
|
||||
sMappedCount++;
|
||||
stop_glerror();
|
||||
|
||||
|
|
@ -1447,17 +1435,17 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
|
|||
{
|
||||
log_glerror();
|
||||
|
||||
//check the availability of memory
|
||||
LLMemory::logMemoryInfo(TRUE) ;
|
||||
//check the availability of memory
|
||||
LLMemory::logMemoryInfo(true);
|
||||
|
||||
if(mMappable)
|
||||
{
|
||||
//--------------------
|
||||
//print out more debug info before crash
|
||||
llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl ;
|
||||
GLint size ;
|
||||
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size) ;
|
||||
llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl ;
|
||||
llinfos << "vertex buffer size: (num verts : num indices) = " << getNumVerts() << " : " << getNumIndices() << llendl;
|
||||
GLint size;
|
||||
glGetBufferParameterivARB(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SIZE_ARB, &size);
|
||||
llinfos << "GL_ARRAY_BUFFER_ARB size is " << size << llendl;
|
||||
//--------------------
|
||||
|
||||
GLint buff;
|
||||
|
|
@ -1472,7 +1460,7 @@ volatile U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, boo
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "memory allocation for vertex data failed." << llendl ;
|
||||
llerrs << "memory allocation for vertex data failed." << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1547,7 +1535,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
|
|||
{
|
||||
LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_INDICES);
|
||||
|
||||
mIndexLocked = TRUE;
|
||||
mIndexLocked = true;
|
||||
sMappedCount++;
|
||||
stop_glerror();
|
||||
|
||||
|
|
@ -1626,7 +1614,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
|
|||
if (!mMappedIndexData)
|
||||
{
|
||||
log_glerror();
|
||||
LLMemory::logMemoryInfo(TRUE) ;
|
||||
LLMemory::logMemoryInfo(true);
|
||||
|
||||
if(mMappable)
|
||||
{
|
||||
|
|
@ -1641,7 +1629,7 @@ volatile U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range
|
|||
}
|
||||
else
|
||||
{
|
||||
llerrs << "memory allocation for Index data failed. " << llendl ;
|
||||
llerrs << "memory allocation for Index data failed. " << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1672,10 +1660,10 @@ void LLVertexBuffer::unmapBuffer()
|
|||
LLMemType mt2(LLMemType::MTYPE_VERTEX_UNMAP_BUFFER);
|
||||
if (!useVBOs())
|
||||
{
|
||||
return ; //nothing to unmap
|
||||
return; //nothing to unmap
|
||||
}
|
||||
|
||||
bool updated_all = false ;
|
||||
bool updated_all = false;
|
||||
|
||||
if (mMappedData && mVertexLocked)
|
||||
{
|
||||
|
|
@ -1742,7 +1730,7 @@ void LLVertexBuffer::unmapBuffer()
|
|||
mMappedData = NULL;
|
||||
}
|
||||
|
||||
mVertexLocked = FALSE ;
|
||||
mVertexLocked = false;
|
||||
sMappedCount--;
|
||||
}
|
||||
|
||||
|
|
@ -1806,16 +1794,16 @@ void LLVertexBuffer::unmapBuffer()
|
|||
glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB);
|
||||
stop_glerror();
|
||||
|
||||
mMappedIndexData = NULL ;
|
||||
mMappedIndexData = NULL;
|
||||
}
|
||||
|
||||
mIndexLocked = FALSE ;
|
||||
mIndexLocked = false;
|
||||
sMappedCount--;
|
||||
}
|
||||
|
||||
if(updated_all)
|
||||
{
|
||||
mEmpty = FALSE;
|
||||
mEmpty = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1835,12 +1823,12 @@ template <class T,S32 type> struct VertexBufferStrider
|
|||
if (ptr == NULL)
|
||||
{
|
||||
llwarns << "mapIndexBuffer failed!" << llendl;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
strider = (T*)ptr;
|
||||
strider.setStride(0);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else if (vbo.hasDataType(type))
|
||||
{
|
||||
|
|
@ -1851,18 +1839,18 @@ template <class T,S32 type> struct VertexBufferStrider
|
|||
if (ptr == NULL)
|
||||
{
|
||||
llwarns << "mapVertexBuffer failed!" << llendl;
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
strider = (T*)ptr;
|
||||
strider.setStride(stride);
|
||||
return TRUE;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
llerrs << "VertexBufferStrider could not find valid vertex data." << llendl;
|
||||
}
|
||||
return FALSE;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -1961,7 +1949,7 @@ bool LLVertexBuffer::bindGLBuffer(bool force_bind)
|
|||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, mGLBuffer);
|
||||
sGLRenderBuffer = mGLBuffer;
|
||||
sBindCount++;
|
||||
sVBOActive = TRUE;
|
||||
sVBOActive = true;
|
||||
|
||||
if (mGLArray)
|
||||
{
|
||||
|
|
@ -1993,7 +1981,7 @@ bool LLVertexBuffer::bindGLIndices(bool force_bind)
|
|||
sGLRenderIndices = mGLIndices;
|
||||
stop_glerror();
|
||||
sBindCount++;
|
||||
sIBOActive = TRUE;
|
||||
sIBOActive = true;
|
||||
ret = true;
|
||||
}
|
||||
|
||||
|
|
@ -2015,7 +2003,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
|
||||
LLMemType mt2(LLMemType::MTYPE_VERTEX_SET_BUFFER);
|
||||
//set up pointers if the data mask is different ...
|
||||
BOOL setup = (sLastMask != data_mask);
|
||||
bool setup = (sLastMask != data_mask);
|
||||
|
||||
if (gDebugGL && data_mask != 0)
|
||||
{ //make sure data requirements are fulfilled
|
||||
|
|
@ -2049,21 +2037,17 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
if (mGLArray)
|
||||
{
|
||||
bindGLArray();
|
||||
setup = FALSE; //do NOT perform pointer setup if using VAO
|
||||
setup = false; //do NOT perform pointer setup if using VAO
|
||||
}
|
||||
else
|
||||
{
|
||||
if (bindGLBuffer())
|
||||
{
|
||||
setup = TRUE;
|
||||
}
|
||||
if (bindGLIndices())
|
||||
{
|
||||
setup = TRUE;
|
||||
}
|
||||
const bool bindBuffer = bindGLBuffer();
|
||||
const bool bindIndices = bindGLIndices();
|
||||
|
||||
setup = setup || bindBuffer || bindIndices;
|
||||
}
|
||||
|
||||
BOOL error = FALSE;
|
||||
bool error = false;
|
||||
if (gDebugGL && !mGLArray)
|
||||
{
|
||||
GLint buff;
|
||||
|
|
@ -2072,7 +2056,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
{
|
||||
if (gDebugSession)
|
||||
{
|
||||
error = TRUE;
|
||||
error = true;
|
||||
gFailLog << "Invalid GL vertex buffer bound: " << buff << std::endl;
|
||||
}
|
||||
else
|
||||
|
|
@ -2088,7 +2072,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
{
|
||||
if (gDebugSession)
|
||||
{
|
||||
error = TRUE;
|
||||
error = true;
|
||||
gFailLog << "Invalid GL index buffer bound: " << buff << std::endl;
|
||||
}
|
||||
else
|
||||
|
|
@ -2110,7 +2094,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
#endif
|
||||
sGLRenderArray = 0;
|
||||
sGLRenderIndices = 0;
|
||||
sIBOActive = FALSE;
|
||||
sIBOActive = false;
|
||||
}
|
||||
|
||||
if (mGLBuffer)
|
||||
|
|
@ -2119,13 +2103,13 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
{
|
||||
glBindBufferARB(GL_ARRAY_BUFFER_ARB, 0);
|
||||
sBindCount++;
|
||||
sVBOActive = FALSE;
|
||||
setup = TRUE; // ... or a VBO is deactivated
|
||||
sVBOActive = false;
|
||||
setup = true; // ... or a VBO is deactivated
|
||||
}
|
||||
if (sGLRenderBuffer != mGLBuffer)
|
||||
{
|
||||
sGLRenderBuffer = mGLBuffer;
|
||||
setup = TRUE; // ... or a client memory pointer changed
|
||||
setup = true; // ... or a client memory pointer changed
|
||||
}
|
||||
}
|
||||
if (mGLIndices)
|
||||
|
|
@ -2134,7 +2118,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
|
|||
{
|
||||
glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0);
|
||||
sBindCount++;
|
||||
sIBOActive = FALSE;
|
||||
sIBOActive = false;
|
||||
}
|
||||
|
||||
sGLRenderIndices = mGLIndices;
|
||||
|
|
@ -2222,19 +2206,19 @@ void LLVertexBuffer::setupVertexBuffer(U32 data_mask)
|
|||
{
|
||||
S32 loc = TYPE_WEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_WEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 1, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
|
||||
glVertexAttribPointerARB(loc, 1, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_WEIGHT4)
|
||||
{
|
||||
S32 loc = TYPE_WEIGHT4;
|
||||
void* ptr = (void*)(base+mOffsets[TYPE_WEIGHT4]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_FALSE, LLVertexBuffer::sTypeSize[TYPE_WEIGHT4], ptr);
|
||||
}
|
||||
if (data_mask & MAP_CLOTHWEIGHT)
|
||||
{
|
||||
S32 loc = TYPE_CLOTHWEIGHT;
|
||||
void* ptr = (void*)(base + mOffsets[TYPE_CLOTHWEIGHT]);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
|
||||
glVertexAttribPointerARB(loc, 4, GL_FLOAT, GL_TRUE, LLVertexBuffer::sTypeSize[TYPE_CLOTHWEIGHT], ptr);
|
||||
}
|
||||
if (data_mask & MAP_TEXTURE_INDEX)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -55,9 +55,14 @@ class LLVBOPool
|
|||
{
|
||||
public:
|
||||
static U32 sBytesPooled;
|
||||
|
||||
LLVBOPool(U32 vboUsage, U32 vboType)
|
||||
: mUsage(vboUsage)
|
||||
, mType(vboType)
|
||||
{}
|
||||
|
||||
U32 mUsage;
|
||||
U32 mType;
|
||||
const U32 mUsage;
|
||||
const U32 mType;
|
||||
|
||||
//size MUST be a power of 2
|
||||
volatile U8* allocate(U32& name, U32 size);
|
||||
|
|
@ -88,7 +93,7 @@ public:
|
|||
|
||||
//============================================================================
|
||||
// base class
|
||||
class LLPrivateMemoryPool ;
|
||||
class LLPrivateMemoryPool;
|
||||
class LLVertexBuffer : public LLRefCount
|
||||
{
|
||||
public:
|
||||
|
|
@ -103,6 +108,7 @@ public:
|
|||
};
|
||||
|
||||
LLVertexBuffer(const LLVertexBuffer& rhs)
|
||||
: mUsage(rhs.mUsage)
|
||||
{
|
||||
*this = rhs;
|
||||
}
|
||||
|
|
@ -118,9 +124,9 @@ public:
|
|||
static LLVBOPool sStreamIBOPool;
|
||||
static LLVBOPool sDynamicIBOPool;
|
||||
|
||||
static BOOL sUseStreamDraw;
|
||||
static BOOL sUseVAO;
|
||||
static BOOL sPreferStreamDraw;
|
||||
static bool sUseStreamDraw;
|
||||
static bool sUseVAO;
|
||||
static bool sPreferStreamDraw;
|
||||
|
||||
static void initClass(bool use_vbo, bool no_vbo_mapping);
|
||||
static void cleanupClass();
|
||||
|
|
@ -201,7 +207,7 @@ protected:
|
|||
void destroyGLIndices();
|
||||
void updateNumVerts(S32 nverts);
|
||||
void updateNumIndices(S32 nindices);
|
||||
virtual BOOL useVBOs() const;
|
||||
bool useVBOs() const;
|
||||
void unmapBuffer();
|
||||
|
||||
public:
|
||||
|
|
@ -239,8 +245,8 @@ public:
|
|||
bool getClothWeightStrider(LLStrider<LLVector4>& strider, S32 index=0, S32 count = -1, bool map_range = false);
|
||||
|
||||
|
||||
BOOL isEmpty() const { return mEmpty; }
|
||||
BOOL isLocked() const { return mVertexLocked || mIndexLocked; }
|
||||
bool isEmpty() const { return mEmpty; }
|
||||
bool isLocked() const { return mVertexLocked || mIndexLocked; }
|
||||
S32 getNumVerts() const { return mNumVerts; }
|
||||
S32 getNumIndices() const { return mNumIndices; }
|
||||
|
||||
|
|
@ -254,7 +260,7 @@ public:
|
|||
volatile U8* getMappedIndices() const { return mMappedIndexData; }
|
||||
S32 getOffset(S32 type) const { return mOffsets[type]; }
|
||||
S32 getUsage() const { return mUsage; }
|
||||
BOOL isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? TRUE : FALSE; }
|
||||
bool isWriteable() const { return (mMappable || mUsage == GL_STREAM_DRAW_ARB) ? true : false; }
|
||||
|
||||
void draw(U32 mode, U32 count, U32 indices_offset) const;
|
||||
void drawArrays(U32 mode, U32 offset, U32 count) const;
|
||||
|
|
@ -274,18 +280,25 @@ protected:
|
|||
S32 mSize;
|
||||
S32 mIndicesSize;
|
||||
U32 mTypeMask;
|
||||
S32 mUsage; // GL usage
|
||||
|
||||
const S32 mUsage; // GL usage
|
||||
|
||||
U32 mGLBuffer; // GL VBO handle
|
||||
U32 mGLIndices; // GL IBO handle
|
||||
U32 mGLArray; // GL VAO handle
|
||||
|
||||
volatile U8* mMappedData; // pointer to currently mapped data (NULL if unmapped)
|
||||
volatile U8* mMappedIndexData; // pointer to currently mapped indices (NULL if unmapped)
|
||||
BOOL mVertexLocked; // if TRUE, vertex buffer is being or has been written to in client memory
|
||||
BOOL mIndexLocked; // if TRUE, index buffer is being or has been written to in client memory
|
||||
BOOL mFinal; // if TRUE, buffer can not be mapped again
|
||||
BOOL mEmpty; // if TRUE, client buffer is empty (or NULL). Old values have been discarded.
|
||||
mutable BOOL mMappable; // if TRUE, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
|
||||
|
||||
U32 mMappedDataUsingVBOs : 1;
|
||||
U32 mMappedIndexDataUsingVBOs : 1;
|
||||
U32 mVertexLocked : 1; // if true, vertex buffer is being or has been written to in client memory
|
||||
U32 mIndexLocked : 1; // if true, index buffer is being or has been written to in client memory
|
||||
U32 mFinal : 1; // if true, buffer can not be mapped again
|
||||
U32 mEmpty : 1; // if true, client buffer is empty (or NULL). Old values have been discarded.
|
||||
|
||||
mutable bool mMappable; // if true, use memory mapping to upload data (otherwise doublebuffer and use glBufferSubData)
|
||||
|
||||
S32 mOffsets[TYPE_MAX];
|
||||
|
||||
std::vector<MappedRegion> mMappedVertexRegions;
|
||||
|
|
@ -296,26 +309,27 @@ protected:
|
|||
void placeFence() const;
|
||||
void waitFence() const;
|
||||
|
||||
static S32 determineUsage(S32 usage);
|
||||
|
||||
private:
|
||||
static LLPrivateMemoryPool* sPrivatePoolp ;
|
||||
static LLPrivateMemoryPool* sPrivatePoolp;
|
||||
|
||||
public:
|
||||
static S32 sCount;
|
||||
static S32 sGLCount;
|
||||
static S32 sMappedCount;
|
||||
static BOOL sMapped;
|
||||
static bool sMapped;
|
||||
typedef std::list<LLVertexBuffer*> buffer_list_t;
|
||||
|
||||
static BOOL sDisableVBOMapping; //disable glMapBufferARB
|
||||
static BOOL sEnableVBOs;
|
||||
static bool sDisableVBOMapping; //disable glMapBufferARB
|
||||
static bool sEnableVBOs;
|
||||
static S32 sTypeSize[TYPE_MAX];
|
||||
static U32 sGLMode[LLRender::NUM_MODES];
|
||||
static U32 sGLRenderBuffer;
|
||||
static U32 sGLRenderArray;
|
||||
static U32 sGLRenderIndices;
|
||||
static BOOL sVBOActive;
|
||||
static BOOL sIBOActive;
|
||||
static bool sVBOActive;
|
||||
static bool sIBOActive;
|
||||
static U32 sLastMask;
|
||||
static U32 sAllocatedBytes;
|
||||
static U32 sBindCount;
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ void LLAccordionCtrlTab::drawChild(const LLRect& root_rect,LLView* child)
|
|||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLUI::translate((F32)child->getRect().mLeft, (F32)child->getRect().mBottom, 0.f);
|
||||
LLUI::translate((F32)child->getRect().mLeft, (F32)child->getRect().mBottom);
|
||||
child->draw();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -908,9 +908,9 @@ void LLButton::draw()
|
|||
// Not sure if it is really needed. Probably S32_MAX should be always passed as max_chars.
|
||||
mLastDrawCharsCount = mGLFont->render(label, 0,
|
||||
(F32)x,
|
||||
(F32)(mBottomVPad + y_offset),
|
||||
(F32)(getRect().getHeight() / 2 + mBottomVPad),
|
||||
label_color % alpha,
|
||||
mHAlign, LLFontGL::BOTTOM,
|
||||
mHAlign, LLFontGL::VCENTER,
|
||||
LLFontGL::NORMAL,
|
||||
mDropShadowedText ? LLFontGL::DROP_SHADOW_SOFT : LLFontGL::NO_SHADOW,
|
||||
S32_MAX, text_width,
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ void LLComboBox::showList()
|
|||
}
|
||||
mList->setOrigin(rect.mLeft, rect.mBottom);
|
||||
mList->reshape(rect.getWidth(), rect.getHeight());
|
||||
mList->translateIntoRect(root_view_local, FALSE);
|
||||
mList->translateIntoRect(root_view_local);
|
||||
|
||||
// Make sure we didn't go off bottom of screen
|
||||
S32 x, y;
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ void LLDragHandleTop::reshapeTitleBox()
|
|||
const LLFontGL* font = LLFontGL::getFontSansSerif();
|
||||
S32 title_width = getRect().getWidth();
|
||||
title_width -= LEFT_PAD + 2 * BORDER_PAD + getButtonsRect().getWidth();
|
||||
S32 title_height = llround(font->getLineHeight());
|
||||
S32 title_height = font->getLineHeight();
|
||||
LLRect title_rect;
|
||||
title_rect.setLeftTopAndSize(
|
||||
LEFT_PAD,
|
||||
|
|
|
|||
|
|
@ -270,6 +270,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
|
|||
mMinimizeSignal(NULL)
|
||||
// mNotificationContext(NULL)
|
||||
{
|
||||
mPosition.setFloater(*this);
|
||||
// mNotificationContext = new LLFloaterNotificationContext(getHandle());
|
||||
|
||||
// Clicks stop here.
|
||||
|
|
@ -925,7 +926,7 @@ void LLFloater::applyPositioning(LLFloater* other)
|
|||
setOrigin(mSpecifiedLeft, mSpecifiedBottom);
|
||||
const LLRect& snap_rect = gFloaterView->getSnapRect();
|
||||
translate(snap_rect.mLeft, snap_rect.mBottom);
|
||||
translateIntoRect(snap_rect, FALSE);
|
||||
translateIntoRect(snap_rect);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -949,7 +950,7 @@ void LLFloater::applyPositioning(LLFloater* other)
|
|||
setOrigin(horizontal_offset, vertical_offset - rect_height);
|
||||
|
||||
translate(snap_rect.mLeft, snap_rect.mBottom);
|
||||
translateIntoRect(snap_rect, FALSE);
|
||||
translateIntoRect(snap_rect);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -1681,6 +1682,8 @@ LLFloater* LLFloater::getClosableFloaterFromFocus()
|
|||
{
|
||||
if (it->hasFocus())
|
||||
{
|
||||
LLFloater& floater = *it;
|
||||
focused_floater = &floater;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -1800,7 +1803,7 @@ void LLFloater::draw()
|
|||
|
||||
const LLFontGL* font = LLFontGL::getFontSansSerif();
|
||||
LLRect r = getRect();
|
||||
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1,
|
||||
gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - font->getLineHeight() - 1,
|
||||
titlebar_focus_color % alpha, 0, TRUE);
|
||||
}
|
||||
}
|
||||
|
|
@ -2641,6 +2644,8 @@ void LLFloaterView::refresh()
|
|||
}
|
||||
}
|
||||
|
||||
const S32 FLOATER_MIN_VISIBLE_PIXELS = 16;
|
||||
|
||||
void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside)
|
||||
{
|
||||
if (floater->getParent() != this)
|
||||
|
|
@ -2694,7 +2699,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out
|
|||
}
|
||||
|
||||
// move window fully onscreen
|
||||
if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ))
|
||||
if (floater->translateIntoRect( getSnapRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX ))
|
||||
{
|
||||
floater->clearSnapTarget();
|
||||
}
|
||||
|
|
@ -3269,3 +3274,112 @@ void LLFloater::stackWith(LLFloater& other)
|
|||
setShape(next_rect);
|
||||
}
|
||||
|
||||
LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater)
|
||||
: coord_t((S32)x, (S32)y)
|
||||
{
|
||||
mFloater = floater.getHandle();
|
||||
}
|
||||
|
||||
|
||||
LLCoordFloater::LLCoordFloater(const LLCoordCommon& other, LLFloater& floater)
|
||||
{
|
||||
mFloater = floater.getHandle();
|
||||
convertFromCommon(other);
|
||||
}
|
||||
|
||||
LLCoordFloater& LLCoordFloater::operator=(const LLCoordFloater& other)
|
||||
{
|
||||
mFloater = other.mFloater;
|
||||
coord_t::operator =(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void LLCoordFloater::setFloater(LLFloater& floater)
|
||||
{
|
||||
mFloater = floater.getHandle();
|
||||
}
|
||||
|
||||
bool LLCoordFloater::operator==(const LLCoordFloater& other) const
|
||||
{
|
||||
return mX == other.mX && mY == other.mY && mFloater == other.mFloater;
|
||||
}
|
||||
|
||||
LLCoordCommon LL_COORD_FLOATER::convertToCommon() const
|
||||
{
|
||||
const LLCoordFloater& self = static_cast<const LLCoordFloater&>(*this);
|
||||
|
||||
LLRect snap_rect = gFloaterView->getSnapRect();
|
||||
LLFloater* floaterp = mFloater.get();
|
||||
S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
|
||||
S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
|
||||
LLCoordCommon out;
|
||||
if (self.mX < -0.5f)
|
||||
{
|
||||
out.mX = llround(rescale(self.mX, -1.f, -0.5f, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft));
|
||||
}
|
||||
else if (self.mX > 0.5f)
|
||||
{
|
||||
out.mX = llround(rescale(self.mX, 0.5f, 1.f, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.mX = llround(rescale(self.mX, -0.5f, 0.5f, snap_rect.mLeft, snap_rect.mRight - floater_width));
|
||||
}
|
||||
|
||||
if (self.mY < -0.5f)
|
||||
{
|
||||
out.mY = llround(rescale(self.mY, -1.f, -0.5f, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom));
|
||||
}
|
||||
else if (self.mY > 0.5f)
|
||||
{
|
||||
out.mY = llround(rescale(self.mY, 0.5f, 1.f, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS));
|
||||
}
|
||||
else
|
||||
{
|
||||
out.mY = llround(rescale(self.mY, -0.5f, 0.5f, snap_rect.mBottom, snap_rect.mTop - floater_height));
|
||||
}
|
||||
|
||||
// return center point instead of lower left
|
||||
out.mX += floater_width / 2;
|
||||
out.mY += floater_height / 2;
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from)
|
||||
{
|
||||
LLCoordFloater& self = static_cast<LLCoordFloater&>(*this);
|
||||
LLRect snap_rect = gFloaterView->getSnapRect();
|
||||
LLFloater* floaterp = mFloater.get();
|
||||
S32 floater_width = floaterp ? floaterp->getRect().getWidth() : 0;
|
||||
S32 floater_height = floaterp ? floaterp->getRect().getHeight() : 0;
|
||||
|
||||
S32 from_x = from.mX - floater_width / 2;
|
||||
S32 from_y = from.mY - floater_height / 2;
|
||||
|
||||
if (from_x < snap_rect.mLeft)
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mLeft - (floater_width - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mLeft, -1.f, -0.5f);
|
||||
}
|
||||
else if (from_x + floater_width > snap_rect.mRight)
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mRight - floater_width, snap_rect.mRight - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.mX = rescale(from_x, snap_rect.mLeft, snap_rect.mRight - floater_width, -0.5f, 0.5f);
|
||||
}
|
||||
|
||||
if (from_y < snap_rect.mBottom)
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mBottom - (floater_height - FLOATER_MIN_VISIBLE_PIXELS), snap_rect.mBottom, -1.f, -0.5f);
|
||||
}
|
||||
else if (from_y + floater_height > snap_rect.mTop)
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mTop - floater_height, snap_rect.mTop - FLOATER_MIN_VISIBLE_PIXELS, 0.5f, 1.f);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.mY = rescale(from_y, snap_rect.mBottom, snap_rect.mTop - floater_height, -0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,37 @@ namespace LLInitParam
|
|||
};
|
||||
}
|
||||
|
||||
struct LL_COORD_FLOATER
|
||||
{
|
||||
typedef F32 value_t;
|
||||
|
||||
LLCoordCommon convertToCommon() const;
|
||||
void convertFromCommon(const LLCoordCommon& from);
|
||||
protected:
|
||||
LLHandle<LLFloater> mFloater;
|
||||
};
|
||||
|
||||
struct LLCoordFloater : LLCoord<LL_COORD_FLOATER>
|
||||
{
|
||||
typedef LLCoord<LL_COORD_FLOATER> coord_t;
|
||||
|
||||
LLCoordFloater() {}
|
||||
LLCoordFloater(F32 x, F32 y, LLFloater& floater);
|
||||
LLCoordFloater(const LLCoordCommon& other, LLFloater& floater);
|
||||
|
||||
LLCoordFloater& operator=(const LLCoordCommon& other)
|
||||
{
|
||||
convertFromCommon(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
LLCoordFloater& operator=(const LLCoordFloater& other);
|
||||
|
||||
bool operator==(const LLCoordFloater& other) const;
|
||||
bool operator!=(const LLCoordFloater& other) const { return !(*this == other); }
|
||||
|
||||
void setFloater(LLFloater& floater);
|
||||
};
|
||||
|
||||
class LLFloater : public LLPanel, public LLInstanceTracker<LLFloater>
|
||||
{
|
||||
|
|
@ -184,7 +215,7 @@ public:
|
|||
bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL);
|
||||
|
||||
/*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false);
|
||||
/*virtual*/ BOOL canSnapTo(const LLView* other_view);
|
||||
/*virtual*/ BOOL canSnapTo(const LLView* other_view);
|
||||
/*virtual*/ void setSnappedTo(const LLView* snap_view);
|
||||
/*virtual*/ void setFocus( BOOL b );
|
||||
/*virtual*/ void setIsChrome(BOOL is_chrome);
|
||||
|
|
@ -425,6 +456,7 @@ private:
|
|||
LLFloaterEnums::EOpenPositioning mOpenPositioning;
|
||||
S32 mSpecifiedLeft;
|
||||
S32 mSpecifiedBottom;
|
||||
LLCoordFloater mPosition;
|
||||
|
||||
S32 mMinWidth;
|
||||
S32 mMinHeight;
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
#include "llcriticaldamp.h"
|
||||
#include "boost/foreach.hpp"
|
||||
|
||||
static const F32 MIN_FRACTIONAL_SIZE = 0.0001f;
|
||||
static const F32 MIN_FRACTIONAL_SIZE = 0.0f;
|
||||
static const F32 MAX_FRACTIONAL_SIZE = 1.f;
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLLayoutStack> register_layout_stack("layout_stack");
|
||||
|
|
@ -129,6 +129,12 @@ void LLLayoutPanel::setOrientation( LLLayoutStack::ELayoutOrientation orientatio
|
|||
? getRect().getWidth()
|
||||
: getRect().getHeight()));
|
||||
|
||||
if (mAutoResize == FALSE
|
||||
&& mUserResize == TRUE
|
||||
&& mMinDim == -1 )
|
||||
{
|
||||
setMinDim(layout_dim);
|
||||
}
|
||||
mTargetDim = llmax(layout_dim, getMinDim());
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +312,6 @@ void LLLayoutStack::updateLayout()
|
|||
|
||||
bool animation_in_progress = animatePanels();
|
||||
F32 total_visible_fraction = 0.f;
|
||||
F32 total_open_fraction = 0.f;
|
||||
S32 space_to_distribute = (mOrientation == HORIZONTAL)
|
||||
? getRect().getWidth()
|
||||
: getRect().getHeight();
|
||||
|
|
@ -318,20 +323,17 @@ void LLLayoutStack::updateLayout()
|
|||
if (panelp->mAutoResize)
|
||||
{
|
||||
panelp->mTargetDim = panelp->getRelevantMinDim();
|
||||
if (!panelp->mCollapsed && panelp->getVisible())
|
||||
{
|
||||
total_open_fraction += panelp->mFractionalSize;
|
||||
}
|
||||
}
|
||||
space_to_distribute -= panelp->getVisibleDim() + llround((F32)mPanelSpacing * panelp->getVisibleAmount());
|
||||
total_visible_fraction += panelp->mFractionalSize;
|
||||
total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
|
||||
}
|
||||
|
||||
llassert(total_visible_fraction < 1.01f);
|
||||
llassert(total_visible_fraction < 1.05f);
|
||||
|
||||
// don't need spacing after last panel
|
||||
space_to_distribute += panelp ? llround((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0;
|
||||
|
||||
S32 remaining_space = space_to_distribute;
|
||||
F32 fraction_distributed = 0.f;
|
||||
if (space_to_distribute > 0 && total_visible_fraction > 0.f)
|
||||
{ // give space proportionally to visible auto resize panels
|
||||
|
|
@ -343,26 +345,23 @@ void LLLayoutStack::updateLayout()
|
|||
S32 delta = llround((F32)space_to_distribute * fraction_to_distribute);
|
||||
fraction_distributed += fraction_to_distribute;
|
||||
panelp->mTargetDim += delta;
|
||||
remaining_space -= delta;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (fraction_distributed < total_visible_fraction)
|
||||
{ // distribute any left over pixels to non-collapsed, visible panels
|
||||
F32 fraction_left = total_visible_fraction - fraction_distributed;
|
||||
S32 space_left = llround((F32)space_to_distribute * (fraction_left / total_visible_fraction));
|
||||
// distribute any left over pixels to non-collapsed, visible panels
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
{
|
||||
if (remaining_space == 0) break;
|
||||
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
if (panelp->mAutoResize
|
||||
&& !panelp->mCollapsed
|
||||
&& panelp->getVisible())
|
||||
{
|
||||
if (panelp->mAutoResize
|
||||
&& !panelp->mCollapsed
|
||||
&& panelp->getVisible())
|
||||
{
|
||||
S32 space_for_panel = llmax(0, llround((F32)space_left * (panelp->mFractionalSize / total_open_fraction)));
|
||||
panelp->mTargetDim += space_for_panel;
|
||||
space_left -= space_for_panel;
|
||||
total_open_fraction -= panelp->mFractionalSize;
|
||||
}
|
||||
S32 space_for_panel = remaining_space > 0 ? 1 : -1;
|
||||
panelp->mTargetDim += space_for_panel;
|
||||
remaining_space -= space_for_panel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -494,33 +493,46 @@ void LLLayoutStack::updateClass()
|
|||
|
||||
void LLLayoutStack::updateFractionalSizes()
|
||||
{
|
||||
F32 total_resizable_dim = 0;
|
||||
S32 num_auto_resize_panels = 0;
|
||||
F32 total_resizable_dim = 0.f;
|
||||
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
{
|
||||
if (panelp->mAutoResize)
|
||||
{
|
||||
total_resizable_dim += llmax(0, panelp->getLayoutDim() - panelp->getRelevantMinDim());
|
||||
num_auto_resize_panels++;
|
||||
}
|
||||
}
|
||||
|
||||
F32 total_fractional_size = 0.f;
|
||||
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
{
|
||||
if (panelp->mAutoResize)
|
||||
{
|
||||
F32 panel_resizable_dim = llmax(MIN_FRACTIONAL_SIZE, (F32)(panelp->getLayoutDim() - panelp->getRelevantMinDim()));
|
||||
panelp->mFractionalSize = panel_resizable_dim > 0.f
|
||||
? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE)
|
||||
: MIN_FRACTIONAL_SIZE;
|
||||
total_fractional_size += panelp->mFractionalSize;
|
||||
? llclamp(panel_resizable_dim / total_resizable_dim, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE)
|
||||
: MIN_FRACTIONAL_SIZE;
|
||||
llassert(!llisnan(panelp->mFractionalSize));
|
||||
}
|
||||
}
|
||||
|
||||
normalizeFractionalSizes();
|
||||
}
|
||||
|
||||
|
||||
void LLLayoutStack::normalizeFractionalSizes()
|
||||
{
|
||||
S32 num_auto_resize_panels = 0;
|
||||
F32 total_fractional_size = 0.f;
|
||||
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
{
|
||||
if (panelp->mAutoResize)
|
||||
{
|
||||
total_fractional_size += panelp->mFractionalSize;
|
||||
num_auto_resize_panels++;
|
||||
}
|
||||
}
|
||||
|
||||
if (total_fractional_size == 0.f)
|
||||
{ // equal distribution
|
||||
BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
|
||||
|
|
@ -632,7 +644,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
|
||||
F32 total_visible_fraction = 0.f;
|
||||
F32 delta_auto_resize_headroom = 0.f;
|
||||
F32 total_auto_resize_headroom = 0.f;
|
||||
F32 original_auto_resize_headroom = 0.f;
|
||||
|
||||
LLLayoutPanel* other_resize_panel = NULL;
|
||||
LLLayoutPanel* following_panel = NULL;
|
||||
|
|
@ -641,8 +653,11 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
{
|
||||
if (panelp->mAutoResize)
|
||||
{
|
||||
total_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
|
||||
total_visible_fraction += panelp->mFractionalSize * panelp->getAutoResizeFactor();
|
||||
original_auto_resize_headroom += (F32)(panelp->mTargetDim - panelp->getRelevantMinDim());
|
||||
if (panelp->getVisible() && !panelp->mCollapsed)
|
||||
{
|
||||
total_visible_fraction += panelp->mFractionalSize;
|
||||
}
|
||||
}
|
||||
|
||||
if (panelp == resized_panel)
|
||||
|
|
@ -656,18 +671,25 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
}
|
||||
}
|
||||
|
||||
if (resized_panel->mAutoResize == FALSE)
|
||||
|
||||
if (resized_panel->mAutoResize)
|
||||
{
|
||||
delta_auto_resize_headroom += -delta_dim;
|
||||
if (!other_resize_panel || !other_resize_panel->mAutoResize)
|
||||
{
|
||||
delta_auto_resize_headroom += delta_dim;
|
||||
}
|
||||
}
|
||||
if (other_resize_panel && other_resize_panel->mAutoResize == FALSE)
|
||||
else
|
||||
{
|
||||
delta_auto_resize_headroom += delta_dim;
|
||||
if (!other_resize_panel || other_resize_panel->mAutoResize)
|
||||
{
|
||||
delta_auto_resize_headroom -= delta_dim;
|
||||
}
|
||||
}
|
||||
|
||||
F32 fraction_given_up = 0.f;
|
||||
F32 fraction_remaining = 1.f;
|
||||
F32 updated_auto_resize_headroom = total_auto_resize_headroom + delta_auto_resize_headroom;
|
||||
F32 updated_auto_resize_headroom = original_auto_resize_headroom + delta_auto_resize_headroom;
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
@ -691,14 +713,15 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
case BEFORE_RESIZED_PANEL:
|
||||
if (panelp->mAutoResize)
|
||||
{ // freeze current size as fraction of overall auto_resize space
|
||||
F32 fractional_adjustment_factor = total_auto_resize_headroom / updated_auto_resize_headroom;
|
||||
F32 fractional_adjustment_factor = updated_auto_resize_headroom == 0.f
|
||||
? 1.f
|
||||
: original_auto_resize_headroom / updated_auto_resize_headroom;
|
||||
F32 new_fractional_size = llclamp(panelp->mFractionalSize * fractional_adjustment_factor,
|
||||
MIN_FRACTIONAL_SIZE,
|
||||
MAX_FRACTIONAL_SIZE);
|
||||
F32 fraction_delta = (new_fractional_size - panelp->mFractionalSize);
|
||||
fraction_given_up -= fraction_delta;
|
||||
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
|
||||
fraction_remaining -= panelp->mFractionalSize;
|
||||
panelp->mFractionalSize += fraction_delta;
|
||||
panelp->mFractionalSize = new_fractional_size;
|
||||
llassert(!llisnan(panelp->mFractionalSize));
|
||||
}
|
||||
else
|
||||
|
|
@ -711,7 +734,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
{ // freeze new size as fraction
|
||||
F32 new_fractional_size = (updated_auto_resize_headroom == 0.f)
|
||||
? MAX_FRACTIONAL_SIZE
|
||||
: llclamp((F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
|
||||
: llclamp(total_visible_fraction * (F32)(new_dim - panelp->getRelevantMinDim()) / updated_auto_resize_headroom, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
|
||||
fraction_given_up -= new_fractional_size - panelp->mFractionalSize;
|
||||
fraction_remaining -= panelp->mFractionalSize;
|
||||
panelp->mFractionalSize = new_fractional_size;
|
||||
|
|
@ -720,7 +743,6 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
else
|
||||
{ // freeze new size as original size
|
||||
panelp->mTargetDim = new_dim;
|
||||
fraction_remaining -= fraction_given_up;
|
||||
}
|
||||
which_panel = NEXT_PANEL;
|
||||
break;
|
||||
|
|
@ -728,14 +750,14 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
if (panelp->mAutoResize)
|
||||
{
|
||||
fraction_remaining -= panelp->mFractionalSize;
|
||||
if (fraction_given_up != 0.f)
|
||||
if (resized_panel->mAutoResize)
|
||||
{
|
||||
panelp->mFractionalSize = llclamp(panelp->mFractionalSize + fraction_given_up, MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE);
|
||||
fraction_given_up = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
F32 new_fractional_size = llclamp((F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
|
||||
F32 new_fractional_size = llclamp(total_visible_fraction * (F32)(panelp->mTargetDim - panelp->getRelevantMinDim() + delta_auto_resize_headroom)
|
||||
/ updated_auto_resize_headroom,
|
||||
MIN_FRACTIONAL_SIZE,
|
||||
MAX_FRACTIONAL_SIZE);
|
||||
|
|
@ -750,7 +772,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
which_panel = AFTER_RESIZED_PANEL;
|
||||
break;
|
||||
case AFTER_RESIZED_PANEL:
|
||||
if (panelp->mAutoResize)
|
||||
if (panelp->mAutoResize && fraction_given_up != 0.f)
|
||||
{
|
||||
panelp->mFractionalSize = llclamp(panelp->mFractionalSize + (panelp->mFractionalSize / fraction_remaining) * fraction_given_up,
|
||||
MIN_FRACTIONAL_SIZE,
|
||||
|
|
@ -760,6 +782,8 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
|
|||
break;
|
||||
}
|
||||
}
|
||||
updateLayout();
|
||||
normalizeFractionalSizes();
|
||||
}
|
||||
|
||||
void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public:
|
|||
/*virtual*/ void draw();
|
||||
/*virtual*/ void removeChild(LLView*);
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ bool addChild(LLView* child, S32 tab_group = 0);
|
||||
/*virtual*/ bool addChild(LLView* child, S32 tab_groupdatefractuiona = 0);
|
||||
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
|
||||
|
||||
|
|
@ -112,6 +112,7 @@ private:
|
|||
LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
|
||||
LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
|
||||
void updateFractionalSizes();
|
||||
void normalizeFractionalSizes();
|
||||
void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );
|
||||
|
||||
S32 mPanelSpacing;
|
||||
|
|
@ -154,10 +155,10 @@ public:
|
|||
void setVisible(BOOL visible);
|
||||
|
||||
S32 getLayoutDim() const;
|
||||
S32 getMinDim() const { return (mMinDim >= 0 || mAutoResize) ? llmax(0, mMinDim) : getLayoutDim(); }
|
||||
S32 getMinDim() const { return llmax(0, mMinDim); }
|
||||
void setMinDim(S32 value) { mMinDim = value; }
|
||||
|
||||
S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : mMinDim; }
|
||||
S32 getExpandedMinDim() const { return mExpandedMinDim >= 0 ? mExpandedMinDim : getMinDim(); }
|
||||
void setExpandedMinDim(S32 value) { mExpandedMinDim = value; }
|
||||
|
||||
S32 getRelevantMinDim() const
|
||||
|
|
|
|||
|
|
@ -1726,7 +1726,7 @@ void LLLineEditor::draw()
|
|||
LLRect background( 0, getRect().getHeight(), getRect().getWidth(), 0 );
|
||||
background.stretch( -mBorderThickness );
|
||||
|
||||
S32 lineeditor_v_pad = llround((background.getHeight() - mGLFont->getLineHeight())/2);
|
||||
S32 lineeditor_v_pad = (background.getHeight() - mGLFont->getLineHeight()) / 2;
|
||||
|
||||
drawBackground();
|
||||
|
||||
|
|
|
|||
|
|
@ -317,7 +317,7 @@ void LLMenuItemGL::setJumpKey(KEY key)
|
|||
// virtual
|
||||
U32 LLMenuItemGL::getNominalHeight( void ) const
|
||||
{
|
||||
return llround(mFont->getLineHeight()) + MENU_ITEM_PADDING;
|
||||
return mFont->getLineHeight() + MENU_ITEM_PADDING;
|
||||
}
|
||||
|
||||
//virtual
|
||||
|
|
@ -508,19 +508,19 @@ void LLMenuItemGL::draw( void )
|
|||
{
|
||||
if( !mDrawBoolLabel.empty() )
|
||||
{
|
||||
mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
|
||||
mFont->render( mDrawBoolLabel.getWString(), 0, (F32)LEFT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
|
||||
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
||||
}
|
||||
mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
|
||||
mFont->render( mLabel.getWString(), 0, (F32)LEFT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
|
||||
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
||||
if( !mDrawAccelLabel.empty() )
|
||||
{
|
||||
mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
|
||||
mFont->render( mDrawAccelLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PLAIN_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
|
||||
LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
||||
}
|
||||
if( !mDrawBranchLabel.empty() )
|
||||
{
|
||||
mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f) + 1.f, color,
|
||||
mFont->render( mDrawBranchLabel.getWString(), 0, (F32)getRect().mRight - (F32)RIGHT_PAD_PIXELS, ((F32)MENU_ITEM_PADDING / 2.f), color,
|
||||
LLFontGL::RIGHT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
|
||||
}
|
||||
}
|
||||
|
|
@ -1966,7 +1966,7 @@ void LLMenuGL::arrange( void )
|
|||
|
||||
// *FIX: create the item first and then ask for its dimensions?
|
||||
S32 spillover_item_width = PLAIN_PAD_PIXELS + LLFontGL::getFontSansSerif()->getWidth( std::string("More") ); // *TODO: Translate
|
||||
S32 spillover_item_height = llround(LLFontGL::getFontSansSerif()->getLineHeight()) + MENU_ITEM_PADDING;
|
||||
S32 spillover_item_height = LLFontGL::getFontSansSerif()->getLineHeight() + MENU_ITEM_PADDING;
|
||||
|
||||
// Scrolling support
|
||||
item_list_t::iterator first_visible_item_iter;
|
||||
|
|
@ -3082,7 +3082,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
|
|||
mouse_y + MOUSE_CURSOR_PADDING,
|
||||
CURSOR_WIDTH + MOUSE_CURSOR_PADDING * 2,
|
||||
CURSOR_HEIGHT + MOUSE_CURSOR_PADDING * 2);
|
||||
menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect, FALSE );
|
||||
menu->translateIntoRectWithExclusion( menu_region_rect, mouse_rect );
|
||||
menu->getParent()->sendChildToFront(menu);
|
||||
}
|
||||
|
||||
|
|
@ -3425,7 +3425,7 @@ void LLMenuHolderGL::draw()
|
|||
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom, 0.f);
|
||||
LLUI::translate((F32)item_rect.mLeft, (F32)item_rect.mBottom);
|
||||
selecteditem->getMenu()->drawBackground(selecteditem, interpolant);
|
||||
selecteditem->draw();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1412,6 +1412,7 @@ void addPathIfExists(const std::string& new_path, std::vector<std::string>& path
|
|||
|
||||
bool LLNotifications::loadTemplates()
|
||||
{
|
||||
llinfos << "Reading notifications template" << llendl;
|
||||
std::vector<std::string> search_paths;
|
||||
|
||||
std::string skin_relative_path = gDirUtilp->getDirDelimiter() + LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + "notifications.xml";
|
||||
|
|
@ -1484,6 +1485,8 @@ bool LLNotifications::loadTemplates()
|
|||
mTemplates[notification.name] = LLNotificationTemplatePtr(new LLNotificationTemplate(notification));
|
||||
}
|
||||
|
||||
llinfos << "...done" << llendl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -690,7 +690,7 @@ typedef std::multimap<std::string, LLNotificationPtr> LLNotificationMap;
|
|||
// Abstract base class (interface) for a channel; also used for the master container.
|
||||
// This lets us arrange channels into a call hierarchy.
|
||||
|
||||
// We maintain a heirarchy of notification channels; events are always started at the top
|
||||
// We maintain a hierarchy of notification channels; events are always started at the top
|
||||
// and propagated through the hierarchy only if they pass a filter.
|
||||
// Any channel can be created with a parent. A null parent (empty string) means it's
|
||||
// tied to the root of the tree (the LLNotifications class itself).
|
||||
|
|
|
|||
|
|
@ -378,23 +378,21 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height
|
|||
|
||||
if (!mHideScrollbar)
|
||||
{
|
||||
if( *visible_height < doc_height )
|
||||
// Note: 1 pixel change can happen on final animation and should not trigger
|
||||
// the display of sliders.
|
||||
if ((doc_height - *visible_height) > 1)
|
||||
{
|
||||
*show_v_scrollbar = TRUE;
|
||||
*visible_width -= scrollbar_size;
|
||||
}
|
||||
|
||||
if( *visible_width < doc_width )
|
||||
if ((doc_width - *visible_width) > 1)
|
||||
{
|
||||
*show_h_scrollbar = TRUE;
|
||||
*visible_height -= scrollbar_size;
|
||||
|
||||
// Must retest now that visible_height has changed
|
||||
if( !*show_v_scrollbar && (*visible_height < doc_height) )
|
||||
{
|
||||
*show_v_scrollbar = TRUE;
|
||||
*visible_width -= scrollbar_size;
|
||||
}
|
||||
// Note: Do *not* recompute *show_v_scrollbar here because with
|
||||
// the (- scrollbar_size) we just did we will always add a vertical scrollbar
|
||||
// even if the height of the items is actually less than the visible size.
|
||||
// Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ BOOL LLScrollListText::getVisible() const
|
|||
//virtual
|
||||
S32 LLScrollListText::getHeight() const
|
||||
{
|
||||
return llround(mFont->getLineHeight());
|
||||
return mFont->getLineHeight();
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
|
|||
break;
|
||||
}
|
||||
LLRect highlight_rect(left - 2,
|
||||
llround(mFont->getLineHeight()) + 1,
|
||||
mFont->getLineHeight() + 1,
|
||||
left + mFont->getWidth(mText.getString(), mHighlightOffset, mHighlightCount) + 1,
|
||||
1);
|
||||
mRoundedRectImage->draw(highlight_rect, highlight_color);
|
||||
|
|
@ -329,7 +329,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
|
|||
break;
|
||||
}
|
||||
mFont->render(mText.getWString(), 0,
|
||||
start_x, 2.f,
|
||||
start_x, 0.f,
|
||||
display_color,
|
||||
mFontAlignment,
|
||||
LLFontGL::BOTTOM,
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void LLScrollListItem::draw(const LLRect& rect, const LLColor4& fg_color, const
|
|||
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLUI::translate((F32) cur_x, (F32) rect.mBottom, 0.0f);
|
||||
LLUI::translate((F32) cur_x, (F32) rect.mBottom);
|
||||
|
||||
cell->draw( fg_color, highlight_color );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@
|
|||
#include "v4color.h"
|
||||
#include "llinitparam.h"
|
||||
#include "llscrolllistcell.h"
|
||||
#include "llcoord.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
class LLCoordGL;
|
||||
class LLCheckBoxCtrl;
|
||||
class LLResizeBar;
|
||||
class LLScrollListCtrl;
|
||||
|
|
|
|||
|
|
@ -1404,7 +1404,10 @@ void LLTextBase::reflow()
|
|||
|
||||
// shrink document to minimum size (visible portion of text widget)
|
||||
// to force inlined widgets with follows set to shrink
|
||||
mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
|
||||
if (mWordWrap)
|
||||
{
|
||||
mDocumentView->reshape(mVisibleTextRect.getWidth(), mDocumentView->getRect().getHeight());
|
||||
}
|
||||
|
||||
S32 cur_top = 0;
|
||||
|
||||
|
|
@ -2369,7 +2372,7 @@ LLRect LLTextBase::getLocalRectFromDocIndex(S32 pos) const
|
|||
{
|
||||
// return default height rect in upper left
|
||||
local_rect = content_window_rect;
|
||||
local_rect.mBottom = local_rect.mTop - (S32)(mDefaultFont->getLineHeight());
|
||||
local_rect.mBottom = local_rect.mTop - mDefaultFont->getLineHeight();
|
||||
return local_rect;
|
||||
}
|
||||
|
||||
|
|
@ -2592,6 +2595,9 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction)
|
|||
|
||||
void LLTextBase::updateRects()
|
||||
{
|
||||
LLRect old_text_rect = mVisibleTextRect;
|
||||
mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect();
|
||||
|
||||
if (mLineInfoList.empty())
|
||||
{
|
||||
mTextBoundingRect = LLRect(0, mVPad, mHPad, 0);
|
||||
|
|
@ -2607,10 +2613,24 @@ void LLTextBase::updateRects()
|
|||
}
|
||||
|
||||
mTextBoundingRect.mTop += mVPad;
|
||||
// subtract a pixel off the bottom to deal with rounding errors in measuring font height
|
||||
mTextBoundingRect.mBottom -= 1;
|
||||
|
||||
S32 delta_pos = -mTextBoundingRect.mBottom;
|
||||
S32 delta_pos = 0;
|
||||
|
||||
switch(mVAlign)
|
||||
{
|
||||
case LLFontGL::TOP:
|
||||
delta_pos = llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom);
|
||||
break;
|
||||
case LLFontGL::VCENTER:
|
||||
delta_pos = (llmax(mVisibleTextRect.getHeight() - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2;
|
||||
break;
|
||||
case LLFontGL::BOTTOM:
|
||||
delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom;
|
||||
break;
|
||||
case LLFontGL::BASELINE:
|
||||
// do nothing
|
||||
break;
|
||||
}
|
||||
// move line segments to fit new document rect
|
||||
for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it)
|
||||
{
|
||||
|
|
@ -2620,8 +2640,9 @@ void LLTextBase::updateRects()
|
|||
}
|
||||
|
||||
// update document container dimensions according to text contents
|
||||
LLRect doc_rect = mTextBoundingRect;
|
||||
LLRect doc_rect;
|
||||
// use old mVisibleTextRect constraint document to width of viewable region
|
||||
doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom);
|
||||
doc_rect.mLeft = 0;
|
||||
|
||||
// allow horizontal scrolling?
|
||||
|
|
@ -2631,11 +2652,22 @@ void LLTextBase::updateRects()
|
|||
doc_rect.mRight = mScroller
|
||||
? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
|
||||
: mVisibleTextRect.getWidth();
|
||||
doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
|
||||
|
||||
if (!mScroller)
|
||||
{
|
||||
// push doc rect to top of text widget
|
||||
doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
|
||||
switch(mVAlign)
|
||||
{
|
||||
case LLFontGL::TOP:
|
||||
doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
|
||||
break;
|
||||
case LLFontGL::VCENTER:
|
||||
doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2);
|
||||
case LLFontGL::BOTTOM:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
mDocumentView->setShape(doc_rect);
|
||||
|
|
@ -2643,7 +2675,6 @@ void LLTextBase::updateRects()
|
|||
//update mVisibleTextRect *after* mDocumentView has been resized
|
||||
// so that scrollbars are added if document needs to scroll
|
||||
// since mVisibleTextRect does not include scrollbars
|
||||
LLRect old_text_rect = mVisibleTextRect;
|
||||
mVisibleTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect();
|
||||
//FIXME: replace border with image?
|
||||
if (mBorderVisible)
|
||||
|
|
@ -2656,9 +2687,27 @@ void LLTextBase::updateRects()
|
|||
}
|
||||
|
||||
// update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed)
|
||||
doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom);
|
||||
doc_rect.mLeft = 0;
|
||||
doc_rect.mRight = mScroller
|
||||
? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight)
|
||||
: mVisibleTextRect.getWidth();
|
||||
doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop);
|
||||
if (!mScroller)
|
||||
{
|
||||
// push doc rect to top of text widget
|
||||
switch(mVAlign)
|
||||
{
|
||||
case LLFontGL::TOP:
|
||||
doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop);
|
||||
break;
|
||||
case LLFontGL::VCENTER:
|
||||
doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2);
|
||||
case LLFontGL::BOTTOM:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
mDocumentView->setShape(doc_rect);
|
||||
}
|
||||
|
||||
|
|
@ -2772,8 +2821,7 @@ BOOL LLTextSegment::handleScrollWheel(S32 x, S32 y, S32 clicks) { return FALSE;
|
|||
BOOL LLTextSegment::handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }
|
||||
const std::string& LLTextSegment::getName() const
|
||||
{
|
||||
static std::string empty_string("");
|
||||
return empty_string;
|
||||
return LLStringUtil::null;
|
||||
}
|
||||
void LLTextSegment::onMouseCaptureLost() {}
|
||||
void LLTextSegment::screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}
|
||||
|
|
@ -2790,7 +2838,7 @@ LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP style, S32 start, S32 e
|
|||
mToken(NULL),
|
||||
mEditor(editor)
|
||||
{
|
||||
mFontHeight = llceil(mStyle->getFont()->getLineHeight());
|
||||
mFontHeight = mStyle->getFont()->getLineHeight();
|
||||
|
||||
LLUIImagePtr image = mStyle->getImage();
|
||||
if (image.notNull())
|
||||
|
|
@ -2806,7 +2854,7 @@ LLNormalTextSegment::LLNormalTextSegment( const LLColor4& color, S32 start, S32
|
|||
{
|
||||
mStyle = new LLStyle(LLStyle::Params().visible(is_visible).color(color));
|
||||
|
||||
mFontHeight = llceil(mStyle->getFont()->getLineHeight());
|
||||
mFontHeight = mStyle->getFont()->getLineHeight();
|
||||
}
|
||||
|
||||
LLNormalTextSegment::~LLNormalTextSegment()
|
||||
|
|
@ -3174,11 +3222,11 @@ LLLineBreakTextSegment::LLLineBreakTextSegment(S32 pos):LLTextSegment(pos,pos+1)
|
|||
{
|
||||
LLStyleSP s( new LLStyle(LLStyle::Params().visible(true)));
|
||||
|
||||
mFontHeight = llceil(s->getFont()->getLineHeight());
|
||||
mFontHeight = s->getFont()->getLineHeight();
|
||||
}
|
||||
LLLineBreakTextSegment::LLLineBreakTextSegment(LLStyleConstSP style,S32 pos):LLTextSegment(pos,pos+1)
|
||||
{
|
||||
mFontHeight = llceil(style->getFont()->getLineHeight());
|
||||
mFontHeight = style->getFont()->getLineHeight();
|
||||
}
|
||||
LLLineBreakTextSegment::~LLLineBreakTextSegment()
|
||||
{
|
||||
|
|
@ -3215,7 +3263,7 @@ static const S32 IMAGE_HPAD = 3;
|
|||
bool LLImageTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const
|
||||
{
|
||||
width = 0;
|
||||
height = llceil(mStyle->getFont()->getLineHeight());;
|
||||
height = mStyle->getFont()->getLineHeight();
|
||||
|
||||
LLUIImagePtr image = mStyle->getImage();
|
||||
if( num_chars>0 && image.notNull())
|
||||
|
|
|
|||
|
|
@ -2021,7 +2021,7 @@ void LLTextEditor::drawPreeditMarker()
|
|||
return;
|
||||
}
|
||||
|
||||
const S32 line_height = llround( mDefaultFont->getLineHeight() );
|
||||
const S32 line_height = mDefaultFont->getLineHeight();
|
||||
|
||||
S32 line_start = getLineStart(cur_line);
|
||||
S32 line_y = mVisibleTextRect.mTop - line_height;
|
||||
|
|
@ -2744,7 +2744,7 @@ BOOL LLTextEditor::getPreeditLocation(S32 query_offset, LLCoordGL *coord, LLRect
|
|||
|
||||
const LLWString textString(getWText());
|
||||
const llwchar * const text = textString.c_str();
|
||||
const S32 line_height = llround(mDefaultFont->getLineHeight());
|
||||
const S32 line_height = mDefaultFont->getLineHeight();
|
||||
|
||||
if (coord)
|
||||
{
|
||||
|
|
@ -2847,7 +2847,7 @@ void LLTextEditor::markAsPreedit(S32 position, S32 length)
|
|||
|
||||
S32 LLTextEditor::getPreeditFontSize() const
|
||||
{
|
||||
return llround(mDefaultFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]);
|
||||
return llround((F32)mDefaultFont->getLineHeight() * LLUI::sGLScaleFactor.mV[VY]);
|
||||
}
|
||||
|
||||
BOOL LLTextEditor::isDirty() const
|
||||
|
|
|
|||
|
|
@ -827,7 +827,7 @@ void LLToolBar::draw()
|
|||
// rect may have shifted during layout
|
||||
LLUI::popMatrix();
|
||||
LLUI::pushMatrix();
|
||||
LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom, 0.f);
|
||||
LLUI::translate((F32)getRect().mLeft, (F32)getRect().mBottom);
|
||||
|
||||
// Position the caret
|
||||
LLIconCtrl* caret = getChild<LLIconCtrl>("caret");
|
||||
|
|
|
|||
|
|
@ -180,6 +180,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p)
|
|||
params.font = p.font;
|
||||
params.use_ellipses = true;
|
||||
params.wrap = p.wrap;
|
||||
params.font_valign = LLFontGL::VCENTER;
|
||||
params.parse_urls = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips
|
||||
mTextBox = LLUICtrlFactory::create<LLTextBox> (params);
|
||||
addChild(mTextBox);
|
||||
|
|
@ -190,7 +191,6 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p)
|
|||
{
|
||||
LLButton::Params icon_params;
|
||||
icon_params.name = "tooltip_info";
|
||||
icon_params.label(""); // provid label but set to empty so name does not overwrite it -angela
|
||||
LLRect icon_rect;
|
||||
LLUIImage* imagep = p.image;
|
||||
TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16);
|
||||
|
|
@ -291,6 +291,12 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p)
|
|||
S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth());
|
||||
S32 text_height = mTextBox->getTextPixelHeight();
|
||||
mTextBox->reshape(text_width, text_height);
|
||||
if (mInfoButton)
|
||||
{
|
||||
LLRect text_rect = mTextBox->getRect();
|
||||
LLRect icon_rect = mInfoButton->getRect();
|
||||
mTextBox->translate(0, icon_rect.getCenterY() - text_rect.getCenterY());
|
||||
}
|
||||
|
||||
// reshape tooltip panel to fit text box
|
||||
LLRect tooltip_rect = calcBoundingRect();
|
||||
|
|
@ -299,6 +305,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p)
|
|||
tooltip_rect.mBottom = 0;
|
||||
tooltip_rect.mLeft = 0;
|
||||
|
||||
mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding));
|
||||
|
||||
setShape(tooltip_rect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -972,43 +972,53 @@ void gl_ring( F32 radius, F32 width, const LLColor4& center_color, const LLColor
|
|||
// Draw gray and white checkerboard with black border
|
||||
void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
|
||||
{
|
||||
// Initialize the first time this is called.
|
||||
const S32 PIXELS = 32;
|
||||
static GLubyte checkerboard[PIXELS * PIXELS];
|
||||
static BOOL first = TRUE;
|
||||
if( first )
|
||||
{
|
||||
for( S32 i = 0; i < PIXELS; i++ )
|
||||
{
|
||||
for( S32 j = 0; j < PIXELS; j++ )
|
||||
{
|
||||
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
|
||||
}
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
// ...white squares
|
||||
gGL.color4f( 1.f, 1.f, 1.f, alpha );
|
||||
gl_rect_2d(rect);
|
||||
|
||||
// ...gray squares
|
||||
gGL.color4f( .7f, .7f, .7f, alpha );
|
||||
gGL.flush();
|
||||
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{ //polygon stipple is deprecated
|
||||
{
|
||||
// Initialize the first time this is called.
|
||||
const S32 PIXELS = 32;
|
||||
static GLubyte checkerboard[PIXELS * PIXELS];
|
||||
static BOOL first = TRUE;
|
||||
if( first )
|
||||
{
|
||||
for( S32 i = 0; i < PIXELS; i++ )
|
||||
{
|
||||
for( S32 j = 0; j < PIXELS; j++ )
|
||||
{
|
||||
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
|
||||
}
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
// ...white squares
|
||||
gGL.color4f( 1.f, 1.f, 1.f, alpha );
|
||||
gl_rect_2d(rect);
|
||||
|
||||
// ...gray squares
|
||||
gGL.color4f( .7f, .7f, .7f, alpha );
|
||||
gGL.flush();
|
||||
|
||||
glPolygonStipple( checkerboard );
|
||||
|
||||
LLGLEnable polygon_stipple(GL_POLYGON_STIPPLE);
|
||||
gl_rect_2d(rect);
|
||||
}
|
||||
else
|
||||
{
|
||||
gl_rect_2d(rect);
|
||||
{ //polygon stipple is deprecated, use "Checker" texture
|
||||
LLPointer<LLUIImage> img = LLUI::getUIImage("Checker");
|
||||
gGL.getTexUnit(0)->bind(img->getImage());
|
||||
gGL.getTexUnit(0)->setTextureAddressMode(LLTexUnit::TAM_WRAP);
|
||||
gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT);
|
||||
|
||||
LLColor4 color(1.f, 1.f, 1.f, alpha);
|
||||
LLRectf uv_rect(0, 0, rect.getWidth()/32.f, rect.getHeight()/32.f);
|
||||
|
||||
gl_draw_scaled_image(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(),
|
||||
img->getImage(), color, uv_rect);
|
||||
}
|
||||
|
||||
gGL.flush();
|
||||
}
|
||||
|
||||
|
|
@ -1688,21 +1698,22 @@ void LLUI::translate(F32 x, F32 y, F32 z)
|
|||
gGL.translateUI(x,y,z);
|
||||
LLFontGL::sCurOrigin.mX += (S32) x;
|
||||
LLFontGL::sCurOrigin.mY += (S32) y;
|
||||
LLFontGL::sCurOrigin.mZ += z;
|
||||
LLFontGL::sCurDepth += z;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLUI::pushMatrix()
|
||||
{
|
||||
gGL.pushUIMatrix();
|
||||
LLFontGL::sOriginStack.push_back(LLFontGL::sCurOrigin);
|
||||
LLFontGL::sOriginStack.push_back(std::make_pair(LLFontGL::sCurOrigin, LLFontGL::sCurDepth));
|
||||
}
|
||||
|
||||
//static
|
||||
void LLUI::popMatrix()
|
||||
{
|
||||
gGL.popUIMatrix();
|
||||
LLFontGL::sCurOrigin = *LLFontGL::sOriginStack.rbegin();
|
||||
LLFontGL::sCurOrigin = LLFontGL::sOriginStack.back().first;
|
||||
LLFontGL::sCurDepth = LLFontGL::sOriginStack.back().second;
|
||||
LLFontGL::sOriginStack.pop_back();
|
||||
}
|
||||
|
||||
|
|
@ -1712,7 +1723,7 @@ void LLUI::loadIdentity()
|
|||
gGL.loadUIIdentity();
|
||||
LLFontGL::sCurOrigin.mX = 0;
|
||||
LLFontGL::sCurOrigin.mY = 0;
|
||||
LLFontGL::sCurOrigin.mZ = 0;
|
||||
LLFontGL::sCurDepth = 0.f;
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -1735,10 +1746,7 @@ void LLUI::setMousePositionScreen(S32 x, S32 y)
|
|||
screen_x = llround((F32)x * sGLScaleFactor.mV[VX]);
|
||||
screen_y = llround((F32)y * sGLScaleFactor.mV[VY]);
|
||||
|
||||
LLCoordWindow window_point;
|
||||
LLView::getWindow()->convertCoords(LLCoordGL(screen_x, screen_y), &window_point);
|
||||
|
||||
LLView::getWindow()->setCursorPosition(window_point);
|
||||
LLView::getWindow()->setCursorPosition(LLCoordGL(screen_x, screen_y).convert());
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
@ -1746,8 +1754,7 @@ void LLUI::getMousePositionScreen(S32 *x, S32 *y)
|
|||
{
|
||||
LLCoordWindow cursor_pos_window;
|
||||
getWindow()->getCursorPosition(&cursor_pos_window);
|
||||
LLCoordGL cursor_pos_gl;
|
||||
getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl);
|
||||
LLCoordGL cursor_pos_gl(cursor_pos_window.convert());
|
||||
*x = llround((F32)cursor_pos_gl.mX / sGLScaleFactor.mV[VX]);
|
||||
*y = llround((F32)cursor_pos_gl.mY / sGLScaleFactor.mV[VX]);
|
||||
}
|
||||
|
|
@ -2052,7 +2059,7 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
|
|||
// Start at spawn position (using left/top)
|
||||
view->setOrigin( local_x, local_y - view->getRect().getHeight());
|
||||
// Make sure we're on-screen and not overlapping the mouse
|
||||
view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect, FALSE );
|
||||
view->translateIntoRectWithExclusion( virtual_window_rect, mouse_rect );
|
||||
}
|
||||
|
||||
LLView* LLUI::resolvePath(LLView* context, const std::string& path)
|
||||
|
|
|
|||
|
|
@ -128,17 +128,13 @@ void LLUIString::updateResult() const
|
|||
}
|
||||
mResult = mOrig;
|
||||
|
||||
// get the defailt args + local args
|
||||
if (!mArgs || mArgs->empty())
|
||||
// get the default args + local args
|
||||
LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs();
|
||||
if (mArgs && !mArgs->empty())
|
||||
{
|
||||
LLStringUtil::format(mResult, LLTrans::getDefaultArgs());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLStringUtil::format_map_t combined_args = LLTrans::getDefaultArgs();
|
||||
combined_args.insert(mArgs->begin(), mArgs->end());
|
||||
LLStringUtil::format(mResult, combined_args);
|
||||
}
|
||||
LLStringUtil::format(mResult, combined_args);
|
||||
}
|
||||
|
||||
void LLUIString::updateWResult() const
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ void LLView::drawChildren()
|
|||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom, 0.f);
|
||||
LLUI::translate((F32)viewp->getRect().mLeft, (F32)viewp->getRect().mBottom);
|
||||
// flag the fact we are in draw here, in case overridden draw() method attempts to remove this widget
|
||||
viewp->mInDraw = true;
|
||||
viewp->draw();
|
||||
|
|
@ -1159,7 +1159,7 @@ void LLView::drawDebugRect()
|
|||
|
||||
if (getUseBoundingRect())
|
||||
{
|
||||
LLUI::translate((F32)mBoundingRect.mLeft - (F32)mRect.mLeft, (F32)mBoundingRect.mBottom - (F32)mRect.mBottom, 0.f);
|
||||
LLUI::translate((F32)mBoundingRect.mLeft - (F32)mRect.mLeft, (F32)mBoundingRect.mBottom - (F32)mRect.mBottom);
|
||||
}
|
||||
|
||||
LLRect debug_rect = getUseBoundingRect() ? mBoundingRect : mRect;
|
||||
|
|
@ -1231,7 +1231,7 @@ void LLView::drawChild(LLView* childp, S32 x_offset, S32 y_offset, BOOL force_dr
|
|||
gGL.matrixMode(LLRender::MM_MODELVIEW);
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLUI::translate((F32)childp->getRect().mLeft + x_offset, (F32)childp->getRect().mBottom + y_offset, 0.f);
|
||||
LLUI::translate((F32)childp->getRect().mLeft + x_offset, (F32)childp->getRect().mBottom + y_offset);
|
||||
childp->draw();
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
|
|
@ -1300,7 +1300,10 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
S32 delta_x = child_rect.mLeft - viewp->getRect().mLeft;
|
||||
S32 delta_y = child_rect.mBottom - viewp->getRect().mBottom;
|
||||
viewp->translate( delta_x, delta_y );
|
||||
viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
|
||||
if (child_rect.getWidth() != viewp->getRect().getWidth() || child_rect.getHeight() != viewp->getRect().getHeight())
|
||||
{
|
||||
viewp->reshape(child_rect.getWidth(), child_rect.getHeight());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1616,59 +1619,30 @@ LLView* LLView::findNextSibling(LLView* child)
|
|||
}
|
||||
|
||||
|
||||
LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, BOOL allow_partial_outside)
|
||||
LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, S32 min_overlap_pixels)
|
||||
{
|
||||
LLCoordGL delta;
|
||||
|
||||
if (allow_partial_outside)
|
||||
const S32 KEEP_ONSCREEN_PIXELS_WIDTH = llmin(min_overlap_pixels, input.getWidth());
|
||||
const S32 KEEP_ONSCREEN_PIXELS_HEIGHT = llmin(min_overlap_pixels, input.getHeight());
|
||||
|
||||
if( input.mRight - KEEP_ONSCREEN_PIXELS_WIDTH < constraint.mLeft )
|
||||
{
|
||||
const S32 KEEP_ONSCREEN_PIXELS = 16;
|
||||
delta.mX = constraint.mLeft - (input.mRight - KEEP_ONSCREEN_PIXELS_WIDTH);
|
||||
}
|
||||
else if( input.mLeft + KEEP_ONSCREEN_PIXELS_WIDTH > constraint.mRight )
|
||||
{
|
||||
delta.mX = constraint.mRight - (input.mLeft + KEEP_ONSCREEN_PIXELS_WIDTH);
|
||||
}
|
||||
|
||||
if( input.mRight - KEEP_ONSCREEN_PIXELS < constraint.mLeft )
|
||||
{
|
||||
delta.mX = constraint.mLeft - (input.mRight - KEEP_ONSCREEN_PIXELS);
|
||||
}
|
||||
else
|
||||
if( input.mLeft + KEEP_ONSCREEN_PIXELS > constraint.mRight )
|
||||
{
|
||||
delta.mX = constraint.mRight - (input.mLeft + KEEP_ONSCREEN_PIXELS);
|
||||
}
|
||||
|
||||
if( input.mTop > constraint.mTop )
|
||||
{
|
||||
delta.mY = constraint.mTop - input.mTop;
|
||||
}
|
||||
else
|
||||
if( input.mTop - KEEP_ONSCREEN_PIXELS < constraint.mBottom )
|
||||
{
|
||||
delta.mY = constraint.mBottom - (input.mTop - KEEP_ONSCREEN_PIXELS);
|
||||
}
|
||||
if( input.mTop > constraint.mTop )
|
||||
{
|
||||
delta.mY = constraint.mTop - input.mTop;
|
||||
}
|
||||
else
|
||||
if( input.mTop - KEEP_ONSCREEN_PIXELS_HEIGHT < constraint.mBottom )
|
||||
{
|
||||
if( input.mLeft < constraint.mLeft )
|
||||
{
|
||||
delta.mX = constraint.mLeft - input.mLeft;
|
||||
}
|
||||
else
|
||||
if( input.mRight > constraint.mRight )
|
||||
{
|
||||
delta.mX = constraint.mRight - input.mRight;
|
||||
// compensate for left edge possible going off screen
|
||||
delta.mX += llmax( 0, input.getWidth() - constraint.getWidth() );
|
||||
}
|
||||
|
||||
if( input.mTop > constraint.mTop )
|
||||
{
|
||||
delta.mY = constraint.mTop - input.mTop;
|
||||
}
|
||||
else
|
||||
if( input.mBottom < constraint.mBottom )
|
||||
{
|
||||
delta.mY = constraint.mBottom - input.mBottom;
|
||||
// compensate for top edge possible going off screen
|
||||
delta.mY -= llmax( 0, input.getHeight() - constraint.getHeight() );
|
||||
}
|
||||
delta.mY = constraint.mBottom - (input.mTop - KEEP_ONSCREEN_PIXELS_HEIGHT);
|
||||
}
|
||||
|
||||
return delta;
|
||||
|
|
@ -1677,9 +1651,9 @@ LLCoordGL getNeededTranslation(const LLRect& input, const LLRect& constraint, BO
|
|||
// Moves the view so that it is entirely inside of constraint.
|
||||
// If the view will not fit because it's too big, aligns with the top and left.
|
||||
// (Why top and left? That's where the drag bars are for floaters.)
|
||||
BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outside )
|
||||
BOOL LLView::translateIntoRect(const LLRect& constraint, S32 min_overlap_pixels)
|
||||
{
|
||||
LLCoordGL translation = getNeededTranslation(getRect(), constraint, allow_partial_outside);
|
||||
LLCoordGL translation = getNeededTranslation(getRect(), constraint, min_overlap_pixels);
|
||||
|
||||
if (translation.mX != 0 || translation.mY != 0)
|
||||
{
|
||||
|
|
@ -1691,9 +1665,9 @@ BOOL LLView::translateIntoRect(const LLRect& constraint, BOOL allow_partial_outs
|
|||
|
||||
// move this view into "inside" but not onto "exclude"
|
||||
// NOTE: if this view is already contained in "inside", we ignore the "exclude" rect
|
||||
BOOL LLView::translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside )
|
||||
BOOL LLView::translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, S32 min_overlap_pixels)
|
||||
{
|
||||
LLCoordGL translation = getNeededTranslation(getRect(), inside, allow_partial_outside);
|
||||
LLCoordGL translation = getNeededTranslation(getRect(), inside, min_overlap_pixels);
|
||||
|
||||
if (translation.mX != 0 || translation.mY != 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -370,8 +370,8 @@ public:
|
|||
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
|
||||
virtual void translate( S32 x, S32 y );
|
||||
void setOrigin( S32 x, S32 y ) { mRect.translate( x - mRect.mLeft, y - mRect.mBottom ); }
|
||||
BOOL translateIntoRect( const LLRect& constraint, BOOL allow_partial_outside );
|
||||
BOOL translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, BOOL allow_partial_outside );
|
||||
BOOL translateIntoRect( const LLRect& constraint, S32 min_overlap_pixels = S32_MAX);
|
||||
BOOL translateIntoRectWithExclusion( const LLRect& inside, const LLRect& exclude, S32 min_overlap_pixels = S32_MAX);
|
||||
void centerWithin(const LLRect& bounds);
|
||||
|
||||
void setShape(const LLRect& new_rect, bool by_user = false);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ void LLLFSThread::initClass(bool local_is_threaded)
|
|||
//static
|
||||
S32 LLLFSThread::updateClass(U32 ms_elapsed)
|
||||
{
|
||||
sLocal->update(ms_elapsed);
|
||||
sLocal->update((F32)ms_elapsed);
|
||||
return sLocal->getPending();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ void LLVFSThread::initClass(bool local_is_threaded)
|
|||
//static
|
||||
S32 LLVFSThread::updateClass(U32 ms_elapsed)
|
||||
{
|
||||
sLocal->update(ms_elapsed);
|
||||
sLocal->update((F32)ms_elapsed);
|
||||
return sLocal->getPending();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,10 +124,9 @@ class LLDragDropWin32Target:
|
|||
ScreenToClient( mAppWindowHandle, &pt2 );
|
||||
|
||||
LLCoordWindow cursor_coord_window( pt2.x, pt2.y );
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
|
||||
LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( gl_coord, mask,
|
||||
LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( cursor_coord_window.convert(), mask,
|
||||
LLWindowCallbacks::DNDA_START_TRACKING, mDropUrl );
|
||||
|
||||
switch (result)
|
||||
|
|
@ -180,10 +179,9 @@ class LLDragDropWin32Target:
|
|||
ScreenToClient( mAppWindowHandle, &pt2 );
|
||||
|
||||
LLCoordWindow cursor_coord_window( pt2.x, pt2.y );
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
|
||||
LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( gl_coord, mask,
|
||||
LLWindowCallbacks::DragNDropResult result = window_imp->completeDragNDropRequest( cursor_coord_window.convert(), mask,
|
||||
LLWindowCallbacks::DNDA_TRACK, mDropUrl );
|
||||
|
||||
switch (result)
|
||||
|
|
@ -237,15 +235,13 @@ class LLDragDropWin32Target:
|
|||
LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLong( mAppWindowHandle, GWL_USERDATA );
|
||||
if ( NULL != window_imp )
|
||||
{
|
||||
LLCoordGL gl_coord( 0, 0 );
|
||||
|
||||
POINT pt_client;
|
||||
pt_client.x = pt.x;
|
||||
pt_client.y = pt.y;
|
||||
ScreenToClient( mAppWindowHandle, &pt_client );
|
||||
|
||||
LLCoordWindow cursor_coord_window( pt_client.x, pt_client.y );
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
LLCoordGL gl_coord(cursor_coord_window.convert());
|
||||
llinfos << "### (Drop) URL is: " << mDropUrl << llendl;
|
||||
llinfos << "### raw coords are: " << pt.x << " x " << pt.y << llendl;
|
||||
llinfos << "### client coords are: " << pt_client.x << " x " << pt_client.y << llendl;
|
||||
|
|
|
|||
|
|
@ -436,3 +436,42 @@ BOOL LLWindowManager::isWindowValid(LLWindow *window)
|
|||
{
|
||||
return sWindowList.find(window) != sWindowList.end();
|
||||
}
|
||||
|
||||
//coordinate conversion utility funcs that forward to llwindow
|
||||
LLCoordCommon LL_COORD_TYPE_WINDOW::convertToCommon() const
|
||||
{
|
||||
const LLCoordWindow& self = static_cast<const LLCoordWindow&>(*this);
|
||||
|
||||
LLWindow* windowp = &(*LLWindow::beginInstances());
|
||||
LLCoordGL out;
|
||||
windowp->convertCoords(self, &out);
|
||||
return out.convert();
|
||||
}
|
||||
|
||||
void LL_COORD_TYPE_WINDOW::convertFromCommon(const LLCoordCommon& from)
|
||||
{
|
||||
LLCoordWindow& self = static_cast<LLCoordWindow&>(*this);
|
||||
|
||||
LLWindow* windowp = &(*LLWindow::beginInstances());
|
||||
LLCoordGL from_gl(from);
|
||||
windowp->convertCoords(from_gl, &self);
|
||||
}
|
||||
|
||||
LLCoordCommon LL_COORD_TYPE_SCREEN::convertToCommon() const
|
||||
{
|
||||
const LLCoordScreen& self = static_cast<const LLCoordScreen&>(*this);
|
||||
|
||||
LLWindow* windowp = &(*LLWindow::beginInstances());
|
||||
LLCoordGL out;
|
||||
windowp->convertCoords(self, &out);
|
||||
return out.convert();
|
||||
}
|
||||
|
||||
void LL_COORD_TYPE_SCREEN::convertFromCommon(const LLCoordCommon& from)
|
||||
{
|
||||
LLCoordScreen& self = static_cast<LLCoordScreen&>(*this);
|
||||
|
||||
LLWindow* windowp = &(*LLWindow::beginInstances());
|
||||
LLCoordGL from_gl(from);
|
||||
windowp->convertCoords(from_gl, &self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class LLWindowCallbacks;
|
|||
|
||||
// Refer to llwindow_test in test/common/llwindow for usage example
|
||||
|
||||
class LLWindow
|
||||
class LLWindow : public LLInstanceTracker<LLWindow>
|
||||
{
|
||||
public:
|
||||
struct LLWindowResolution
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
|
||||
#include "llwindowcallbacks.h"
|
||||
|
||||
#include "llcoord.h"
|
||||
|
||||
//
|
||||
// LLWindowCallbacks
|
||||
//
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
#ifndef LLWINDOWCALLBACKS_H
|
||||
#define LLWINDOWCALLBACKS_H
|
||||
|
||||
class LLCoordGL;
|
||||
#include "llcoord.h"
|
||||
class LLWindow;
|
||||
|
||||
class LLWindowCallbacks
|
||||
|
|
|
|||
|
|
@ -1065,6 +1065,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Device context retrieved." << llendl ;
|
||||
|
||||
if (!(pixel_format = ChoosePixelFormat(mhDC, &pfd)))
|
||||
{
|
||||
close();
|
||||
|
|
@ -1073,6 +1075,8 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
LL_INFOS("Window") << "Pixel format chosen." << llendl ;
|
||||
|
||||
// Verify what pixel format we actually received.
|
||||
if (!DescribePixelFormat(mhDC, pixel_format, sizeof(PIXELFORMATDESCRIPTOR),
|
||||
&pfd))
|
||||
|
|
@ -1541,24 +1545,16 @@ void LLWindowWin32::moveWindow( const LLCoordScreen& position, const LLCoordScre
|
|||
|
||||
BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
|
||||
{
|
||||
LLCoordScreen screen_pos;
|
||||
|
||||
mMousePositionModified = TRUE;
|
||||
if (!mWindowHandle)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!convertCoords(position, &screen_pos))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// Inform the application of the new mouse position (needed for per-frame
|
||||
// hover/picking to function).
|
||||
LLCoordGL gl_pos;
|
||||
convertCoords(position, &gl_pos);
|
||||
mCallbacks->handleMouseMove(this, gl_pos, (MASK)0);
|
||||
mCallbacks->handleMouseMove(this, position.convert(), (MASK)0);
|
||||
|
||||
// DEV-18951 VWR-8524 Camera moves wildly when alt-clicking.
|
||||
// Because we have preemptively notified the application of the new
|
||||
|
|
@ -1568,24 +1564,23 @@ BOOL LLWindowWin32::setCursorPosition(const LLCoordWindow position)
|
|||
while (PeekMessage(&msg, NULL, WM_MOUSEMOVE, WM_MOUSEMOVE, PM_REMOVE))
|
||||
{ }
|
||||
|
||||
return SetCursorPos(screen_pos.mX, screen_pos.mY);
|
||||
LLCoordScreen screen_pos(position.convert());
|
||||
return ::SetCursorPos(screen_pos.mX, screen_pos.mY);
|
||||
}
|
||||
|
||||
BOOL LLWindowWin32::getCursorPosition(LLCoordWindow *position)
|
||||
{
|
||||
POINT cursor_point;
|
||||
LLCoordScreen screen_pos;
|
||||
|
||||
if (!mWindowHandle ||
|
||||
!GetCursorPos(&cursor_point))
|
||||
if (!mWindowHandle
|
||||
|| !GetCursorPos(&cursor_point)
|
||||
|| !position)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
screen_pos.mX = cursor_point.x;
|
||||
screen_pos.mY = cursor_point.y;
|
||||
|
||||
return convertCoords(screen_pos, position);
|
||||
*position = LLCoordScreen(cursor_point.x, cursor_point.y).convert();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLWindowWin32::hideCursor()
|
||||
|
|
@ -2163,15 +2158,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2193,15 +2188,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2226,15 +2221,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2261,15 +2256,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2290,15 +2285,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2325,15 +2320,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2354,15 +2349,15 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
// If we don't do this, many clicks could get buffered up, and if the
|
||||
// first click changes the cursor position, all subsequent clicks
|
||||
// will occur at the wrong location. JC
|
||||
LLCoordWindow cursor_coord_window;
|
||||
if (window_imp->mMousePositionModified)
|
||||
{
|
||||
LLCoordWindow cursor_coord_window;
|
||||
window_imp->getCursorPosition(&cursor_coord_window);
|
||||
window_imp->convertCoords(cursor_coord_window, &gl_coord);
|
||||
gl_coord = cursor_coord_window.convert();
|
||||
}
|
||||
else
|
||||
{
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
gl_coord = window_coord.convert();
|
||||
}
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
// generate move event to update mouse coordinates
|
||||
|
|
@ -2434,9 +2429,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
|
|||
case WM_MOUSEMOVE:
|
||||
{
|
||||
window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_MOUSEMOVE");
|
||||
window_imp->convertCoords(window_coord, &gl_coord);
|
||||
MASK mask = gKeyboard->currentMask(TRUE);
|
||||
window_imp->mCallbacks->handleMouseMove(window_imp, gl_coord, mask);
|
||||
window_imp->mCallbacks->handleMouseMove(window_imp, window_coord.convert(), mask);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -3324,7 +3318,7 @@ void LLWindowWin32::setLanguageTextInput( const LLCoordGL & position )
|
|||
|
||||
LLWinImm::setCompositionWindow( himc, &ime_form );
|
||||
|
||||
sWinIMEWindowPosition.set( win_pos.mX, win_pos.mY );
|
||||
sWinIMEWindowPosition = win_pos;
|
||||
}
|
||||
|
||||
LLWinImm::releaseContext(mWindowHandle, himc);
|
||||
|
|
|
|||
|
|
@ -92,6 +92,8 @@ typedef enum e_control_type
|
|||
|
||||
class LLControlVariable : public LLRefCount
|
||||
{
|
||||
LOG_CLASS(LLControlVariable);
|
||||
|
||||
friend class LLControlGroup;
|
||||
|
||||
public:
|
||||
|
|
@ -180,6 +182,8 @@ T convert_from_llsd(const LLSD& sd, eControlType type, const std::string& contro
|
|||
//const U32 STRING_CACHE_SIZE = 10000;
|
||||
class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
|
||||
{
|
||||
LOG_CLASS(LLControlGroup);
|
||||
|
||||
protected:
|
||||
typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
|
||||
ctrl_name_table_t mNameTable;
|
||||
|
|
|
|||
|
|
@ -631,13 +631,14 @@ bool LLXMLNode::updateNode(
|
|||
}
|
||||
|
||||
//update all of node's children with updateNodes children that match name
|
||||
LLXMLNodePtr child;
|
||||
LLXMLNodePtr child = node->getFirstChild();
|
||||
LLXMLNodePtr last_child = child;
|
||||
LLXMLNodePtr updateChild;
|
||||
|
||||
for (updateChild = update_node->getFirstChild(); updateChild.notNull();
|
||||
updateChild = updateChild->getNextSibling())
|
||||
{
|
||||
for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
||||
while(child.notNull())
|
||||
{
|
||||
std::string nodeName;
|
||||
std::string updateName;
|
||||
|
|
@ -656,6 +657,22 @@ bool LLXMLNode::updateNode(
|
|||
if ((nodeName != "") && (updateName == nodeName))
|
||||
{
|
||||
updateNode(child, updateChild);
|
||||
last_child = child;
|
||||
child = child->getNextSibling();
|
||||
if (child.isNull())
|
||||
{
|
||||
child = node->getFirstChild();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
child = child->getNextSibling();
|
||||
if (child.isNull())
|
||||
{
|
||||
child = node->getFirstChild();
|
||||
}
|
||||
if (child == last_child)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -784,7 +801,7 @@ bool LLXMLNode::parseStream(
|
|||
while(str.good())
|
||||
{
|
||||
str.read((char*)buffer, BUFSIZE);
|
||||
int count = str.gcount();
|
||||
int count = (int)str.gcount();
|
||||
|
||||
if (XML_Parse(my_parser, (const char *)buffer, count, !str.good()) != XML_STATUS_OK)
|
||||
{
|
||||
|
|
@ -882,11 +899,8 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
|
|||
|
||||
for (itor = paths.begin(), ++itor; itor != paths.end(); ++itor)
|
||||
{
|
||||
std::string nodeName;
|
||||
std::string updateName;
|
||||
|
||||
std::string layer_filename = *itor;
|
||||
if(layer_filename.empty())
|
||||
if(layer_filename.empty() || layer_filename == filename)
|
||||
{
|
||||
// no localized version of this file, that's ok, keep looking
|
||||
continue;
|
||||
|
|
@ -898,6 +912,9 @@ bool LLXMLNode::getLayeredXMLNode(LLXMLNodePtr& root,
|
|||
return false;
|
||||
}
|
||||
|
||||
std::string nodeName;
|
||||
std::string updateName;
|
||||
|
||||
updateRoot->getAttributeString("name", updateName);
|
||||
root->getAttributeString("name", nodeName);
|
||||
|
||||
|
|
|
|||
|
|
@ -1253,15 +1253,16 @@ namespace LLInitParam
|
|||
return mValues.back();
|
||||
}
|
||||
|
||||
void add(const value_t& item)
|
||||
self_t& add(const value_t& item)
|
||||
{
|
||||
param_value_t param_value;
|
||||
param_value.setValue(item);
|
||||
mValues.push_back(param_value);
|
||||
setProvided();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void add(const typename name_value_lookup_t::name_t& name)
|
||||
self_t& add(const typename name_value_lookup_t::name_t& name)
|
||||
{
|
||||
value_t value;
|
||||
|
||||
|
|
@ -1271,6 +1272,8 @@ namespace LLInitParam
|
|||
add(value);
|
||||
mValues.back().setValueName(name);
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
// implicit conversion
|
||||
|
|
@ -1441,13 +1444,14 @@ namespace LLInitParam
|
|||
return mValues.back();
|
||||
}
|
||||
|
||||
void add(const value_t& item)
|
||||
self_t& add(const value_t& item)
|
||||
{
|
||||
mValues.push_back(item);
|
||||
setProvided();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void add(const typename name_value_lookup_t::name_t& name)
|
||||
self_t& add(const typename name_value_lookup_t::name_t& name)
|
||||
{
|
||||
value_t value;
|
||||
|
||||
|
|
@ -1457,6 +1461,7 @@ namespace LLInitParam
|
|||
add(value);
|
||||
mValues.back().setValueName(name);
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
// implicit conversion
|
||||
|
|
|
|||
|
|
@ -705,7 +705,7 @@ private:
|
|||
// look up "Display Name" in meta data
|
||||
OSType meta_data_key = kQTMetaDataCommonKeyDisplayName;
|
||||
QTMetaDataItem item = kQTMetaDataItemUninitialized;
|
||||
result = QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard,
|
||||
result = (OSErr)QTMetaDataGetNextItem( media_data_ref, kQTMetaDataStorageFormatWildcard,
|
||||
0, kQTMetaDataKeyFormatCommon,
|
||||
(const UInt8 *)&meta_data_key,
|
||||
sizeof( meta_data_key ), &item );
|
||||
|
|
@ -714,14 +714,14 @@ private:
|
|||
|
||||
// find the size of the title
|
||||
ByteCount size;
|
||||
result = QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
|
||||
result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, NULL, 0, &size );
|
||||
if ( noErr != result || size <= 0 /*|| size > 1024 FIXME: arbitrary limit */ )
|
||||
return false;
|
||||
|
||||
// allocate some space and grab it
|
||||
UInt8* item_data = new UInt8[ size + 1 ];
|
||||
memset( item_data, 0, ( size + 1 ) * sizeof( UInt8 ) );
|
||||
result = QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
|
||||
result = (OSErr)QTMetaDataGetItemValue( media_data_ref, item, item_data, size, NULL );
|
||||
if ( noErr != result )
|
||||
{
|
||||
delete [] item_data;
|
||||
|
|
|
|||
|
|
@ -991,7 +991,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
{
|
||||
if(message_name == "set_volume")
|
||||
{
|
||||
F32 volume = message_in.getValueReal("volume");
|
||||
F32 volume = (F32)message_in.getValueReal("volume");
|
||||
setVolume(volume);
|
||||
}
|
||||
}
|
||||
|
|
@ -1057,9 +1057,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
S32 height = message_in.getValueS32("height");
|
||||
S32 texture_width = message_in.getValueS32("texture_width");
|
||||
S32 texture_height = message_in.getValueS32("texture_height");
|
||||
mBackgroundR = message_in.getValueReal("background_r");
|
||||
mBackgroundG = message_in.getValueReal("background_g");
|
||||
mBackgroundB = message_in.getValueReal("background_b");
|
||||
mBackgroundR = (F32)message_in.getValueReal("background_r");
|
||||
mBackgroundG = (F32)message_in.getValueReal("background_g");
|
||||
mBackgroundB = (F32)message_in.getValueReal("background_b");
|
||||
// mBackgroundA = message_in.setValueReal("background_a"); // Ignore any alpha
|
||||
|
||||
if(!name.empty())
|
||||
|
|
@ -1245,9 +1245,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
if(message_name == "js_agent_location")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 9
|
||||
F32 x = message_in.getValueReal("x");
|
||||
F32 y = message_in.getValueReal("y");
|
||||
F32 z = message_in.getValueReal("z");
|
||||
F32 x = (F32)message_in.getValueReal("x");
|
||||
F32 y = (F32)message_in.getValueReal("y");
|
||||
F32 z = (F32)message_in.getValueReal("z");
|
||||
LLQtWebKit::getInstance()->setAgentLocation( x, y, z );
|
||||
LLQtWebKit::getInstance()->emitLocation();
|
||||
#endif
|
||||
|
|
@ -1256,9 +1256,9 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
if(message_name == "js_agent_global_location")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 9
|
||||
F32 x = message_in.getValueReal("x");
|
||||
F32 y = message_in.getValueReal("y");
|
||||
F32 z = message_in.getValueReal("z");
|
||||
F32 x = (F32)message_in.getValueReal("x");
|
||||
F32 y = (F32)message_in.getValueReal("y");
|
||||
F32 z = (F32)message_in.getValueReal("z");
|
||||
LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z );
|
||||
LLQtWebKit::getInstance()->emitLocation();
|
||||
#endif
|
||||
|
|
@ -1267,7 +1267,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
if(message_name == "js_agent_orientation")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 9
|
||||
F32 angle = message_in.getValueReal("angle");
|
||||
F32 angle = (F32)message_in.getValueReal("angle");
|
||||
LLQtWebKit::getInstance()->setAgentOrientation( angle );
|
||||
LLQtWebKit::getInstance()->emitLocation();
|
||||
#endif
|
||||
|
|
@ -1323,7 +1323,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
|
|||
else if(message_name == "set_page_zoom_factor")
|
||||
{
|
||||
#if LLQTWEBKIT_API_VERSION >= 15
|
||||
F32 factor = message_in.getValueReal("factor");
|
||||
F32 factor = (F32)message_in.getValueReal("factor");
|
||||
LLQtWebKit::getInstance()->setPageZoomFactor(factor);
|
||||
#else
|
||||
llwarns << "Ignoring setPageZoomFactor message (llqtwebkit version is too old)." << llendl;
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ set(viewer_SOURCE_FILES
|
|||
llfirstuse.cpp
|
||||
llflexibleobject.cpp
|
||||
llfloaterabout.cpp
|
||||
llfloateranimpreview.cpp
|
||||
llfloaterbvhpreview.cpp
|
||||
llfloaterauction.cpp
|
||||
llfloateravatar.cpp
|
||||
llfloateravatarpicker.cpp
|
||||
|
|
@ -724,7 +724,7 @@ set(viewer_HEADER_FILES
|
|||
llfirstuse.h
|
||||
llflexibleobject.h
|
||||
llfloaterabout.h
|
||||
llfloateranimpreview.h
|
||||
llfloaterbvhpreview.h
|
||||
llfloaterauction.h
|
||||
llfloateravatar.h
|
||||
llfloateravatarpicker.h
|
||||
|
|
@ -1347,7 +1347,9 @@ if (WINDOWS)
|
|||
DXGUID_LIBRARY
|
||||
)
|
||||
|
||||
# see EXP-1765 - theory is opengl32.lib needs to be included before gdi32.lib (windows libs)
|
||||
set(viewer_LIBRARIES
|
||||
opengl32
|
||||
${WINDOWS_LIBRARIES}
|
||||
comdlg32
|
||||
${DINPUT_LIBRARY}
|
||||
|
|
@ -1357,7 +1359,6 @@ if (WINDOWS)
|
|||
odbccp32
|
||||
ole32
|
||||
oleaut32
|
||||
opengl32
|
||||
shell32
|
||||
Vfw32
|
||||
winspool
|
||||
|
|
|
|||
|
|
@ -37,6 +37,8 @@
|
|||
tooltip_ref="Command_Build_Tooltip"
|
||||
execute_function="Build.Toggle"
|
||||
execute_parameters="build"
|
||||
is_enabled_function="Build.Enabled"
|
||||
is_enabled_parameters="build"
|
||||
is_running_function="Floater.IsOpen"
|
||||
is_running_parameters="build"
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -4281,6 +4281,17 @@
|
|||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>InventoryInboxToggleState</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Stores the open/closed state of inventory Received items panel</string>
|
||||
<key>Persist</key>
|
||||
<integer>1</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>InventoryLinking</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -55,6 +55,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -59,6 +59,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -50,18 +50,18 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
uniform float cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -77,7 +77,7 @@ void main()
|
|||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
P *= (max_y / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -99,12 +99,12 @@ void main()
|
|||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
temp1 = blue_density + haze_density;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
haze_weight = haze_density / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
|
|
@ -112,7 +112,7 @@ void main()
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
|
|
@ -136,14 +136,14 @@ void main()
|
|||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// CLOUDS
|
||||
|
|
@ -164,13 +164,13 @@ void main()
|
|||
vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - temp1);
|
||||
|
||||
// Make a nice cloud density based on the cloud_shadow value that was passed in.
|
||||
vary_CloudDensity = 2. * (cloud_shadow.x - 0.25);
|
||||
vary_CloudDensity = 2. * (cloud_shadow - 0.25);
|
||||
|
||||
|
||||
// Texture coords
|
||||
vary_texcoord0 = texcoord0;
|
||||
vary_texcoord0.xy -= 0.5;
|
||||
vary_texcoord0.xy /= cloud_scale.x;
|
||||
vary_texcoord0.xy /= cloud_scale;
|
||||
vary_texcoord0.xy += 0.5;
|
||||
|
||||
vary_texcoord1 = vary_texcoord0;
|
||||
|
|
|
|||
|
|
@ -44,19 +44,17 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
|
|
@ -71,7 +69,7 @@ void main()
|
|||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
P *= (max_y / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -93,12 +91,12 @@ void main()
|
|||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
temp1 = blue_density + haze_density;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
haze_weight = haze_density / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
|
|
@ -106,7 +104,7 @@ void main()
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
|
|
@ -131,20 +129,20 @@ void main()
|
|||
|
||||
// Haze color above cloud
|
||||
vary_HazeColor = ( blue_horizon * blue_weight * (sunlight + ambient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + ambient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + ambient)
|
||||
);
|
||||
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// Final atmosphere additive
|
||||
|
|
|
|||
|
|
@ -51,12 +51,12 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 distance_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
uniform float scene_light_strength;
|
||||
uniform mat3 env_mat;
|
||||
|
|
@ -159,13 +159,13 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density.r);
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density.r) / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
|
|
@ -173,12 +173,12 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
setAtmosAttenuation(temp1.rgb);
|
||||
|
|
@ -199,7 +199,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
temp2.x += .25;
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
/* decrease value and saturation (that in HSV, not HSL) for occluded areas
|
||||
* // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
|
||||
|
|
@ -213,8 +213,8 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
|
||||
//haze color
|
||||
setAdditiveColor(
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient)));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
|
|
|
|||
|
|
@ -61,6 +61,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -63,6 +63,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -60,6 +60,12 @@ uniform vec3 light_direction[8];
|
|||
uniform vec3 light_attenuation[8];
|
||||
uniform vec3 light_diffuse[8];
|
||||
|
||||
float calcDirectionalLight(vec3 n, vec3 l)
|
||||
{
|
||||
float a = max(dot(n,l),0.0);
|
||||
return a;
|
||||
}
|
||||
|
||||
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight)
|
||||
{
|
||||
//get light vector
|
||||
|
|
|
|||
|
|
@ -51,12 +51,12 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 distance_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
uniform float scene_light_strength;
|
||||
uniform mat3 env_mat;
|
||||
|
|
@ -161,13 +161,13 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density.r);
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density.r) / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
|
|
@ -175,12 +175,12 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
setAtmosAttenuation(temp1.rgb);
|
||||
|
|
@ -201,7 +201,7 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
temp2.x += .25;
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
/* decrease value and saturation (that in HSV, not HSL) for occluded areas
|
||||
* // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html
|
||||
|
|
@ -215,8 +215,8 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
|
|||
|
||||
//haze color
|
||||
setAdditiveColor(
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient)));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 distance_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float distance_multiplier;
|
||||
uniform float max_y;
|
||||
uniform vec4 glow;
|
||||
|
||||
void calcAtmospherics(vec3 inPositionEye) {
|
||||
|
|
@ -61,8 +61,8 @@ void calcAtmospherics(vec3 inPositionEye) {
|
|||
setPositionEye(P);
|
||||
|
||||
//(TERRAIN) limit altitude
|
||||
if (P.y > max_y.x) P *= (max_y.x / P.y);
|
||||
if (P.y < -max_y.x) P *= (-max_y.x / P.y);
|
||||
if (P.y > max_y) P *= (max_y / P.y);
|
||||
if (P.y < -max_y) P *= (-max_y / P.y);
|
||||
|
||||
vec3 tmpLightnorm = lightnorm.xyz;
|
||||
|
||||
|
|
@ -78,13 +78,13 @@ void calcAtmospherics(vec3 inPositionEye) {
|
|||
|
||||
//sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
//this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
//I had thought blue_density and haze_density should have equal weighting,
|
||||
//but attenuation due to haze_density tends to seem too strong
|
||||
|
||||
temp1 = blue_density + vec4(haze_density.r);
|
||||
temp1 = blue_density + vec4(haze_density);
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = vec4(haze_density.r) / temp1;
|
||||
haze_weight = vec4(haze_density) / temp1;
|
||||
|
||||
//(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain)
|
||||
temp2.y = max(0.0, tmpLightnorm.y);
|
||||
|
|
@ -92,12 +92,12 @@ void calcAtmospherics(vec3 inPositionEye) {
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// main atmospheric scattering line integral
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati
|
||||
// ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier in a variable because the ati
|
||||
// compiler gets confused.
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier.x);
|
||||
temp1 = exp(-temp1 * temp2.z * distance_multiplier);
|
||||
|
||||
//final atmosphere attenuation factor
|
||||
setAtmosAttenuation(temp1.rgb);
|
||||
|
|
@ -122,12 +122,12 @@ void calcAtmospherics(vec3 inPositionEye) {
|
|||
|
||||
|
||||
//increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5;
|
||||
vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow * 0.5;
|
||||
|
||||
//haze color
|
||||
setAdditiveColor(
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x
|
||||
vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
|
||||
+ tmpAmbient)));
|
||||
|
||||
//brightness of surface both sunlight and ambient
|
||||
|
|
|
|||
|
|
@ -49,18 +49,18 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
uniform float cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -76,7 +76,7 @@ void main()
|
|||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
P *= (max_y / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -98,12 +98,12 @@ void main()
|
|||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
temp1 = blue_density + haze_density;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
haze_weight = haze_density / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
|
|
@ -111,7 +111,7 @@ void main()
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
|
|
@ -135,14 +135,14 @@ void main()
|
|||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// CLOUDS
|
||||
|
|
@ -163,13 +163,13 @@ void main()
|
|||
vec4 oHazeColorBelowCloud = additiveColorBelowCloud * (1. - temp1);
|
||||
|
||||
// Make a nice cloud density based on the cloud_shadow value that was passed in.
|
||||
vary_CloudDensity = 2. * (cloud_shadow.x - 0.25);
|
||||
vary_CloudDensity = 2. * (cloud_shadow - 0.25);
|
||||
|
||||
|
||||
// Texture coords
|
||||
vary_texcoord0 = texcoord0;
|
||||
vary_texcoord0.xy -= 0.5;
|
||||
vary_texcoord0.xy /= cloud_scale.x;
|
||||
vary_texcoord0.xy /= cloud_scale;
|
||||
vary_texcoord0.xy += 0.5;
|
||||
|
||||
vary_texcoord1 = vary_texcoord0;
|
||||
|
|
|
|||
|
|
@ -42,19 +42,17 @@ uniform vec4 sunlight_color;
|
|||
uniform vec4 ambient;
|
||||
uniform vec4 blue_horizon;
|
||||
uniform vec4 blue_density;
|
||||
uniform vec4 haze_horizon;
|
||||
uniform vec4 haze_density;
|
||||
uniform float haze_horizon;
|
||||
uniform float haze_density;
|
||||
|
||||
uniform vec4 cloud_shadow;
|
||||
uniform vec4 density_multiplier;
|
||||
uniform vec4 max_y;
|
||||
uniform float cloud_shadow;
|
||||
uniform float density_multiplier;
|
||||
uniform float max_y;
|
||||
|
||||
uniform vec4 glow;
|
||||
|
||||
uniform vec4 cloud_color;
|
||||
|
||||
uniform vec4 cloud_scale;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
|
|
@ -68,7 +66,7 @@ void main()
|
|||
// Set altitude
|
||||
if (P.y > 0.)
|
||||
{
|
||||
P *= (max_y.x / P.y);
|
||||
P *= (max_y / P.y);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -87,15 +85,14 @@ void main()
|
|||
vec4 sunlight = sunlight_color;
|
||||
vec4 light_atten;
|
||||
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
light_atten = (blue_density * 1.0 + haze_density.x * 0.25) * (density_multiplier.x * max_y.x);
|
||||
light_atten = (blue_density + vec4(haze_density * 0.25)) * (density_multiplier * max_y);
|
||||
|
||||
// Calculate relative weights
|
||||
temp1 = blue_density + haze_density.x;
|
||||
temp1 = blue_density + haze_density;
|
||||
blue_weight = blue_density / temp1;
|
||||
haze_weight = haze_density.x / temp1;
|
||||
haze_weight = haze_density / temp1;
|
||||
|
||||
// Compute sunlight from P & lightnorm (for long rays like sky)
|
||||
temp2.y = max(0., max(0., Pn.y) * 1.0 + lightnorm.y );
|
||||
|
|
@ -103,7 +100,7 @@ void main()
|
|||
sunlight *= exp( - light_atten * temp2.y);
|
||||
|
||||
// Distance
|
||||
temp2.z = Plen * density_multiplier.x;
|
||||
temp2.z = Plen * density_multiplier;
|
||||
|
||||
// Transparency (-> temp1)
|
||||
// ATI Bugfix -- can't store temp1*temp2.z in a variable because the ati
|
||||
|
|
@ -128,20 +125,20 @@ void main()
|
|||
|
||||
// Haze color above cloud
|
||||
vary_HazeColor = ( blue_horizon * blue_weight * (sunlight + ambient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + ambient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + ambient)
|
||||
);
|
||||
|
||||
|
||||
// Increase ambient when there are more clouds
|
||||
vec4 tmpAmbient = ambient;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow.x * 0.5;
|
||||
tmpAmbient += (1. - tmpAmbient) * cloud_shadow * 0.5;
|
||||
|
||||
// Dim sunlight by cloud shadow percentage
|
||||
sunlight *= (1. - cloud_shadow.x);
|
||||
sunlight *= (1. - cloud_shadow);
|
||||
|
||||
// Haze color below cloud
|
||||
vec4 additiveColorBelowCloud = ( blue_horizon * blue_weight * (sunlight + tmpAmbient)
|
||||
+ (haze_horizon.r * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
+ (haze_horizon * haze_weight) * (sunlight * temp2.x + tmpAmbient)
|
||||
);
|
||||
|
||||
// Final atmosphere additive
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ RenderGamma 1 0
|
|||
RenderGlowResolutionPow 1 9
|
||||
RenderGround 1 1
|
||||
RenderMaxPartCount 1 8192
|
||||
RenderNightBrightness 1 1.0
|
||||
RenderObjectBump 1 1
|
||||
RenderLocalLights 1 1
|
||||
RenderReflectionDetail 1 4
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ RenderGlowResolutionPow 1 9
|
|||
RenderGround 1 1
|
||||
RenderLocalLights 1 1
|
||||
RenderMaxPartCount 1 8192
|
||||
RenderNightBrightness 1 1.0
|
||||
RenderObjectBump 1 1
|
||||
RenderReflectionDetail 1 4
|
||||
RenderTerrainDetail 1 1
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ RenderGlowResolutionPow 1 9
|
|||
RenderGround 1 1
|
||||
RenderLocalLights 1 1
|
||||
RenderMaxPartCount 1 8192
|
||||
RenderNightBrightness 1 1.0
|
||||
RenderObjectBump 1 1
|
||||
RenderReflectionDetail 1 4
|
||||
RenderTerrainDetail 1 1
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ RenderGlowResolutionPow 1 9
|
|||
RenderGround 1 1
|
||||
RenderLocalLights 1 1
|
||||
RenderMaxPartCount 1 8192
|
||||
RenderNightBrightness 1 1.0
|
||||
RenderObjectBump 1 1
|
||||
RenderReflectionDetail 1 4
|
||||
RenderTerrainDetail 1 1
|
||||
|
|
|
|||
|
|
@ -169,11 +169,7 @@ bool LLAgent::isActionAllowed(const LLSD& sdname)
|
|||
|
||||
const std::string& param = sdname.asString();
|
||||
|
||||
if (param == "build")
|
||||
{
|
||||
retval = gAgent.canEditParcel();
|
||||
}
|
||||
else if (param == "speak")
|
||||
if (param == "speak")
|
||||
{
|
||||
if ( gAgent.isVoiceConnected() &&
|
||||
LLViewerParcelMgr::getInstance()->allowAgentVoice() &&
|
||||
|
|
|
|||
|
|
@ -817,7 +817,10 @@ void LLAgentWearables::popWearable(const LLWearableType::EType type, U32 index)
|
|||
if (wearable)
|
||||
{
|
||||
mWearableDatas[type].erase(mWearableDatas[type].begin() + index);
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
gAgentAvatarp->wearableUpdated(wearable->getType(), TRUE);
|
||||
}
|
||||
wearable->setLabelUpdated();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,8 @@
|
|||
|
||||
#include "llmemtype.h"
|
||||
|
||||
#include "llwindowwin32.cpp" // *FIX: for setting gIconResource.
|
||||
#include "llwindowwin32.h" // *FIX: for setting gIconResource.
|
||||
#include "llgl.h"
|
||||
#include "res/resource.h" // *FIX: for setting gIconResource.
|
||||
|
||||
#include <fcntl.h> //_O_APPEND
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ void LLCallFloater::draw()
|
|||
|
||||
// Need to resort the participant list if it's in sort by recent speaker order.
|
||||
if (mParticipants)
|
||||
mParticipants->updateRecentSpeakersOrder();
|
||||
mParticipants->update();
|
||||
|
||||
LLFloater::draw();
|
||||
}
|
||||
|
|
@ -333,6 +333,7 @@ void LLCallFloater::refreshParticipantList()
|
|||
|
||||
if (!non_avatar_caller)
|
||||
{
|
||||
llassert(mParticipants == NULL); // check for possible memory leak
|
||||
mParticipants = new LLParticipantList(mSpeakerManager, mAvatarList, true, mVoiceType != VC_GROUP_CHAT && mVoiceType != VC_AD_HOC_CHAT, false);
|
||||
mParticipants->setValidateSpeakerCallback(boost::bind(&LLCallFloater::validateSpeaker, this, _1));
|
||||
const U32 speaker_sort_order = gSavedSettings.getU32("SpeakerParticipantDefaultOrder");
|
||||
|
|
|
|||
|
|
@ -1113,8 +1113,8 @@ LLChicletPanel::~LLChicletPanel()
|
|||
}
|
||||
}
|
||||
|
||||
void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
|
||||
|
||||
void LLChicletPanel::onMessageCountChanged(const LLSD& data)
|
||||
{
|
||||
LLUUID session_id = data["session_id"].asUUID();
|
||||
S32 unread = data["participant_unread"].asInteger();
|
||||
|
||||
|
|
@ -1139,7 +1139,7 @@ void im_chiclet_callback(LLChicletPanel* panel, const LLSD& data){
|
|||
}
|
||||
}
|
||||
|
||||
void object_chiclet_callback(const LLSD& data)
|
||||
void LLChicletPanel::objectChicletCallback(const LLSD& data)
|
||||
{
|
||||
LLUUID notification_id = data["notification_id"];
|
||||
bool new_message = data["new_message"];
|
||||
|
|
@ -1163,10 +1163,10 @@ void object_chiclet_callback(const LLSD& data)
|
|||
BOOL LLChicletPanel::postBuild()
|
||||
{
|
||||
LLPanel::postBuild();
|
||||
LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1));
|
||||
LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1));
|
||||
LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(object_chiclet_callback, _1));
|
||||
LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(object_chiclet_callback, _1));
|
||||
LLIMModel::instance().addNewMsgCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1));
|
||||
LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLChicletPanel::onMessageCountChanged, this, _1));
|
||||
LLScriptFloaterManager::getInstance()->addNewObjectCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1));
|
||||
LLScriptFloaterManager::getInstance()->addToggleObjectFloaterCallback(boost::bind(&LLChicletPanel::objectChicletCallback, this, _1));
|
||||
LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet<LLChiclet>, this, _1));
|
||||
LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1));
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue