# Conflicts:
#	indra/cmake/Copy3rdPartyLibs.cmake
#	indra/newview/llcontrolavatar.cpp
#	indra/newview/lldrawpoolterrain.cpp
#	indra/newview/llmeshrepository.cpp
#	indra/newview/llviewerdisplay.cpp
#	indra/newview/llviewerwindow.cpp
#	indra/newview/llvoavatar.cpp
master
Ansariel 2024-07-22 20:58:53 +02:00
commit e17c906698
42 changed files with 303 additions and 273 deletions

View File

@ -1689,6 +1689,15 @@
</map> </map>
<key>llca</key> <key>llca</key>
<map> <map>
<key>copyright</key>
<string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
</string>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/ca-license.txt</string>
<key>name</key>
<string>llca</string>
<key>platforms</key> <key>platforms</key>
<map> <map>
<key>common</key> <key>common</key>
@ -1696,27 +1705,18 @@
<key>archive</key> <key>archive</key>
<map> <map>
<key>hash</key> <key>hash</key>
<string>a9503e1b4e1d9790cf29d18a3d9ab39e6a515679</string> <string>6d6771706a5b70caa24893ff62afc925f8d035f6</string>
<key>hash_algorithm</key> <key>hash_algorithm</key>
<string>sha1</string> <string>sha1</string>
<key>url</key> <key>url</key>
<string>https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst</string> <string>https://github.com/secondlife/llca/releases/download/v202407221723.0-a0fd5b9/llca-202407221423.0-common-10042698865.tar.zst</string>
</map> </map>
<key>name</key> <key>name</key>
<string>common</string> <string>common</string>
</map> </map>
</map> </map>
<key>license</key>
<string>mit</string>
<key>license_file</key>
<string>LICENSES/ca-license.txt</string>
<key>copyright</key>
<string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project.
</string>
<key>version</key> <key>version</key>
<string>202402012004.0</string> <string>202407221423.0</string>
<key>name</key>
<string>llca</string>
</map> </map>
<key>llphysicsextensions_source</key> <key>llphysicsextensions_source</key>
<map> <map>

View File

@ -39,6 +39,10 @@ add_compile_definitions( ADDRESS_SIZE=${ADDRESS_SIZE})
# -- which we do. Without one or the other, we get a ton of Boost warnings. # -- which we do. Without one or the other, we get a ton of Boost warnings.
add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS) add_compile_definitions(BOOST_BIND_GLOBAL_PLACEHOLDERS)
# Force enable SSE2 instructions in GLM per the manual
# https://github.com/g-truc/glm/blob/master/manual.md#section2_10
add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES=1 GLM_FORCE_SSE2=1)
# Configure crash reporting # Configure crash reporting
set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds") set(RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in release builds")
set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds") set(NON_RELEASE_CRASH_REPORTING OFF CACHE BOOL "Enable use of crash reporting in developer builds")

View File

@ -152,9 +152,14 @@ if(WINDOWS)
# Check each of them. # Check each of them.
foreach(release_msvc_file foreach(release_msvc_file
msvcp${MSVC_VER}.dll msvcp${MSVC_VER}.dll
msvcp${MSVC_VER}_1.dll
msvcp${MSVC_VER}_2.dll
msvcp${MSVC_VER}_atomic_wait.dll
msvcp${MSVC_VER}_codecvt_ids.dll
#msvcr${MSVC_VER}.dll # <FS:Ansariel> Can't build with older VS versions anyway - no need trying to copy this file #msvcr${MSVC_VER}.dll # <FS:Ansariel> Can't build with older VS versions anyway - no need trying to copy this file
vcruntime${MSVC_VER}.dll vcruntime${MSVC_VER}.dll
vcruntime${MSVC_VER}_1.dll vcruntime${MSVC_VER}_1.dll
vcruntime${MSVC_VER}_threads.dll
) )
if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}") if(redist_path AND EXISTS "${redist_path}/${release_msvc_file}")
MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}") MESSAGE(STATUS "Copying redist file from ${redist_path}/${release_msvc_file}")

View File

@ -90,7 +90,7 @@ bool LLApp::sDisableCrashlogger = false;
// Local flag for whether or not to do logging in signal handlers. // Local flag for whether or not to do logging in signal handlers.
//static //static
bool LLApp::sLogInSignal = false; bool LLApp::sLogInSignal = true;
// static // static
// Keeps track of application status // Keeps track of application status
@ -373,6 +373,9 @@ static std::map<LLApp::EAppStatus, const char*> statusDesc
// static // static
void LLApp::setStatus(EAppStatus status) void LLApp::setStatus(EAppStatus status)
{ {
auto status_it = statusDesc.find(status);
std::string status_text = status_it != statusDesc.end() ? std::string(status_it->second) : std::to_string(status);
LL_INFOS() << "status: " << status_text << LL_ENDL;
// notify everyone waiting on sStatus any time its value changes // notify everyone waiting on sStatus any time its value changes
sStatus.set_all(status); sStatus.set_all(status);
@ -381,18 +384,7 @@ void LLApp::setStatus(EAppStatus status)
if (! LLEventPumps::wasDeleted()) if (! LLEventPumps::wasDeleted())
{ {
// notify interested parties of status change // notify interested parties of status change
LLSD statsd; LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", status_text));
auto found = statusDesc.find(status);
if (found != statusDesc.end())
{
statsd = found->second;
}
else
{
// unknown status? at least report value
statsd = LLSD::Integer(status);
}
LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", statsd));
} }
} }
@ -687,6 +679,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
{ {
LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL; LL_WARNS() << "Signal handler - Handling fatal signal!" << LL_ENDL;
} }
if (LLApp::isError()) if (LLApp::isError())
{ {
// Received second fatal signal while handling first, just die right now // Received second fatal signal while handling first, just die right now
@ -724,11 +717,11 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
clear_signals(); clear_signals();
raise(signum); raise(signum);
return; return;
} else { }
if (LLApp::sLogInSignal)
{ if (LLApp::sLogInSignal)
LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL; {
} LL_INFOS() << "Signal handler - Unhandled signal " << signum << ", ignoring!" << LL_ENDL;
} }
} }
} }

View File

@ -951,7 +951,7 @@ LLSDBinaryParser::~LLSDBinaryParser()
// virtual // virtual
S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const S32 LLSDBinaryParser::doParse(std::istream& istr, LLSD& data, S32 max_depth) const
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD LL_PROFILE_ZONE_SCOPED_CATEGORY_LLSD;
/** /**
* Undefined: '!'<br> * Undefined: '!'<br>
* Boolean: '1' for true '0' for false<br> * Boolean: '1' for true '0' for false<br>

View File

@ -276,14 +276,15 @@ S32 LLImageJ2C::calcDataSizeJ2C(S32 w, S32 h, S32 comp, S32 discard_level, F32 r
// Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl(). // Estimate the number of layers. This is consistent with what's done for j2c encoding in LLImageJ2CKDU::encodeImpl().
constexpr S32 precision = 8; // assumed bitrate per component channel, might change in future for HDR support constexpr S32 precision = 8; // assumed bitrate per component channel, might change in future for HDR support
constexpr S32 max_components = 4; // assumed the file has four components; three color and alpha
S32 nb_layers = 1; S32 nb_layers = 1;
const S32 surface = w*h; const S32 surface = w*h;
S32 s = 64*64; S32 s = 64*64;
S32 totalbytes = (S32)(s * comp * precision * rate); // first level computed before loop S32 totalbytes = (S32)(s * max_components * precision * rate); // first level computed before loop
while (surface > s) while (surface > s)
{ {
if (nb_layers <= (5 - discard_level)) if (nb_layers <= (5 - discard_level))
totalbytes += (S32)(s * comp * precision * rate); totalbytes += (S32)(s * max_components * precision * rate);
nb_layers++; nb_layers++;
s *= 4; s *= 4;
} }

View File

@ -55,7 +55,6 @@ const U32 PENDING_TIMEOUT_SECS = 5 * 60;
// Globals // Globals
LLCacheName* gCacheName = NULL; LLCacheName* gCacheName = NULL;
std::map<std::string, std::string> LLCacheName::sCacheName;
/// --------------------------------------------------------------------------- /// ---------------------------------------------------------------------------
/// class LLCacheNameEntry /// class LLCacheNameEntry
@ -221,7 +220,7 @@ public:
Impl(LLMessageSystem* msg); Impl(LLMessageSystem* msg);
~Impl(); ~Impl();
bool getName(const LLUUID& id, std::string& first, std::string& last); bool getName(const LLUUID& id, std::string& first, std::string& last, std::map<std::string, std::string>& default_names);
// <FS:Ansariel> Fix stale legacy requests // <FS:Ansariel> Fix stale legacy requests
//boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback); //boost::signals2::connection addPending(const LLUUID& id, const LLCacheNameCallback& callback);
@ -257,9 +256,9 @@ LLCacheName::LLCacheName(LLMessageSystem* msg)
LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host) LLCacheName::LLCacheName(LLMessageSystem* msg, const LLHost& upstream_host)
: impl(* new Impl(msg)) : impl(* new Impl(msg))
{ {
sCacheName["waiting"] = "(Loading...)"; mCacheName["waiting"] = "(Loading...)";
sCacheName["nobody"] = "(nobody)"; mCacheName["nobody"] = "(nobody)";
sCacheName["none"] = "(none)"; mCacheName["none"] = "(none)";
setUpstream(upstream_host); setUpstream(upstream_host);
} }
@ -284,7 +283,7 @@ LLCacheName::Impl::Impl(LLMessageSystem* msg)
LLCacheName::Impl::~Impl() LLCacheName::Impl::~Impl()
{ {
for_each(mCache.begin(), mCache.end(), DeletePairedPointer()); std::for_each(mCache.begin(), mCache.end(), DeletePairedPointer());
mCache.clear(); mCache.clear();
for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer()); for_each(mReplyQueue.begin(), mReplyQueue.end(), DeletePointer());
mReplyQueue.clear(); mReplyQueue.clear();
@ -426,11 +425,11 @@ void LLCacheName::exportFile(std::ostream& ostr)
} }
bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last) bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::string& last, std::map<std::string, std::string>& default_names)
{ {
if(id.isNull()) if(id.isNull())
{ {
first = sCacheName["nobody"]; first = default_names["nobody"];
last.clear(); last.clear();
return true; return true;
} }
@ -444,7 +443,7 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin
} }
else else
{ {
first = sCacheName["waiting"]; first = default_names["waiting"];
last.clear(); last.clear();
if (!isRequestPending(id)) if (!isRequestPending(id))
{ {
@ -458,8 +457,8 @@ bool LLCacheName::Impl::getName(const LLUUID& id, std::string& first, std::strin
// static // static
void LLCacheName::localizeCacheName(std::string key, std::string value) void LLCacheName::localizeCacheName(std::string key, std::string value)
{ {
if (key!="" && value!= "" ) if (!key.empty() && !value.empty())
sCacheName[key]=value; mCacheName[key]=value;
else else
LL_WARNS()<< " Error localizing cache key " << key << " To "<< value<<LL_ENDL; LL_WARNS()<< " Error localizing cache key " << key << " To "<< value<<LL_ENDL;
} }
@ -467,7 +466,7 @@ void LLCacheName::localizeCacheName(std::string key, std::string value)
bool LLCacheName::getFullName(const LLUUID& id, std::string& fullname) bool LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
{ {
std::string first_name, last_name; std::string first_name, last_name;
bool res = impl.getName(id, first_name, last_name); bool res = impl.getName(id, first_name, last_name, mCacheName);
fullname = buildFullName(first_name, last_name); fullname = buildFullName(first_name, last_name);
return res; return res;
} }
@ -475,7 +474,7 @@ bool LLCacheName::getFullName(const LLUUID& id, std::string& fullname)
// <FS:CR> Returns first name, last name // <FS:CR> Returns first name, last name
bool LLCacheName::getFirstLastName(const LLUUID& id, std::string& first, std::string& last) bool LLCacheName::getFirstLastName(const LLUUID& id, std::string& first, std::string& last)
{ {
return impl.getName(id, first, last); return impl.getName(id, first, last, mCacheName);
} }
// </FS:CR> // </FS:CR>
@ -483,7 +482,7 @@ bool LLCacheName::getGroupName(const LLUUID& id, std::string& group)
{ {
if(id.isNull()) if(id.isNull())
{ {
group = sCacheName["none"]; group = mCacheName["none"];
return true; return true;
} }
@ -504,7 +503,7 @@ bool LLCacheName::getGroupName(const LLUUID& id, std::string& group)
} }
else else
{ {
group = sCacheName["waiting"]; group = mCacheName["waiting"];
if (!impl.isRequestPending(id)) if (!impl.isRequestPending(id))
{ {
impl.mAskGroupQueue.insert(id); impl.mAskGroupQueue.insert(id);
@ -678,7 +677,7 @@ boost::signals2::connection LLCacheName::get(const LLUUID& id, bool is_group, co
{ {
LLCacheNameSignal signal; LLCacheNameSignal signal;
signal.connect(callback); signal.connect(callback);
signal(id, sCacheName["nobody"], is_group); signal(id, mCacheName["nobody"], is_group);
return res; return res;
} }
@ -848,14 +847,14 @@ void LLCacheName::dumpStats()
void LLCacheName::clear() void LLCacheName::clear()
{ {
for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer()); std::for_each(impl.mCache.begin(), impl.mCache.end(), DeletePairedPointer());
impl.mCache.clear(); impl.mCache.clear();
} }
//static //static
std::string LLCacheName::getDefaultName() std::string LLCacheName::getDefaultName()
{ {
return sCacheName["waiting"]; return mCacheName["waiting"];
} }
//static //static

View File

@ -132,15 +132,16 @@ public:
void dumpStats(); // Dumps the sizes of the cache and associated queues. void dumpStats(); // Dumps the sizes of the cache and associated queues.
void clear(); // Deletes all entries from the cache void clear(); // Deletes all entries from the cache
static std::string getDefaultName(); std::string getDefaultName();
// Returns "Resident", the default last name for SLID-based accounts // Returns "Resident", the default last name for SLID-based accounts
// that have no last name. // that have no last name.
static std::string getDefaultLastName(); static std::string getDefaultLastName();
static void localizeCacheName(std::string key, std::string value); void localizeCacheName(std::string key, std::string value);
static std::map<std::string, std::string> sCacheName;
private: private:
std::map<std::string, std::string> mCacheName;
class Impl; class Impl;
Impl& impl; Impl& impl;

View File

@ -34,6 +34,9 @@
#include "llpluginmessageclasses.h" #include "llpluginmessageclasses.h"
#include "llsdserialize.h" #include "llsdserialize.h"
#include "stringize.h" #include "stringize.h"
#include "threadpool.h"
#include "workqueue.h"
#include "llapr.h" #include "llapr.h"
#include "llrand.h" // <ND/> FIRE-3877; So we can choose a random port number #include "llrand.h" // <ND/> FIRE-3877; So we can choose a random port number
@ -81,29 +84,8 @@ protected:
}; };
class LLPluginProcessCreationThread : public LLThread
{
public:
LLPluginProcessCreationThread(LLPluginProcessParent *parent) :
LLThread("LLPluginProcessCreationThread", gAPRPoolp),
pParent(parent)
{
}
protected:
// Inherited from LLThread, should run once
/*virtual*/ void run(void)
{
pParent->createPluginProcess();
}
private:
LLPluginProcessParent *pParent;
};
LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner): LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
mIncomingQueueMutex(), mIncomingQueueMutex()
pProcessCreationThread(NULL)
{ {
if(!sInstancesMutex) if(!sInstancesMutex)
{ {
@ -132,18 +114,6 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner):
LLPluginProcessParent::~LLPluginProcessParent() LLPluginProcessParent::~LLPluginProcessParent()
{ {
LL_DEBUGS("Plugin") << "destructor" << LL_ENDL; LL_DEBUGS("Plugin") << "destructor" << LL_ENDL;
if (pProcessCreationThread)
{
if (!pProcessCreationThread->isStopped())
{
// Shouldn't happen at this stage
LL_WARNS("Plugin") << "Shutting down active pProcessCreationThread" << LL_ENDL;
pProcessCreationThread->shutdown();
ms_sleep(20);
}
delete pProcessCreationThread;
pProcessCreationThread = NULL;
}
// Destroy any remaining shared memory regions // Destroy any remaining shared memory regions
sharedMemoryRegionsType::iterator iter; sharedMemoryRegionsType::iterator iter;
@ -359,35 +329,6 @@ bool LLPluginProcessParent::accept()
return result; return result;
} }
bool LLPluginProcessParent::createPluginProcess()
{
if (!mProcess)
{
// Only argument to the launcher is the port number we're listening on
mProcessParams.args.add(stringize(mBoundPort));
mProcess = LLProcess::create(mProcessParams);
return mProcess != NULL;
}
return false;
}
void LLPluginProcessParent::clearProcessCreationThread()
{
if (pProcessCreationThread)
{
if (!pProcessCreationThread->isStopped())
{
pProcessCreationThread->shutdown();
}
else
{
delete pProcessCreationThread;
pProcessCreationThread = NULL;
}
}
}
void LLPluginProcessParent::idle(void) void LLPluginProcessParent::idle(void)
{ {
bool idle_again; bool idle_again;
@ -561,29 +502,71 @@ void LLPluginProcessParent::idle(void)
case STATE_LISTENING: case STATE_LISTENING:
{ {
// Only argument to the launcher is the port number we're listening on
mProcessParams.args.add(stringize(mBoundPort));
// Launch the plugin process. // Launch the plugin process.
if (mDebug && !pProcessCreationThread) if (mDebug && !mProcess)
{ {
createPluginProcess(); if (!(mProcess = LLProcess::create(mProcessParams)))
if (!mProcess)
{ {
errorState(); errorState();
} }
} }
else if (pProcessCreationThread == NULL) else if (!mProcess && !mProcessCreationRequested)
{ {
// exe plugin process allocation can be hindered by a number mProcessCreationRequested = true;
// of factors, don't hold whole viewer because of it, use thread LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop");
pProcessCreationThread = new LLPluginProcessCreationThread(this); // *NOTE: main_queue->postTo casts this refcounted smart pointer to a weak
pProcessCreationThread->start(); // pointer
} LL::WorkQueue::ptr_t general_queue = LL::WorkQueue::getInstance("General");
else if (!mProcess && pProcessCreationThread->isStopped()) llassert_always(main_queue);
{ llassert_always(general_queue);
delete pProcessCreationThread;
pProcessCreationThread = NULL;
errorState();
}
auto process_params = mProcessParams;
bool posted = main_queue->postTo(
general_queue,
[process_params]() // Work done on general queue
{
return LLProcess::create(process_params);
},
[this](LLProcessPtr new_process) // Callback to main thread
mutable {
ptr_t that;
{
// this grabs a copy of the smart pointer to ourselves to ensure that we do not
// get destroyed until after this method returns.
LLCoros::LockType lock(*sInstancesMutex);
mapInstances_t::iterator it = sInstances.find(this);
if (it != sInstances.end())
that = (*it).second;
}
if (that)
{
if (new_process)
{
that->mProcess = new_process;
}
else
{
that->mProcessCreationRequested = false;
that->errorState();
}
}
});
if (!posted)
{
LL_WARNS("Plugin") << "Failed to dispath process creation to threadpool" << LL_ENDL;
if (!(mProcess = LLProcess::create(mProcessParams)))
{
mProcessCreationRequested = false;
errorState();
}
}
}
if (mProcess) if (mProcess)
{ {
@ -614,15 +597,6 @@ void LLPluginProcessParent::idle(void)
// This will allow us to time out if the process never starts. // This will allow us to time out if the process never starts.
mHeartbeat.start(); mHeartbeat.start();
mHeartbeat.setTimerExpirySec(mPluginLaunchTimeout); mHeartbeat.setTimerExpirySec(mPluginLaunchTimeout);
// pProcessCreationThread should have stopped by this point,
// but check just in case it paused on statistics sync
if (pProcessCreationThread && pProcessCreationThread->isStopped())
{
delete pProcessCreationThread;
pProcessCreationThread = NULL;
}
setState(STATE_LAUNCHED); setState(STATE_LAUNCHED);
} }
} }
@ -725,7 +699,6 @@ void LLPluginProcessParent::idle(void)
killSockets(); killSockets();
setState(STATE_DONE); setState(STATE_DONE);
dirtyPollSet(); dirtyPollSet();
clearProcessCreationThread();
break; break;
case STATE_DONE: case STATE_DONE:

View File

@ -69,11 +69,6 @@ public:
const std::string &plugin_filename, const std::string &plugin_filename,
bool debug); bool debug);
// Creates a process
// returns true if process already exists or if created,
// false if failed to create
bool createPluginProcess();
void idle(void); void idle(void);
// returns true if the plugin is on its way to steady state // returns true if the plugin is on its way to steady state
@ -168,15 +163,13 @@ private:
bool accept(); bool accept();
void clearProcessCreationThread();
LLSocket::ptr_t mListenSocket; LLSocket::ptr_t mListenSocket;
LLSocket::ptr_t mSocket; LLSocket::ptr_t mSocket;
U32 mBoundPort; U32 mBoundPort;
LLProcess::Params mProcessParams; LLProcess::Params mProcessParams;
LLProcessPtr mProcess; LLProcessPtr mProcess;
LLThread *pProcessCreationThread; bool mProcessCreationRequested = false;
std::string mPluginFile; std::string mPluginFile;
std::string mPluginDir; std::string mPluginDir;

View File

@ -900,6 +900,20 @@ bool LLComboBox::handleUnicodeCharHere(llwchar uni_char)
return result; return result;
} }
// virtual
bool LLComboBox::handleScrollWheel(S32 x, S32 y, S32 clicks)
{
if (mList->getVisible()) return mList->handleScrollWheel(x, y, clicks);
if (mAllowTextEntry) // We might be editable
if (!mList->getFirstSelected()) // We aren't in the list, don't kill their text
return false;
setCurrentByIndex(llclamp(getCurrentIndex() + clicks, 0, getItemCount() - 1));
prearrangeList();
onCommit();
return true;
}
void LLComboBox::setTextEntry(const LLStringExplicit& text) void LLComboBox::setTextEntry(const LLStringExplicit& text)
{ {
if (mTextEntry) if (mTextEntry)

View File

@ -115,6 +115,7 @@ public:
virtual bool handleToolTip(S32 x, S32 y, MASK mask); virtual bool handleToolTip(S32 x, S32 y, MASK mask);
virtual bool handleKeyHere(KEY key, MASK mask); virtual bool handleKeyHere(KEY key, MASK mask);
virtual bool handleUnicodeCharHere(llwchar uni_char); virtual bool handleUnicodeCharHere(llwchar uni_char);
virtual bool handleScrollWheel(S32 x, S32 y, S32 clicks);
// LLUICtrl interface // LLUICtrl interface
virtual void clear(); // select nothing virtual void clear(); // select nothing

View File

@ -1292,24 +1292,64 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user)
{ {
S32 delta_x = 0; S32 delta_x = 0;
S32 delta_y = 0; S32 delta_y = 0;
// take translation of dependee floater into account
delta_x += new_rect.mLeft - old_rect.mLeft;
delta_y += new_rect.mBottom - old_rect.mBottom;
// check to see if it snapped to right or top, and move if dependee floater is resizing // check to see if it snapped to right or top, and move if dependee floater is resizing
LLRect dependent_rect = floaterp->getRect(); LLRect dependent_rect = floaterp->getRect();
if (dependent_rect.mLeft - getRect().mLeft >= old_rect.getWidth() || // dependent on my right? if ((dependent_rect.mLeft - getRect().mLeft >= old_rect.getWidth() || // dependent on my right?
dependent_rect.mRight == getRect().mLeft + old_rect.getWidth()) // dependent aligned with my right dependent_rect.mRight == getRect().mLeft + old_rect.getWidth()) // dependent aligned with my right
&& dependent_rect.mBottom <= old_rect.mTop + 1)
{ {
// was snapped directly onto right side or aligned with it // was snapped directly onto right side or aligned with it
delta_x += new_rect.getWidth() - old_rect.getWidth(); delta_x += new_rect.getWidth() - old_rect.getWidth();
// make sure dependent still touches floater and din't go too high,
// it can go over edge, but should't detach completely
if (delta_y > 0
&& dependent_rect.mBottom + delta_y > new_rect.mTop)
{
delta_y = llmax(new_rect.mTop - dependent_rect.mBottom, 0);
}
} }
if (dependent_rect.mBottom - getRect().mBottom >= old_rect.getHeight() || else if (dependent_rect.mRight == old_rect.mLeft)
dependent_rect.mTop == getRect().mBottom + old_rect.getHeight()) {
// make sure dependent still touches floater and don't go too high
if (delta_y > 0
&& dependent_rect.mBottom <= old_rect.mTop
&& dependent_rect.mBottom + delta_y > new_rect.mTop)
{
delta_y = llmax(new_rect.mTop - dependent_rect.mBottom, 0);
}
}
if ((dependent_rect.mBottom - getRect().mBottom >= old_rect.getHeight() ||
dependent_rect.mTop == getRect().mBottom + old_rect.getHeight())
&& dependent_rect.mLeft <= old_rect.mRight + 1)
{ {
// was snapped directly onto top side or aligned with it // was snapped directly onto top side or aligned with it
delta_y += new_rect.getHeight() - old_rect.getHeight(); delta_y += new_rect.getHeight() - old_rect.getHeight();
}
// take translation of dependee floater into account as well // make sure dependent still touches floater
delta_x += new_rect.mLeft - old_rect.mLeft; // and din't go too far to the right
delta_y += new_rect.mBottom - old_rect.mBottom; if (delta_x > 0
&& dependent_rect.mLeft + delta_x > new_rect.mRight)
{
delta_x = llmax(new_rect.mRight - dependent_rect.mLeft, 0);
}
}
else if (dependent_rect.mTop == old_rect.mBottom)
{
// make sure dependent still touches floater and don't go too far to the right
if (delta_x > 0
&& dependent_rect.mLeft <= old_rect.mRight
&& dependent_rect.mLeft + delta_x > new_rect.mRight)
{
delta_x = llmax(new_rect.mRight - dependent_rect.mLeft, 0);
}
}
dependent_rect.translate(delta_x, delta_y); dependent_rect.translate(delta_x, delta_y);
floaterp->setShape(dependent_rect, by_user); floaterp->setShape(dependent_rect, by_user);

View File

@ -217,7 +217,7 @@ LLLayoutStack::Params::Params()
open_time_constant("open_time_constant", 0.02f), open_time_constant("open_time_constant", 0.02f),
close_time_constant("close_time_constant", 0.03f), close_time_constant("close_time_constant", 0.03f),
resize_bar_overlap("resize_bar_overlap", 1), resize_bar_overlap("resize_bar_overlap", 1),
border_size("border_size", LLCachedControl<S32>(*LLUI::getInstance()->mSettingGroups["config"], "UIResizeBarHeight", 0)), border_size("border_size", LLUI::getInstance()->mSettingGroups["config"]->getS32("UIResizeBarHeight")),
show_drag_handle("show_drag_handle", false), show_drag_handle("show_drag_handle", false),
drag_handle_first_indent("drag_handle_first_indent", 0), drag_handle_first_indent("drag_handle_first_indent", 0),
drag_handle_second_indent("drag_handle_second_indent", 0), drag_handle_second_indent("drag_handle_second_indent", 0),

View File

@ -1632,7 +1632,11 @@ const std::string LLScrollListCtrl::getSelectedItemLabel(S32 column) const
item = getFirstSelected(); item = getFirstSelected();
if (item) if (item)
{ {
return item->getColumn(column)->getValue().asString(); auto col = item->getColumn(column);
if(col)
{
return col->getValue().asString();
}
} }
return LLStringUtil::null; return LLStringUtil::null;

View File

@ -230,7 +230,7 @@ class LLWebRTCSignalingObserver
// allows for management of this peer connection. // allows for management of this peer connection.
class LLWebRTCPeerConnectionInterface class LLWebRTCPeerConnectionInterface
{ {
public: public:
struct InitOptions struct InitOptions
{ {

View File

@ -2084,7 +2084,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(bool *hit_limit)
} }
else else
{ {
LLCachedControl<F32> dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength"); static LLCachedControl<F32> dynamic_camera_strength(gSavedSettings, "DynamicCameraStrength");
target_lag = vel * dynamic_camera_strength / 30.f; target_lag = vel * dynamic_camera_strength / 30.f;
} }

View File

@ -408,7 +408,8 @@ bool LLControlAvatar::updateCharacter(LLAgent &agent)
//virtual //virtual
void LLControlAvatar::updateDebugText() void LLControlAvatar::updateDebugText()
{ {
if (gSavedSettings.getBOOL("DebugAnimatedObjects")) static LLCachedControl<bool> debug_animated_objects(gSavedSettings, "DebugAnimatedObjects");
if (debug_animated_objects)
{ {
S32 total_linkset_count = 0; S32 total_linkset_count = 0;
if (mRootVolp) if (mRootVolp)

View File

@ -957,7 +957,7 @@ void LLDrawable::updateTexture()
bool LLDrawable::updateGeometry() bool LLDrawable::updateGeometry()
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWABLE;
llassert(mVObjp.notNull()); llassert(mVObjp.notNull());
bool res = mVObjp && mVObjp->updateGeometry(this); bool res = mVObjp && mVObjp->updateGeometry(this);

View File

@ -209,7 +209,7 @@ void LLDrawPoolAlpha::renderPostDeferred(S32 pass)
forwardRender(); forwardRender();
// final pass, render to depth for depth of field effects // final pass, render to depth for depth of field effects
if (!LLPipeline::sImpostorRender && gSavedSettings.getBOOL("RenderDepthOfField") && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER) if (!LLPipeline::sImpostorRender && LLPipeline::RenderDepthOfField && !gCubeSnapshot && !LLPipeline::sRenderingHUDs && getType() == LLDrawPool::POOL_ALPHA_POST_WATER)
{ {
//update depth buffer sampler //update depth buffer sampler
simple_shader = fullbright_shader = &gDeferredFullbrightAlphaMaskProgram; simple_shader = fullbright_shader = &gDeferredFullbrightAlphaMaskProgram;

View File

@ -117,11 +117,8 @@ U32 LLDrawPoolTerrain::getVertexDataMask()
void LLDrawPoolTerrain::prerender() void LLDrawPoolTerrain::prerender()
{ {
// <FS:Ansariel> Use faster LLCachedControls for frequently visited locations static LLCachedControl<S32> render_terrain_pbr_detail(gSavedSettings, "RenderTerrainPBRDetail");
//sPBRDetailMode = gSavedSettings.getS32("RenderTerrainPBRDetail"); sPBRDetailMode = render_terrain_pbr_detail;
static LLCachedControl<S32> renderTerrainPBRDetail(gSavedSettings, "RenderTerrainPBRDetail");
sPBRDetailMode = renderTerrainPBRDetail();
// </FS:Ansariel>
} }
void LLDrawPoolTerrain::boostTerrainDetailTextures() void LLDrawPoolTerrain::boostTerrainDetailTextures()

View File

@ -437,7 +437,7 @@ void LLFloaterAvatarPicker::populateNearMe()
if (!LLAvatarNameCache::get(av, &av_name)) if (!LLAvatarNameCache::get(av, &av_name))
{ {
element["columns"][0]["column"] = "name"; element["columns"][0]["column"] = "name";
element["columns"][0]["value"] = LLCacheName::getDefaultName(); element["columns"][0]["value"] = gCacheName->getDefaultName();
all_loaded = false; all_loaded = false;
} }
else else

View File

@ -992,11 +992,14 @@ void LLFloaterIMContainer::onAddButtonClicked()
{ {
LLView * button = findChild<LLView>("conversations_pane_buttons_expanded")->findChild<LLButton>("add_btn"); LLView * button = findChild<LLView>("conversations_pane_buttons_expanded")->findChild<LLButton>("add_btn");
LLFloater* root_floater = gFloaterView->getParentFloater(this); LLFloater* root_floater = gFloaterView->getParentFloater(this);
LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button); if (button && root_floater)
if (picker && root_floater)
{ {
root_floater->addDependentFloater(picker); LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLFloaterIMContainer::onAvatarPicked, this, _1), true, true, true, root_floater->getName(), button);
if (picker)
{
root_floater->addDependentFloater(picker);
}
} }
} }

View File

@ -3343,13 +3343,16 @@ void LLIncomingCallDialog::processCallResponse(S32 response, const LLSD &payload
gIMMgr->addSession(correct_session_name, type, session_id, payload["voice_channel_info"]); gIMMgr->addSession(correct_session_name, type, session_id, payload["voice_channel_info"]);
std::string url = gAgent.getRegion()->getCapability( std::string url = gAgent.getRegionCapability(
"ChatSessionRequest"); "ChatSessionRequest");
if (voice) if (voice)
{ {
LLCoros::instance().launch("chatterBoxInvitationCoro", if(!url.empty())
boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"])); {
LLCoros::instance().launch("chatterBoxInvitationCoro",
boost::bind(&chatterBoxInvitationCoro, url, session_id, inv_type, payload["voice_channel_info"]));
}
// send notification message to the corresponding chat // send notification message to the corresponding chat
if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc") if (payload["notify_box_type"].asString() == "VoiceInviteGroup" || payload["notify_box_type"].asString() == "VoiceInviteAdHoc")
@ -4783,9 +4786,12 @@ public:
// Send request for chat history, if enabled. // Send request for chat history, if enabled.
if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory")) if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory"))
{ {
std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); std::string url = gAgent.getRegionCapability("ChatSessionRequest");
LLCoros::instance().launch("chatterBoxHistoryCoro", if (!url.empty())
boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0)); {
LLCoros::instance().launch("chatterBoxHistoryCoro",
boost::bind(&chatterBoxHistoryCoro, url, session_id, "", "", 0));
}
} }
} }
} }

View File

@ -1022,7 +1022,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
} }
} }
if (obj->getType() != LLAssetType::AT_CATEGORY) if (obj && obj->getType() != LLAssetType::AT_CATEGORY)
{ {
items.push_back(std::string("Paste Separator")); items.push_back(std::string("Paste Separator"));
} }
@ -6919,7 +6919,7 @@ void LLCallingCardBridge::performAction(LLInventoryModel* model, std::string act
if (item && (item->getCreatorUUID() != gAgent.getID()) && if (item && (item->getCreatorUUID() != gAgent.getID()) &&
(!item->getCreatorUUID().isNull())) (!item->getCreatorUUID().isNull()))
{ {
std::string callingcard_name = LLCacheName::getDefaultName(); std::string callingcard_name = gCacheName->getDefaultName();
LLAvatarName av_name; LLAvatarName av_name;
if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name)) if (LLAvatarNameCache::get(item->getCreatorUUID(), &av_name))
{ {

View File

@ -711,7 +711,7 @@ void LLInventoryPanel::itemChanged(const LLUUID& item_id, U32 mask, const LLInve
} }
// Select any newly created object that has the auto rename at top of folder root set. // Select any newly created object that has the auto rename at top of folder root set.
if(mFolderRoot.get()->getRoot()->needsAutoRename()) if(mFolderRoot.get() && mFolderRoot.get()->getRoot()->needsAutoRename())
{ {
setSelection(item_id, false); setSelection(item_id, false);
} }

View File

@ -1776,9 +1776,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
file.read(buffer, bytes); file.read(buffer, bytes);
if (headerReceived(mesh_params, buffer, bytes) == MESH_OK) if (headerReceived(mesh_params, buffer, bytes) == MESH_OK)
{ {
std::string mid; LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the cache." << LL_ENDL;
mesh_params.getSculptID().toString(mid);
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
// Found mesh in cache // Found mesh in cache
return true; return true;
@ -1798,9 +1796,7 @@ bool LLMeshRepoThread::fetchMeshHeader(const LLVolumeParams& mesh_params, bool c
if (!http_url.empty()) if (!http_url.empty())
{ {
std::string mid; LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mesh_params.getSculptID() << " - was retrieved from the simulator." << LL_ENDL;
mesh_params.getSculptID().toString(mid);
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh header for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
//grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits //grab first 4KB if we're going to bother with a fetch. Cache will prevent future fetches if a full mesh fits
//within the first 4KB //within the first 4KB
@ -1891,9 +1887,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
{ {
delete[] buffer; delete[] buffer;
std::string mid; LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the cache." << LL_ENDL;
mesh_id.toString(mid);
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the cache." << LL_ENDL;
return true; return true;
} }
@ -1912,9 +1906,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod,
if (!http_url.empty()) if (!http_url.empty())
{ {
std::string mid; LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mesh_id << " - was retrieved from the simulator." << LL_ENDL;
mesh_id.toString(mid);
LL_DEBUGS(LOG_MESH) << "Mesh/Cache: Mesh body for ID " << mid << " - was retrieved from the simulator." << LL_ENDL;
LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size)); LLMeshHandlerBase::ptr_t handler(new LLMeshLODHandler(mesh_params, lod, offset, size));
// <FS:Ansariel> [UDP Assets] // <FS:Ansariel> [UDP Assets]
@ -4808,12 +4800,8 @@ F32 LLMeshRepository::getStreamingCostLegacy(LLMeshHeader& header, F32 radius, S
*unscaled_value = weighted_avg; *unscaled_value = weighted_avg;
} }
// <FS:ND> replace often called setting with LLCachedControl static LLCachedControl<U32> mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
// return weighted_avg/gSavedSettings.getU32("MeshTriangleBudget")*15000.f; return weighted_avg / mesh_triangle_budget * 15000.f;
static LLCachedControl< U32 > MeshTriangleBudget( gSavedSettings, "MeshTriangleBudget");
return weighted_avg/MeshTriangleBudget*15000.f;
// </FS:ND>
} }
LLMeshCostData::LLMeshCostData() LLMeshCostData::LLMeshCostData()
@ -4965,7 +4953,8 @@ F32 LLMeshCostData::getEstTrisForStreamingCost()
F32 LLMeshCostData::getRadiusBasedStreamingCost(F32 radius) F32 LLMeshCostData::getRadiusBasedStreamingCost(F32 radius)
{ {
return getRadiusWeightedTris(radius)/gSavedSettings.getU32("MeshTriangleBudget")*15000.f; static LLCachedControl<U32> mesh_triangle_budget(gSavedSettings, "MeshTriangleBudget");
return getRadiusWeightedTris(radius)/mesh_triangle_budget*15000.f;
} }
F32 LLMeshCostData::getTriangleBasedStreamingCost() F32 LLMeshCostData::getTriangleBasedStreamingCost()
@ -5576,12 +5565,9 @@ bool LLMeshRepository::meshUploadEnabled()
bool LLMeshRepository::meshRezEnabled() bool LLMeshRepository::meshRezEnabled()
{ {
static LLCachedControl<bool> mesh_enabled(gSavedSettings, "MeshEnabled");
LLViewerRegion *region = gAgent.getRegion(); LLViewerRegion *region = gAgent.getRegion();
// <FS:Ansariel> Use faster LLCachedControls for frequently visited locations if(mesh_enabled &&
//if(gSavedSettings.getBOOL("MeshEnabled") &&
static LLCachedControl<bool> meshEnabled(gSavedSettings, "MeshEnabled");
if(meshEnabled &&
// </FS:Ansariel>
region) region)
{ {
return region->meshRezEnabled(); return region->meshRezEnabled();

View File

@ -702,10 +702,18 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const
if ("collapse_all" == command_name) if ("collapse_all" == command_name)
{ {
if (!mCurrentSelectedList)
{
return false;
}
return has_expanded_folders(mCurrentSelectedList->getRootFolder()); return has_expanded_folders(mCurrentSelectedList->getRootFolder());
} }
else if ("expand_all" == command_name) else if ("expand_all" == command_name)
{ {
if (!mCurrentSelectedList)
{
return false;
}
return has_collapsed_folders(mCurrentSelectedList->getRootFolder()); return has_collapsed_folders(mCurrentSelectedList->getRootFolder());
} }
else if ("sort_by_date" == command_name) else if ("sort_by_date" == command_name)
@ -1036,12 +1044,12 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
// then ask LLFolderView permissions // then ask LLFolderView permissions
LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); LLFolderView* root_folder = mCurrentSelectedList ? mCurrentSelectedList->getRootFolder() : nullptr;
if ("copy" == command_name) if ("copy" == command_name)
{ {
// we shouldn't be able to copy folders from My Inventory Panel // we shouldn't be able to copy folders from My Inventory Panel
return can_be_modified && root_folder->canCopy(); return can_be_modified && root_folder && root_folder->canCopy();
} }
else if ("collapse" == command_name) else if ("collapse" == command_name)
{ {
@ -1058,7 +1066,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
if ("cut" == command_name) if ("cut" == command_name)
{ {
can_be_modified = root_folder->canCut(); can_be_modified = root_folder && root_folder->canCut();
} }
else if ("rename" == command_name) else if ("rename" == command_name)
{ {
@ -1070,7 +1078,7 @@ bool LLLandmarksPanel::canItemBeModified(const std::string& command_name, LLFold
} }
else if("paste" == command_name) else if("paste" == command_name)
{ {
can_be_modified = root_folder->canPaste(); can_be_modified = root_folder && root_folder->canPaste();
} }
else else
{ {

View File

@ -504,7 +504,7 @@ public:
void LLSpatialGroup::setState(U32 state, S32 mode) void LLSpatialGroup::setState(U32 state, S32 mode)
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
llassert(state <= LLSpatialGroup::STATE_MASK); llassert(state <= LLSpatialGroup::STATE_MASK);
@ -553,7 +553,7 @@ public:
void LLSpatialGroup::clearState(U32 state, S32 mode) void LLSpatialGroup::clearState(U32 state, S32 mode)
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL LL_PROFILE_ZONE_SCOPED_CATEGORY_SPATIAL;
llassert(state <= LLSpatialGroup::STATE_MASK); llassert(state <= LLSpatialGroup::STATE_MASK);

View File

@ -346,12 +346,15 @@ static bool handleAnisotropicChanged(const LLSD& newvalue)
static bool handleVSyncChanged(const LLSD& newvalue) static bool handleVSyncChanged(const LLSD& newvalue)
{ {
LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean(); LLPerfStats::tunables.vsyncEnabled = newvalue.asBoolean();
gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean()); if (gViewerWindow && gViewerWindow->getWindow())
if (newvalue.asBoolean())
{ {
U32 current_target = gSavedSettings.getU32("TargetFPS"); gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
if (newvalue.asBoolean())
{
U32 current_target = gSavedSettings.getU32("TargetFPS");
gSavedSettings.setU32("TargetFPS", std::min((U32)gViewerWindow->getWindow()->getRefreshRate(), current_target));
}
} }
return true; return true;

View File

@ -761,7 +761,7 @@ void display(bool rebuild, F32 zoom_factor, int subfield, bool for_snapshot)
gPipeline.resetFrameStats(); // Reset per-frame statistics. gPipeline.resetFrameStats(); // Reset per-frame statistics.
if (!gDisconnected) if (!gDisconnected && !LLApp::isExiting())
{ {
// Render mirrors and associated hero probes before we render the rest of the scene. // Render mirrors and associated hero probes before we render the rest of the scene.
// This ensures the scene state in the hero probes are exactly the same as the rest of the scene before we render it. // This ensures the scene state in the hero probes are exactly the same as the rest of the scene before we render it.
@ -1747,11 +1747,7 @@ void render_ui_2d()
} }
// <FS:Ansariel> gSavedSettings replacement if (LLPipeline::RenderUIBuffer)
//if (gSavedSettings.getBOOL("RenderUIBuffer"))
static LLCachedControl<bool> renderUIBuffer(gSavedSettings, "RenderUIBuffer");
if (renderUIBuffer)
// </FS:Ansariel>
{ {
if (LLView::sIsRectDirty) if (LLView::sIsRectDirty)
{ {

View File

@ -4521,7 +4521,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
U32 local_id; U32 local_id;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i); mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port); gObjectList.getUUIDFromLocal(id, local_id, ip, port);
if (id == LLUUID::null) if (id == LLUUID::null)
{ {
LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL; LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL;

View File

@ -2009,14 +2009,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if(mesgsys != NULL) if(mesgsys != NULL)
{ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid, gObjectList.getUUIDFromLocal(parent_uuid,
parent_id, parent_id,
mesgsys->getSenderIP(), mesgsys->getSenderIP(),
mesgsys->getSenderPort()); mesgsys->getSenderPort());
} }
else else
{ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid, gObjectList.getUUIDFromLocal(parent_uuid,
parent_id, parent_id,
mRegionp->getHost().getAddress(), mRegionp->getHost().getAddress(),
mRegionp->getHost().getPort()); mRegionp->getHost().getPort());
@ -2150,7 +2150,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
// Debugging for suspected problems with local ids. // Debugging for suspected problems with local ids.
//LLUUID parent_uuid; //LLUUID parent_uuid;
//LLViewerObjectList::getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() ); //gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
//if (parent_uuid != cur_parentp->getID() ) //if (parent_uuid != cur_parentp->getID() )
//{ //{
// LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL; // LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL;
@ -2173,14 +2173,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if(mesgsys != NULL) if(mesgsys != NULL)
{ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid, gObjectList.getUUIDFromLocal(parent_uuid,
parent_id, parent_id,
gMessageSystem->getSenderIP(), gMessageSystem->getSenderIP(),
gMessageSystem->getSenderPort()); gMessageSystem->getSenderPort());
} }
else else
{ {
LLViewerObjectList::getUUIDFromLocal(parent_uuid, gObjectList.getUUIDFromLocal(parent_uuid,
parent_id, parent_id,
mRegionp->getHost().getAddress(), mRegionp->getHost().getAddress(),
mRegionp->getHost().getPort()); mRegionp->getHost().getPort());

View File

@ -107,8 +107,6 @@ extern LLPipeline gPipeline;
// Statics for object lookup tables. // Statics for object lookup tables.
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check. U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
LLViewerObjectList::LLViewerObjectList() LLViewerObjectList::LLViewerObjectList()
: mNewObjectSignal() // <FS:Ansariel> FIRE-16647: Default object properties randomly aren't applied : mNewObjectSignal() // <FS:Ansariel> FIRE-16647: Default object properties randomly aren't applied
@ -147,17 +145,17 @@ void LLViewerObjectList::getUUIDFromLocal(LLUUID &id,
{ {
U64 ipport = (((U64)ip) << 32) | (U64)port; U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport]; U32 index = mIPAndPortToIndex[ipport];
if (!index) if (!index)
{ {
index = sSimulatorMachineIndex++; index = sSimulatorMachineIndex++;
sIPAndPortToIndex[ipport] = index; mIPAndPortToIndex[ipport] = index;
} }
U64 indexid = (((U64)index) << 32) | (U64)local_id; U64 indexid = (((U64)index) << 32) | (U64)local_id;
id = get_if_there(sIndexAndLocalIDToUUID, indexid, LLUUID::null); id = get_if_there(mIndexAndLocalIDToUUID, indexid, LLUUID::null);
} }
U64 LLViewerObjectList::getIndex(const U32 local_id, U64 LLViewerObjectList::getIndex(const U32 local_id,
@ -166,7 +164,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
{ {
U64 ipport = (((U64)ip) << 32) | (U64)port; U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport]; U32 index = mIPAndPortToIndex[ipport];
if (!index) if (!index)
{ {
@ -186,14 +184,14 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
U32 ip = objectp->getRegion()->getHost().getAddress(); U32 ip = objectp->getRegion()->getHost().getAddress();
U32 port = objectp->getRegion()->getHost().getPort(); U32 port = objectp->getRegion()->getHost().getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port; U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport]; U32 index = mIPAndPortToIndex[ipport];
// LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL; // LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
U64 indexid = (((U64)index) << 32) | (U64)local_id; U64 indexid = (((U64)index) << 32) | (U64)local_id;
std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid); std::map<U64, LLUUID>::iterator iter = mIndexAndLocalIDToUUID.find(indexid);
if (iter == sIndexAndLocalIDToUUID.end()) if (iter == mIndexAndLocalIDToUUID.end())
{ {
return false; return false;
} }
@ -201,7 +199,7 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
// Found existing entry // Found existing entry
if (iter->second == objectp->getID()) if (iter->second == objectp->getID())
{ // Full UUIDs match, so remove the entry { // Full UUIDs match, so remove the entry
sIndexAndLocalIDToUUID.erase(iter); mIndexAndLocalIDToUUID.erase(iter);
return true; return true;
} }
// UUIDs did not match - this would zap a valid entry, so don't erase it // UUIDs did not match - this would zap a valid entry, so don't erase it
@ -219,17 +217,17 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
{ {
U64 ipport = (((U64)ip) << 32) | (U64)port; U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport]; U32 index = mIPAndPortToIndex[ipport];
if (!index) if (!index)
{ {
index = sSimulatorMachineIndex++; index = sSimulatorMachineIndex++;
sIPAndPortToIndex[ipport] = index; mIPAndPortToIndex[ipport] = index;
} }
U64 indexid = (((U64)index) << 32) | (U64)local_id; U64 indexid = (((U64)index) << 32) | (U64)local_id;
sIndexAndLocalIDToUUID[indexid] = id; mIndexAndLocalIDToUUID[indexid] = id;
//LL_INFOS() << "Adding object to table, full ID " << id //LL_INFOS() << "Adding object to table, full ID " << id
// << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL; // << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;

View File

@ -187,18 +187,18 @@ public:
// used to discount stats from this frame // used to discount stats from this frame
bool mWasPaused; bool mWasPaused;
static void getUUIDFromLocal(LLUUID &id, void getUUIDFromLocal(LLUUID &id,
const U32 local_id, const U32 local_id,
const U32 ip, const U32 ip,
const U32 port); const U32 port);
static void setUUIDAndLocal(const LLUUID &id, void setUUIDAndLocal(const LLUUID &id,
const U32 local_id, const U32 local_id,
const U32 ip, const U32 ip,
const U32 port); // Requires knowledge of message system info! const U32 port); // Requires knowledge of message system info!
static bool removeFromLocalIDTable(const LLViewerObject* objectp); bool removeFromLocalIDTable(const LLViewerObject* objectp);
// Used ONLY by the orphaned object code. // Used ONLY by the orphaned object code.
static U64 getIndex(const U32 local_id, const U32 ip, const U32 port); U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
S32 mNumUnknownUpdates; S32 mNumUnknownUpdates;
S32 mNumDeadObjectUpdates; S32 mNumDeadObjectUpdates;
@ -238,9 +238,9 @@ protected:
S32 mCurLazyUpdateIndex; S32 mCurLazyUpdateIndex;
static U32 sSimulatorMachineIndex; static U32 sSimulatorMachineIndex;
static std::map<U64, U32> sIPAndPortToIndex; std::map<U64, U32> mIPAndPortToIndex;
static std::map<U64, LLUUID> sIndexAndLocalIDToUUID; std::map<U64, LLUUID> mIndexAndLocalIDToUUID;
friend class LLViewerObject; friend class LLViewerObject;
@ -293,7 +293,7 @@ extern LLViewerObjectList gObjectList;
*/ */
inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id) inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id)
{ {
std::map<LLUUID, LLPointer<LLViewerObject> >::iterator iter = mUUIDObjectMap.find(id); auto iter = mUUIDObjectMap.find(id);
if(iter != mUUIDObjectMap.end()) if(iter != mUUIDObjectMap.end())
{ {
return iter->second; return iter->second;

View File

@ -520,7 +520,7 @@ void LLViewerTexture::updateClass()
// try to leave half a GB for everyone else, but keep at least 768MB for ourselves // try to leave half a GB for everyone else, but keep at least 768MB for ourselves
F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET); F32 target = llmax(budget - 512.f, MIN_VRAM_BUDGET);
sFreeVRAMMegabytes = target - used; sFreeVRAMMegabytes = llmax(target - used, 0.f);
F32 over_pct = (used - target) / target; F32 over_pct = (used - target) / target;
@ -1330,6 +1330,14 @@ void LLViewerFetchedTexture::destroyTexture()
{ {
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
// <FS:Ansariel> Only actually destroy if VRAM is getting tight
static LLCachedControl<F32> fsMinVRAMTextureDestroyThreshold(gSavedSettings, "FSMinVRAMTextureDestroyThreshold");
if (sFreeVRAMMegabytes >= fsMinVRAMTextureDestroyThreshold)
{
return;
}
// </FS:Ansariel>
if (mNeedsCreateTexture)//return if in the process of generating a new texture. if (mNeedsCreateTexture)//return if in the process of generating a new texture.
{ {
return; return;

View File

@ -939,7 +939,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
} }
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
bool onFace = false;
for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i) for (U32 i = 0; i < LLRender::NUM_TEXTURE_CHANNELS; ++i)
{ {
for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi) for (S32 fi = 0; fi < imagep->getNumFaces(i); ++fi)
@ -948,7 +947,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
if (face && face->getViewerObject()) if (face && face->getViewerObject())
{ {
onFace = true;
F32 radius; F32 radius;
F32 cos_angle_to_view_dir; F32 cos_angle_to_view_dir;
bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
@ -1046,8 +1044,7 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
imagep->getLastReferencedTimer()->reset(); imagep->getLastReferencedTimer()->reset();
//reset texture state. //reset texture state.
if(!onFace) imagep->setInactive();
imagep->setInactive();
} }
} }

View File

@ -2980,9 +2980,7 @@ void LLViewerWindow::draw()
//S32 screen_x, screen_y; //S32 screen_x, screen_y;
//if (!gSavedSettings.getBOOL("RenderUIBuffer")) if (!LLPipeline::RenderUIBuffer)
static LLCachedControl<bool> renderUIBuffer(gSavedSettings, "RenderUIBuffer");
if (!renderUIBuffer)
{ {
LLView::sDirtyRect = getWindowRectScaled(); LLView::sDirtyRect = getWindowRectScaled();
} }

View File

@ -4694,20 +4694,14 @@ void LLVOAvatar::updateDebugText()
{ {
// Leave mDebugText uncleared here, in case a derived class has added some state first // Leave mDebugText uncleared here, in case a derived class has added some state first
// <FS:Ansariel> Use cached controls static LLCachedControl<bool> debug_av_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage");
//if (gSavedSettings.getBOOL("DebugAvatarAppearanceMessage")) if (debug_av_appearance_message)
static LLCachedControl<bool> debug_avatar_appearance_message(gSavedSettings, "DebugAvatarAppearanceMessage");
if (debug_avatar_appearance_message)
// </FS:Ansariel>
{ {
updateAppearanceMessageDebugText(); updateAppearanceMessageDebugText();
} }
// <FS:Ansariel> Use cached controls static LLCachedControl<bool> debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
//if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) if (debug_av_composite_baked)
static LLCachedControl<bool> debug_avatar_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
if (debug_avatar_composite_baked)
// </FS:Ansariel>
{ {
if (!mBakedTextureDebugText.empty()) if (!mBakedTextureDebugText.empty())
addDebugText(mBakedTextureDebugText); addDebugText(mBakedTextureDebugText);
@ -9548,7 +9542,8 @@ LLMotion* LLVOAvatar::findMotion(const LLUUID& id) const
// colorized if using deferred rendering. // colorized if using deferred rendering.
void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color) void LLVOAvatar::debugColorizeSubMeshes(U32 i, const LLColor4& color)
{ {
if (gSavedSettings.getBOOL("DebugAvatarCompositeBaked")) static LLCachedControl<bool> debug_av_composite_baked(gSavedSettings, "DebugAvatarCompositeBaked");
if (debug_av_composite_baked)
{ {
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();

View File

@ -332,7 +332,7 @@ bool LLXMLRPCTransaction::Impl::process()
if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(), if (!LLXMLNode::parseBuffer(mResponseText.data(), mResponseText.size(),
root, nullptr)) root, nullptr))
{ {
LL_WARNS() << "Failed parsing XML in response; request URI: " LL_WARNS() << "Failed parsing XML in response; request URI: "
<< mURI << LL_ENDL; << mURI << LL_ENDL;
} }
else if (parseResponse(root)) else if (parseResponse(root))

View File

@ -4722,7 +4722,8 @@ void LLPipeline::renderDebug()
mReflectionMapManager.renderDebug(); mReflectionMapManager.renderDebug();
} }
if (gSavedSettings.getBOOL("RenderReflectionProbeVolumes") && !hud_only) static LLCachedControl<bool> render_ref_probe_volumes(gSavedSettings, "RenderReflectionProbeVolumes");
if (render_ref_probe_volumes && !hud_only)
{ {
LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("probe debug display"); LL_PROFILE_ZONE_NAMED_CATEGORY_PIPELINE("probe debug display");
@ -9196,7 +9197,7 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera
gGL.diffuseColor4f(1, 1, 1, 1); gGL.diffuseColor4f(1, 1, 1, 1);
S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail"); S32 shadow_detail = RenderShadowDetail;
// if not using VSM, disable color writes // if not using VSM, disable color writes
if (shadow_detail <= 2) if (shadow_detail <= 2)

View File

@ -692,8 +692,13 @@ class Windows_x86_64_Manifest(ViewerManifest):
# These need to be installed as a SxS assembly, currently a 'private' assembly. # These need to be installed as a SxS assembly, currently a 'private' assembly.
# See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx # See http://msdn.microsoft.com/en-us/library/ms235291(VS.80).aspx
self.path("msvcp140.dll") self.path("msvcp140.dll")
self.path_optional("msvcp140_1.dll")
self.path_optional("msvcp140_2.dll")
self.path_optional("msvcp140_atomic_wait.dll")
self.path_optional("msvcp140_codecvt_ids.dll")
self.path("vcruntime140.dll") self.path("vcruntime140.dll")
self.path_optional("vcruntime140_1.dll") self.path_optional("vcruntime140_1.dll")
self.path_optional("vcruntime140_threads.dll")
# SLVoice executable # SLVoice executable
with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')): with self.prefix(src=os.path.join(pkgdir, 'bin', 'release')):