Ansariel 2020-11-12 10:11:43 +01:00
commit 602a82dc33
510 changed files with 7387 additions and 5766 deletions

View File

@ -5,16 +5,16 @@
<map>
<key>jemalloc</key>
<map>
<key>copyright</key>
<string>Copyright (C) 2002-present Jason Evans jasone@canonware.com.</string>
<key>description</key>
<string>jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.</string>
<key>license</key>
<string>jemalloc (BSD derived)</string>
<key>license_file</key>
<string>LICENSES/jemalloc.txt</string>
<key>name</key>
<string>jemalloc</string>
<key>copyright</key>
<string>Copyright (C) 2002-present Jason Evans jasone@canonware.com.</string>
<key>description</key>
<string>jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support.</string>
<key>license</key>
<string>jemalloc (BSD derived)</string>
<key>license_file</key>
<string>LICENSES/jemalloc.txt</string>
<key>name</key>
<string>jemalloc</string>
<key>platforms</key>
<map>
<key>linux64</key>
@ -260,7 +260,7 @@
</map>
<key>version</key>
<string>1.2.15</string>
</map>
</map>
<key>apr_suite</key>
<map>
<key>copyright</key>
@ -448,9 +448,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>471b0b350955152fd87518575057dfc4</string>
<string>322dd6c45c384d454ae14ef127984a4e</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60326/566593/bugsplat-1.0.7.542667-darwin64-542667.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65457/612879/bugsplat-1.0.7.546418-darwin64-546418.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -460,9 +460,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>70e8bf46145c4cbae6f93e8b70ba5499</string>
<string>010a0e73c0fddaa2316411803fad8e69</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60320/566541/bugsplat-3.6.0.4.542667-windows-542667.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65456/612876/bugsplat-3.6.0.8.546418-windows-546418.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -472,16 +472,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>a73696e859fad3f19f835740815a2bd3</string>
<string>7e8530762e7b50663708a888c23b8780</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/60321/566542/bugsplat-3.6.0.4.542667-windows64-542667.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65455/612874/bugsplat-3.6.0.8.546418-windows64-546418.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.0.7.542667</string>
<string>3.6.0.8.546418</string>
</map>
<key>colladadom</key>
<map>
@ -784,9 +784,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e145f8ea99a21712434e0e868d1885dc</string>
<string>cc26af2ebfa241891caca829a6e46b88</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/62333/588183/dullahan-1.7.0.202006240858_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-544091.tar.bz2</string>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/65005/607316/dullahan-1.7.0.202008031101_81.3.10_gb223419_chromium-81.0.4044.138-darwin64-546064.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
@ -796,9 +796,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>e11da8884e44c27df3bf3adce01d5760</string>
<string>7599bb6b05a5e48ce78180735e5d3355</string>
<key>url</key>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202007201344_81.3.10_gb223419_chromium-81.0.4044.138-windows-202072245.tar.bz2</string>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202007261348_81.3.10_gb223419_chromium-81.0.4044.138-windows-202081313.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -808,9 +808,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>609dd2d70b73d83c382f73734c648156</string>
<string>92ced00cd0f89d0154ce2bcc6da086e0</string>
<key>url</key>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202007201344_81.3.10_gb223419_chromium-81.0.4044.138-windows64-202072240.tar.bz2</string>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202007261348_81.3.10_gb223419_chromium-81.0.4044.138-windows64-202081325.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
@ -820,16 +820,16 @@
<key>archive</key>
<map>
<key>hash</key>
<string>79e5ef408ea7ee43fef0f738688485c6</string>
<string>2b29e6435ea9487bc2019a28b8287d6a</string>
<key>url</key>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202007201635_81.3.10_gb223419_chromium-81.0.4044.138-linux64-202021435.tar.bz2</string>
<string>http://3p.firestormviewer.org/dullahan-1.8.0.202011061705_81.3.10_gb223419_chromium-81.0.4044.138-linux64-203111605.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
</map>
</map>
<key>version</key>
<string>1.7.0.202006240858_81.3.10_gb223419_chromium-81.0.4044.138</string>
<string>1.7.0.202008031800_81.3.10_gb223419_chromium-81.0.4044.138</string>
</map>
<key>elfio</key>
<map>
@ -964,11 +964,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>2c7c5fb28c34d4833b14d49d4abb101a</string>
<string>fc2d285da5298b666fc3c54015a8669a</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>file:///opt/firestorm/fmodstudio-2.01.04-darwin-202612342.tar.bz2</string>
<string>file:///opt/firestorm/fmodstudio-2.01.05-darwin-202981448.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -978,11 +978,11 @@
<key>archive</key>
<map>
<key>hash</key>
<string>87a94446fed5e9bdaf7bb4f9b0c21574</string>
<string>ee3c5e3449e06bc3dbb1c9dc29aca53d</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>file:///opt/firestorm/fmodstudio-2.01.04-linux64-202721507.tar.bz2</string>
<string>file:///opt/firestorm/fmodstudio-2.01.05-linux64-202931144.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@ -2375,16 +2375,18 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b677ee43822212f0a27c838dc8bf3623</string>
<string>9f4687d7d328b0c13a9e651e805e880a</string>
<key>hash_algorithm</key>
<string>md5</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/67622/646614/llca-202009010215.548269-common-548269.tar.bz2</string>
<string>https://automated-builds-secondlife-com.s3.amazonaws.com/ct2/71501/691487/llca-202011010215.551526-common-551526.tar.bz2</string>
</map>
<key>name</key>
<string>common</string>
</map>
</map>
<key>version</key>
<string>202009010215.548269</string>
<string>202011010215.551526</string>
</map>
<key>llphysicsextensions_source</key>
<map>
@ -2936,33 +2938,21 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>5abf2d9c0b250821c59cc60cd94fd8af</string>
<string>53966a7ba6342395acb7ce15bc3fbe0a</string>
<key>url</key>
<string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54840/510064/openjpeg-1.5.1.538970-darwin64-538970.tar.bz2</string>
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.203000304-darwin-203000304.tar.bz2</string>
</map>
<key>name</key>
<string>darwin64</string>
</map>
<key>linux</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>4a5591349005afac44a688e99517a9f3</string>
<key>url</key>
<string>http://3p.firestormviewer.org/openjpeg-1.5.1.180991818-linux-180991818.tar.bz2</string>
</map>
<key>name</key>
<string>linux</string>
</map>
<key>linux64</key>
<map>
<key>archive</key>
<map>
<key>hash</key>
<string>addb209bb56a8f16602a7222f119191d</string>
<string>b7be1d6116fb5848ab2beef19b6a8b15</string>
<key>url</key>
<string>http://3p.firestormviewer.org/openjpeg-1.5.1.180991822-linux64-180991822.tar.bz2</string>
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202991551-linux64-202991551.tar.bz2</string>
</map>
<key>name</key>
<string>linux64</string>
@ -2972,9 +2962,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>b20c18f66ae63c9d3b1970af8866aeb9</string>
<string>e235c5da10f29893e14b14c7a3184d91</string>
<key>url</key>
<string>http://3p.firestormviewer.org/openjpeg-1.4.202102107-windows-202102107.tar.bz2</string>
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202821233-windows-202821233.tar.bz2</string>
</map>
<key>name</key>
<string>windows</string>
@ -2984,16 +2974,16 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>archive</key>
<map>
<key>hash</key>
<string>6f1e1d8796301c4e5737cb0db0f696d2</string>
<string>d87183b9cab5910a4a0f15e8faebab06</string>
<key>url</key>
<string>http://3p.firestormviewer.org/openjpeg-1.4.202102110-windows64-202102110.tar.bz2</string>
<string>http://3p.firestormviewer.org/openjpeg-2.3.1.202821246-windows64-202821246.tar.bz2</string>
</map>
<key>name</key>
<string>windows64</string>
</map>
</map>
<key>version</key>
<string>1.5.1.538970</string>
<string>2.3.1</string>
</map>
<key>openssl</key>
<map>
@ -4222,7 +4212,26 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
<key>name</key>
<string>ReleaseFS</string>
</map>
</map>
<key>ReleaseFS_open</key>
<map>
<key>build</key>
<map>
<key>options</key>
<array>
<string>--platform darwin</string>
</array>
</map>
<key>configure</key>
<map>
<key>options</key>
<array>
<string>--platform darwin</string>
</array>
</map>
<key>name</key>
<string>ReleaseFS_open</string>
</map>
</map>
<key>name</key>
<string>darwin64</string>
</map>

View File

@ -226,6 +226,9 @@ Ansariel Hiller
SL-10385
SL-10891
SL-10675
SL-13364
SL-13858
SL-13697
Aralara Rajal
Arare Chantilly
CHUIBUG-191
@ -842,7 +845,9 @@ Khyota Wulluf
Kimar Coba
Kithrak Kirkorian
Kitty Barnett
BUG-228664
BUG-228665
BUG-228719
VWR-19699
STORM-288
STORM-799

View File

@ -106,6 +106,8 @@ if (WINDOWS)
/Zc:forScope
/nologo
/Oy-
/Oi
/Ot
/arch:AVX
/fp:fast
)
@ -118,8 +120,10 @@ if (WINDOWS)
/Zc:forScope
/nologo
/Oy-
/Oi
/Ot
/arch:AVX2
# /fp:fast
/fp:fast
)
else (USE_AVX_OPTIMIZATION)
# </FS:Ansariel> AVX/AVX2 support
@ -131,6 +135,8 @@ if (WINDOWS)
/Zc:forScope
/nologo
/Oy-
/Oi
/Ot
# /arch:SSE2
/fp:fast
)

View File

@ -52,7 +52,7 @@ if(WINDOWS)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
openjpeg.dll
#openjp2.dll # <FS:Ansariel> Only copy OpenJPEG dll if needed
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
@ -63,6 +63,12 @@ if(WINDOWS)
libhunspell.dll
)
# <FS:Ansariel> Only copy OpenJPEG dll if needed
if (NOT USE_KDU)
set(release_files ${release_files} openjp2.dll)
endif (NOT USE_KDU)
# </FS:Ansariel>
# Filenames are different for 32/64 bit BugSplat file and we don't
# have any control over them so need to branch.
if (BUGSPLAT_DB)

View File

@ -9,14 +9,7 @@ if (USESYSTEMLIBS)
else (USESYSTEMLIBS)
use_prebuilt_binary(openjpeg)
if(WINDOWS)
# Windows has differently named release and debug openjpeg(d) libs.
set(OPENJPEG_LIBRARIES
debug openjpegd
optimized openjpeg)
else(WINDOWS)
set(OPENJPEG_LIBRARIES openjpeg)
endif(WINDOWS)
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
set(OPENJPEG_LIBRARIES openjp2)
set(OPENJPEG_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/openjpeg)
endif (USESYSTEMLIBS)

View File

@ -99,14 +99,14 @@ if (WINDOWS)
# Copy over OpenJPEG.dll
# *NOTE: On Windows with VS2005, only the first comment prints
set(OPENJPEG_RELEASE
"${ARCH_PREBUILT_DIRS_RELEASE}/openjpeg.dll")
"${ARCH_PREBUILT_DIRS_RELEASE}/openjp2.dll")
add_custom_command( TARGET llui_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPENJPEG_RELEASE} ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Copying OpenJPEG DLLs to binary directory"
)
set(OPENJPEG_DEBUG
"${ARCH_PREBUILT_DIRS_DEBUG}/openjpegd.dll")
"${ARCH_PREBUILT_DIRS_DEBUG}/openjp2.dll")
add_custom_command( TARGET llui_libtest POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${OPENJPEG_DEBUG} ${CMAKE_CURRENT_BINARY_DIR}

View File

@ -1347,7 +1347,7 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32
std::map<LLUUID, LLSoundHistoryItem> gSoundHistory;
// static
void LLAudioSource::logSoundPlay(const LLUUID& id, LLAudioSource* audio_source, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped)
void LLAudioSource::logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped)
{
// <FS:ND> Corrupt asset, do not bother
if( gAudiop->isCorruptSound( assetid ) )
@ -1362,7 +1362,6 @@ void LLAudioSource::logSoundPlay(const LLUUID& id, LLAudioSource* audio_source,
LLSoundHistoryItem item;
item.mID = id;
item.mAudioSource = audio_source;
item.mPosition = position;
item.mType = type;
item.mAssetID = assetid;
@ -1387,7 +1386,6 @@ void LLAudioSource::logSoundStop(const LLUUID& id)
{
gSoundHistory[id].mPlaying = false;
gSoundHistory[id].mTimeStopped = LLTimer::getElapsedSeconds();
gSoundHistory[id].mAudioSource = NULL; // just in case
pruneSoundLog();
}
}
@ -1546,7 +1544,7 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
// NaCl - Sound Explorer
if(mType != LLAudioEngine::AUDIO_TYPE_UI) //&& mSourceID.notNull())
{
logSoundPlay(mLogID, this, mPositionGlobal, mType, audio_uuid, mOwnerID, mSourceID, mIsTrigger, mLoop);
logSoundPlay(mLogID, mPositionGlobal, mType, audio_uuid, mOwnerID, mSourceID, mIsTrigger, mLoop);
}
// NaCl End
// Special abuse of play(); don't play a sound, but kill it.

View File

@ -372,7 +372,7 @@ protected:
void setChannel(LLAudioChannel *channelp);
LLAudioChannel *getChannel() const { return mChannelp; }
// NaCl - Sound Explorer
static void logSoundPlay(const LLUUID& id, LLAudioSource* audio_source, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped);
static void logSoundPlay(const LLUUID& id, LLVector3d position, S32 type, const LLUUID& assetid, const LLUUID& ownerid, const LLUUID& sourceid, bool is_trigger, bool is_looped);
static void logSoundStop(const LLUUID& id);
static void pruneSoundLog();
static S32 sSoundHistoryPruneCounter;
@ -556,7 +556,6 @@ struct LLSoundHistoryItem
F64 mTimeStopped;
bool mReviewed;
bool mReviewedCollision;
LLAudioSource* mAudioSource;
LLSoundHistoryItem()
: mType(0)
@ -567,7 +566,6 @@ struct LLSoundHistoryItem
, mTimeStopped(0.f)
, mReviewed(false)
, mReviewedCollision(false)
, mAudioSource(0)
{
}
};

View File

@ -182,7 +182,7 @@ LLApp::~LLApp()
if(mExceptionHandler != 0) delete mExceptionHandler;
SUBSYSTEM_CLEANUP(LLCommon);
SUBSYSTEM_CLEANUP_DBG(LLCommon);
}
// static

View File

@ -68,7 +68,7 @@ void ll_cleanup_apr()
{
gAPRInitialized = false;
LL_INFOS("APR") << "Cleaning up APR" << LL_ENDL;
LL_DEBUGS("APR") << "Cleaning up APR" << LL_ENDL;
LLThreadLocalPointerBase::destroyAllThreadLocalStorage();

View File

@ -20,10 +20,13 @@
#include "llerror.h"
#include "llerrorcontrol.h"
void log_subsystem_cleanup(const char* file, int line, const char* function,
void log_subsystem_cleanup(LLError::ELevel level,
const char* file,
int line,
const char* function,
const char* classname)
{
LL_INFOS("Cleanup") << LLError::abbreviateFile(file) << "(" << line << "): "
LL_VLOGS(level, "Cleanup") << LLError::abbreviateFile(file) << "(" << line << "): "
<< "calling " << classname << "::cleanupClass() in "
<< function << LL_ENDL;
}

View File

@ -21,13 +21,22 @@
// shutdown schemes.
#define SUBSYSTEM_CLEANUP(CLASSNAME) \
do { \
log_subsystem_cleanup(__FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \
log_subsystem_cleanup(LLError::LEVEL_INFO, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \
CLASSNAME::cleanupClass(); \
} while (0)
#define SUBSYSTEM_CLEANUP_DBG(CLASSNAME) \
do { \
log_subsystem_cleanup(LLError::LEVEL_DEBUG, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, #CLASSNAME); \
CLASSNAME::cleanupClass(); \
} while (0)
// Use ancient do { ... } while (0) macro trick to permit a block of
// statements with the same syntax as a single statement.
void log_subsystem_cleanup(const char* file, int line, const char* function,
void log_subsystem_cleanup(LLError::ELevel level,
const char* file,
int line,
const char* function,
const char* classname);
#endif /* ! defined(LL_LLCLEANUP_H) */

View File

@ -63,7 +63,7 @@ void LLCommon::cleanupClass()
sMasterThreadRecorder = NULL;
LLTrace::set_master_thread_recorder(NULL);
LLThreadSafeRefCount::cleanupThreadSafeRefCount();
SUBSYSTEM_CLEANUP(LLTimer);
SUBSYSTEM_CLEANUP_DBG(LLTimer);
if (sAprInitialized)
{
ll_cleanup_apr();

View File

@ -337,12 +337,9 @@ namespace LLError
}
// huh, that's odd, we should see one or the other prefix -- but don't
// try to log unless logging is already initialized
if (is_available())
{
// in Python, " or ".join(vector) -- but in C++, a PITB
LL_DEBUGS() << "Did not see 'class' or 'struct' prefix on '"
<< name << "'" << LL_ENDL;
}
// in Python, " or ".join(vector) -- but in C++, a PITB
LL_DEBUGS() << "Did not see 'class' or 'struct' prefix on '"
<< name << "'" << LL_ENDL;
return name;
#else // neither GCC nor Visual Studio
@ -443,9 +440,12 @@ namespace
typedef std::vector<LLError::RecorderPtr> Recorders;
typedef std::vector<LLError::CallSite*> CallSiteVector;
class Globals : public LLSingleton<Globals>
class Globals
{
LLSINGLETON(Globals);
public:
static Globals* getInstance();
protected:
Globals();
public:
std::ostringstream messageStream;
bool messageStreamInUse;
@ -465,6 +465,16 @@ namespace
{
}
Globals* Globals::getInstance()
{
// According to C++11 Function-Local Initialization
// of static variables is supposed to be thread safe
// without risk of deadlocks.
static Globals inst;
return &inst;
}
void Globals::addCallSite(LLError::CallSite& site)
{
callSites.push_back(&site);
@ -517,14 +527,17 @@ namespace LLError
typedef LLPointer<SettingsConfig> SettingsConfigPtr;
class Settings : public LLSingleton<Settings>
class Settings
{
LLSINGLETON(Settings);
public:
static Settings* getInstance();
protected:
Settings();
public:
SettingsConfigPtr getSettingsConfig();
void reset();
SettingsStoragePtr saveAndReset();
SettingsStoragePtr saveAndReset();
void restore(SettingsStoragePtr pSettingsStorage);
private:
@ -558,6 +571,16 @@ namespace LLError
{
}
Settings* Settings::getInstance()
{
// According to C++11 Function-Local Initialization
// of static variables is supposed to be thread safe
// without risk of deadlocks.
static Settings inst;
return &inst;
}
SettingsConfigPtr Settings::getSettingsConfig()
{
return mSettingsConfig;
@ -582,11 +605,6 @@ namespace LLError
SettingsConfigPtr newSettingsConfig(dynamic_cast<SettingsConfig *>(pSettingsStorage.get()));
mSettingsConfig = newSettingsConfig;
}
bool is_available()
{
return Settings::instanceExists() && Globals::instanceExists();
}
}
namespace LLError
@ -1039,7 +1057,7 @@ namespace LLError
std::pair<boost::shared_ptr<RECORDER>, Recorders::iterator>
findRecorderPos()
{
SettingsConfigPtr s = Settings::instance().getSettingsConfig();
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
// Since we promise to return an iterator, use a classic iterator
// loop.
auto end{s->mRecorders.end()};
@ -1082,7 +1100,7 @@ namespace LLError
auto found = findRecorderPos<RECORDER>();
if (found.first)
{
SettingsConfigPtr s = Settings::instance().getSettingsConfig();
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
s->mRecorders.erase(found.second);
}
return bool(found.first);
@ -1323,14 +1341,6 @@ namespace LLError
return false;
}
// If we hit a logging request very late during shutdown processing,
// when either of the relevant LLSingletons has already been deleted,
// DO NOT resurrect them.
if (Settings::wasDeleted() || Globals::wasDeleted())
{
return false;
}
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();
s->mShouldLogCallCounter++;
@ -1369,10 +1379,8 @@ namespace LLError
std::ostringstream* Log::out()
{
LLMutexTrylock lock(getMutex<LOG_MUTEX>(),5);
// If we hit a logging request very late during shutdown processing,
// when either of the relevant LLSingletons has already been deleted,
// DO NOT resurrect them.
if (lock.isLocked() && ! (Settings::wasDeleted() || Globals::wasDeleted()))
if (lock.isLocked())
{
Globals* g = Globals::getInstance();
@ -1394,14 +1402,6 @@ namespace LLError
return;
}
// If we hit a logging request very late during shutdown processing,
// when either of the relevant LLSingletons has already been deleted,
// DO NOT resurrect them.
if (Settings::wasDeleted() || Globals::wasDeleted())
{
return;
}
if(strlen(out->str().c_str()) < 128)
{
strcpy(message, out->str().c_str());
@ -1434,14 +1434,6 @@ namespace LLError
return;
}
// If we hit a logging request very late during shutdown processing,
// when either of the relevant LLSingletons has already been deleted,
// DO NOT resurrect them.
if (Settings::wasDeleted() || Globals::wasDeleted())
{
return;
}
Globals* g = Globals::getInstance();
SettingsConfigPtr s = Settings::getInstance()->getSettingsConfig();

View File

@ -203,11 +203,6 @@ namespace LLError
LL_COMMON_API std::string abbreviateFile(const std::string& filePath);
LL_COMMON_API int shouldLogCallCount();
// Check whether Globals exists. This should only be used by LLSingleton
// infrastructure to avoid trying to log when our internal LLSingleton is
// unavailable -- circularity ensues.
LL_COMMON_API bool is_available();
};
#endif // LL_LLERRORCONTROL_H

View File

@ -28,7 +28,7 @@
#include "llsingleton.h"
#include "llerror.h"
#include "llerrorcontrol.h" // LLError::is_available()
#include "llerrorcontrol.h"
#include "lldependencies.h"
#include "llexception.h"
#include "llcoros.h"
@ -41,8 +41,6 @@
namespace {
void log(LLError::ELevel level,
const char* p1, const char* p2, const char* p3, const char* p4);
bool oktolog();
} // anonymous namespace
// Our master list of all LLSingletons is itself an LLSingleton. We used to
@ -279,8 +277,6 @@ void LLSingletonBase::reset_initializing(list_t::size_type size)
void LLSingletonBase::MasterList::LockedInitializing::log(const char* verb, const char* name)
{
if (oktolog())
{
LL_DEBUGS("LLSingleton") << verb << ' ' << demangle(name) << ';';
if (mList)
{
@ -292,7 +288,6 @@ void LLSingletonBase::MasterList::LockedInitializing::log(const char* verb, cons
}
}
LL_ENDL;
}
}
void LLSingletonBase::capture_dependency()
@ -455,33 +450,11 @@ void LLSingletonBase::deleteAll()
/*---------------------------- Logging helpers -----------------------------*/
namespace {
bool oktolog()
{
// See comments in log() below.
return LLError::is_available();
}
void log(LLError::ELevel level,
const char* p1, const char* p2, const char* p3, const char* p4)
{
// The is_available() test below ensures that we'll stop logging once
// LLError has been cleaned up. If we had a similar portable test for
// std::cerr, this would be a good place to use it.
// Check LLError::is_available() because some of LLError's infrastructure
// is itself an LLSingleton. If that LLSingleton has not yet been
// initialized, trying to log will engage LLSingleton machinery... and
// around and around we go.
if (LLError::is_available())
{
LL_VLOGS(level, "LLSingleton") << p1 << p2 << p3 << p4 << LL_ENDL;
}
else
{
// Caller may be a test program, or something else whose stderr is
// visible to the user.
std::cerr << p1 << p2 << p3 << p4 << std::endl;
}
LL_VLOGS(level, "LLSingleton") << p1 << p2 << p3 << p4 << LL_ENDL;
}
} // anonymous namespace

View File

@ -1285,7 +1285,9 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
// std::locale() throws if the locale is unknown! (EXT-7926)
try
{
strStream.imbue(std::locale(sLocale.c_str()));
// <FS:Ansariel> FIRE-6070: Use user's system locale setting for number formatting
//strStream.imbue(std::locale(sLocale.c_str()));
strStream.imbue(std::locale(""));
} catch (const std::exception &)
{
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;
@ -1300,6 +1302,11 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
{
strStream << intStr;
numStr = strStream.str();
// <FS:Ansariel> FIRE-6070: Fix random symbols in formatted numbers in some locales
#ifdef LL_WINDOWS
numStr = ll_convert_string_to_utf8_string(numStr);
#endif
// </FS:Ansariel>
}
}
else
@ -1310,6 +1317,11 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
{
strStream << std::fixed << std::showpoint << std::setprecision(intDecimals) << floatStr;
numStr = strStream.str();
// <FS:Ansariel> FIRE-6070: Fix random symbols in formatted numbers in some locales
#ifdef LL_WINDOWS
numStr = ll_convert_string_to_utf8_string(numStr);
#endif
// </FS:Ansariel>
}
}
}

View File

@ -150,13 +150,13 @@ LLOSInfo::LLOSInfo() :
#if LL_WINDOWS
if (IsWindowsVersionOrGreater(10, 0, 0))
if (IsWindows10OrGreater())
{
mMajorVer = 10;
mMinorVer = 0;
if (IsWindowsServer())
{
mOSStringSimple = "Windows Server 2016 ";
mOSStringSimple = "Windows Server ";
}
else
{
@ -956,12 +956,20 @@ LLSD LLMemoryInfo::loadStatsMap( bool aProcessMemoryOnly )
DWORDLONG div = 1024;
stats.add("Percent Memory use", state.dwMemoryLoad/div);
stats.add("Total Physical KB", state.ullTotalPhys/div);
stats.add("Avail Physical KB", state.ullAvailPhys/div);
stats.add("Total page KB", state.ullTotalPageFile/div);
stats.add("Avail page KB", state.ullAvailPageFile/div);
stats.add("Total Virtual KB", state.ullTotalVirtual/div);
stats.add("Avail Virtual KB", state.ullAvailVirtual/div);
// <FS:Ansariel> Ugly, but prevent overflow
//stats.add("Total Physical KB", state.ullTotalPhys/div);
//stats.add("Avail Physical KB", state.ullAvailPhys/div);
//stats.add("Total page KB", state.ullTotalPageFile/div);
//stats.add("Avail page KB", state.ullAvailPageFile/div);
//stats.add("Total Virtual KB", state.ullTotalVirtual/div);
//stats.add("Avail Virtual KB", state.ullAvailVirtual/div);
stats.add("Total Physical KB", llclamp(state.ullTotalPhys/div, U64(0), U64(S32_MAX)));
stats.add("Avail Physical KB", llclamp(state.ullAvailPhys/div, U64(0), U64(S32_MAX)));
stats.add("Total page KB", llclamp(state.ullTotalPageFile/div, U64(0), U64(S32_MAX)));
stats.add("Avail page KB", llclamp(state.ullAvailPageFile/div, U64(0), U64(S32_MAX)));
stats.add("Total Virtual KB", llclamp(state.ullTotalVirtual/div, U64(0), U64(S32_MAX)));
stats.add("Avail Virtual KB", llclamp(state.ullAvailVirtual/div, U64(0), U64(S32_MAX)));
// </FS:Ansariel>
// <FS:ND> Early out in case only process memory is requested.
if( aProcessMemoryOnly )

View File

@ -1079,9 +1079,10 @@ void LLImageRaw::composite( LLImageRaw* src )
return;
}
llassert(3 == src->getComponents());
llassert(3 == dst->getComponents());
// <FS:Beq> These assertions are nonsense.
// llassert(3 == src->getComponents());
// llassert(3 == dst->getComponents());
// </FS:Beq>
if( 3 == dst->getComponents() )
{
if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) )
@ -1143,12 +1144,34 @@ void LLImageRaw::compositeUnscaled4onto3( LLImageRaw* src )
{
LLImageRaw* dst = this; // Just for clarity.
llassert( (3 == src->getComponents()) || (4 == src->getComponents()) );
// <FS:Beq> Correct bad assertion
// llassert( (3 == src->getComponents()) || (4 == src->getComponents()) );
llassert( (4 == src->getComponents()) || (3 == dst->getComponents()) );
// </FS:Beq>
llassert( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) );
U8* src_data = src->getData();
U8* dst_data = dst->getData();
S32 pixels = getWidth() * getHeight();
// <FS:Beq> suspicious crash avoid potential causes.
if(!src_data)
{
LL_WARNS() << "source is null!" << LL_ENDL;
return;
}
if(!dst_data)
{
LL_WARNS() << "destination is null!" << LL_ENDL;
return;
}
auto src_comps = src->getComponents();
if( src_comps != 4)
{
// This should never be reached, buit apparently it is.
LL_WARNS() << "src has incorrect number of layers (" << src_comps << ")" << LL_ENDL;
return;
}
// </FS:Beq>
while( pixels-- )
{
U8 alpha = src_data[3];

View File

@ -29,9 +29,140 @@
// this is defined so that we get static linking.
#include "openjpeg.h"
#include "cio.h"
#include "event.h"
#define OPENJPEG2
#include "lltimer.h"
//#include "llmemory.h"
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
#ifdef OPENJPEG2
class LLJp2StreamReader {
public:
LLJp2StreamReader(LLImageJ2C* pImage) : m_pImage(pImage), m_Position(0) { }
static OPJ_SIZE_T readStream(void* pBufferOut, OPJ_SIZE_T szBufferOut, void* pUserData)
{
LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData;
if ( (!pBufferOut) || (!pStream) || (!pStream->m_pImage) )
return (OPJ_SIZE_T)-1;
OPJ_SIZE_T szBufferRead = llmin(szBufferOut, pStream->m_pImage->getDataSize() - pStream->m_Position);
if (!szBufferRead)
return (OPJ_SIZE_T)-1;
memcpy(pBufferOut, pStream->m_pImage->getData() + pStream->m_Position, szBufferRead);
pStream->m_Position += szBufferRead;
return szBufferRead;
}
static OPJ_OFF_T skipStream(OPJ_OFF_T bufferOffset, void* pUserData)
{
LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData;
if ( (!pStream) || (!pStream->m_pImage) )
return (OPJ_SIZE_T)-1;
if (bufferOffset < 0)
{
// Skipping backward
if (pStream->m_Position == 0)
return (OPJ_SIZE_T)-1; // Already at the start of the stream
else if (pStream->m_Position + bufferOffset < 0)
bufferOffset = -(OPJ_OFF_T)pStream->m_Position; // Don't underflow
}
else
{
// Skipping forward
OPJ_SIZE_T szRemaining = pStream->m_pImage->getDataSize() - pStream->m_Position;
if (!szRemaining)
return (OPJ_SIZE_T)-1; // Already at the end of the stream
else if (bufferOffset > szRemaining)
bufferOffset = szRemaining; // Don't overflow
}
pStream->m_Position += bufferOffset;
return bufferOffset;
}
static OPJ_BOOL seekStream(OPJ_OFF_T bufferOffset, void* pUserData)
{
LLJp2StreamReader* pStream = (LLJp2StreamReader*)pUserData;
if ( (!pStream) || (!pStream->m_pImage) )
return OPJ_FALSE;
if ( (bufferOffset < 0) || (bufferOffset > pStream->m_pImage->getDataSize()) )
return OPJ_FALSE;
pStream->m_Position = bufferOffset;
return OPJ_TRUE;
}
protected:
LLImageJ2C* m_pImage = nullptr;
OPJ_SIZE_T m_Position = 0;
};
class LLJp2StreamWriter {
public:
LLJp2StreamWriter(LLImageJ2C* pImage) : m_pImage(pImage), m_Position(0) { }
static OPJ_SIZE_T writeStream(void* pBufferIn, OPJ_SIZE_T szBufferIn, void* pUserData)
{
LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData;
if ( (!pBufferIn) || (!pStream) || (!pStream->m_pImage) )
return (OPJ_SIZE_T)-1;
if (pStream->m_Position + szBufferIn > pStream->m_pImage->getDataSize())
pStream->m_pImage->reallocateData(pStream->m_Position + szBufferIn);
memcpy(pStream->m_pImage->getData() + pStream->m_Position, pBufferIn, szBufferIn);
pStream->m_Position += szBufferIn;
return szBufferIn;
}
static OPJ_OFF_T skipStream(OPJ_OFF_T bufferOffset, void* pUserData)
{
LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData;
if ( (!pStream) || (!pStream->m_pImage) )
return -1;
if (bufferOffset < 0)
{
// Skipping backward
if (pStream->m_Position == 0)
return -1; // Already at the start of the stream
else if (pStream->m_Position + bufferOffset < 0)
bufferOffset = -pStream->m_Position; // Don't underflow
}
else
{
// Skipping forward
if (pStream->m_Position + bufferOffset > pStream->m_pImage->getDataSize())
return -1; // Don't allow skipping past the end of the stream
}
pStream->m_Position += bufferOffset;
return bufferOffset;
}
static OPJ_BOOL seekStream(OPJ_OFF_T bufferOffset, void* pUserData)
{
LLJp2StreamWriter* pStream = (LLJp2StreamWriter*)pUserData;
if ( (!pStream) || (!pStream->m_pImage) )
return OPJ_FALSE;
if ( (bufferOffset < 0) || (bufferOffset > pStream->m_pImage->getDataSize()) )
return OPJ_FALSE;
pStream->m_Position = bufferOffset;
return OPJ_TRUE;
}
protected:
LLImageJ2C* m_pImage = nullptr;
OPJ_OFF_T m_Position = 0;
};
#endif
// [/SL:KB]
// Factory function: see declaration in llimagej2c.cpp
LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl()
@ -44,8 +175,10 @@ std::string LLImageJ2COJ::getEngineInfo() const
#ifdef OPENJPEG_VERSION
return std::string("OpenJPEG: " OPENJPEG_VERSION ", Runtime: ")
+ opj_version();
#elif defined OPJ_PACKAGE_VERSION
return std::string("OpenJPEG: " OPJ_PACKAGE_VERSION ", Runtime: ") + opj_version();
#else
return std::string("OpenJPEG runtime: ") + opj_version();
return std::string("OpenJPEG Runtime: ") + opj_version();
#endif
}
@ -164,9 +297,10 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
opj_event_mgr_t event_mgr; /* event manager */
opj_image_t *image = NULL;
#ifndef OPENJPEG2
opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */
opj_cio_t *cio = NULL;
#endif
/* configure the event callbacks (not required) */
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
@ -184,6 +318,45 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
/* JPEG-2000 codestream */
#ifdef OPENJPEG2
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
/* get a decoder handle */
opj_codec_t* opj_decoder_p = opj_create_decompress(OPJ_CODEC_J2K);
/* catch events using our callbacks and give a local context */
opj_set_error_handler(opj_decoder_p, error_callback, 0);
opj_set_warning_handler(opj_decoder_p, warning_callback, 0);
opj_set_info_handler(opj_decoder_p, info_callback, 0);
/* setup the decoder decoding parameters using user parameters */
opj_setup_decoder(opj_decoder_p, &parameters);
/* allow multi-threading */
if (opj_has_thread_support())
{
opj_codec_set_threads(opj_decoder_p, opj_get_num_cpus());
}
/* open a byte stream */
LLJp2StreamReader streamReader(&base);
opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_READ);
opj_stream_set_read_function(opj_stream_p, LLJp2StreamReader::readStream);
opj_stream_set_skip_function(opj_stream_p, LLJp2StreamReader::skipStream);
opj_stream_set_seek_function(opj_stream_p, LLJp2StreamReader::seekStream);
opj_stream_set_user_data(opj_stream_p, &streamReader, nullptr);
opj_stream_set_user_data_length(opj_stream_p, base.getDataSize());
/* decode the stream and fill the image structure */
bool fSuccess = opj_read_header(opj_stream_p, opj_decoder_p, &image) &&
opj_decode(opj_decoder_p, opj_stream_p, image) &&
opj_end_decompress(opj_decoder_p, opj_stream_p);
/* close the byte stream */
opj_stream_destroy(opj_stream_p);
/* free remaining structures */
opj_destroy_codec(opj_decoder_p);
#else
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_J2K);
@ -207,11 +380,19 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
{
opj_destroy_decompress(dinfo);
}
#endif
// [/SL:KB]
// The image decode failed if the return was NULL or the component
// count was zero. The latter is just a sanity check before we
// dereference the array.
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
#ifdef OPENJPEG2
if ( (!fSuccess) || (!image) || (!image->numcomps) )
#else
if(!image || !image->numcomps)
#endif
// [/SL:KB]
{
LL_DEBUGS("Texture") << "ERROR -> decodeImpl: failed to decode image!" << LL_ENDL;
if (image)
@ -219,21 +400,28 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
opj_image_destroy(image);
}
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
base.decodeFailed();
// [SL:KB]
return true; // done
}
// sometimes we get bad data out of the cache - check to see if the decode succeeded
for (S32 i = 0; i < image->numcomps; i++)
{
if (image->comps[i].factor != base.getRawDiscardLevel())
{
// if we didn't get the discard level we're expecting, fail
opj_image_destroy(image);
base.mDecoding = false;
return true;
}
}
// for (S32 i = 0; i < image->numcomps; i++)
// {
// if (image->comps[i].factor != base.getRawDiscardLevel())
// {
// // if we didn't get the discard level we're expecting, fail
//
//// [SN:SG] - Patch: Import-MiscOpenJPEG
// LL_WARNS("Texture") << "Expected discard level not reached!" << LL_ENDL;
// base.decodeFailed();
//// [SN:SG]
//// base.mDecoding = false;
// return true;
// }
// }
if(image->numcomps <= first_channel)
{
LL_WARNS() << "trying to decode more channels than are present in image: numcomps: " << image->numcomps << " first_channel: " << first_channel << LL_ENDL;
@ -241,7 +429,11 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
{
opj_image_destroy(image);
}
// [SN:SG] - Patch: Import-MiscOpenJPEG
base.decodeFailed();
// [SN:SG]
return true;
}
@ -299,6 +491,9 @@ bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decod
LL_DEBUGS("Texture") << "ERROR -> decodeImpl: failed to decode image! (NULL comp data - OpenJPEG bug)" << LL_ENDL;
opj_image_destroy(image);
// [SN:SG] - Patch: Import-MiscOpenJPEG
base.decodeFailed();
// [SN:SG]
return true; // done
}
}
@ -364,7 +559,13 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
//
// Fill in the source image from our raw image
//
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
#ifdef OPENJPEG2
OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_SRGB;
#else
OPJ_COLOR_SPACE color_space = CLRSPC_SRGB;
#endif
// [/SL:KB]
opj_image_cmptparm_t cmptparm[MAX_COMPS];
opj_image_t * image = NULL;
S32 numcomps = raw_image.getComponents();
@ -409,6 +610,57 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
/* encode the destination image */
/* ---------------------------- */
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
#ifdef OPENJPEG2
/* get a J2K compressor handle */
opj_codec_t* opj_encoder_p = opj_create_compress(OPJ_CODEC_J2K);
/* catch events using our callbacks and give a local context */
opj_set_error_handler(opj_encoder_p, error_callback, 0);
opj_set_warning_handler(opj_encoder_p, warning_callback, 0);
opj_set_info_handler(opj_encoder_p, info_callback, 0);
/* setup the encoder parameters using the current image and using user parameters */
bool fSuccess = opj_setup_encoder(opj_encoder_p, &parameters, image);
if (!fSuccess)
{
opj_destroy_codec(opj_encoder_p);
opj_image_destroy(image);
LL_DEBUGS("Texture") << "Failed to encode image." << LL_ENDL;
return false;
}
/* open a byte stream for writing */
/* allocate memory for all tiles */
LLJp2StreamWriter streamWriter(&base);
opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_WRITE);
opj_stream_set_write_function(opj_stream_p, LLJp2StreamWriter::writeStream);
opj_stream_set_skip_function(opj_stream_p, LLJp2StreamWriter::skipStream);
opj_stream_set_seek_function(opj_stream_p, LLJp2StreamWriter::seekStream);
opj_stream_set_user_data(opj_stream_p, &streamWriter, nullptr);
opj_stream_set_user_data_length(opj_stream_p, raw_image.getDataSize());
/* encode the image */
fSuccess = opj_start_compress(opj_encoder_p, image, opj_stream_p) &&
opj_encode(opj_encoder_p, opj_stream_p) &&
opj_end_compress(opj_encoder_p, opj_stream_p);
if (!fSuccess)
{
opj_stream_destroy(opj_stream_p);
opj_destroy_codec(opj_encoder_p);
opj_image_destroy(image);
LL_DEBUGS("Texture") << "Failed to encode image." << LL_ENDL;
return false;
}
base.updateData(); // set width, height
/* close and free the byte stream */
opj_stream_destroy(opj_stream_p);
/* free remaining compression structures */
opj_destroy_codec(opj_encoder_p);
#else
int codestream_length;
opj_cio_t *cio = NULL;
@ -416,7 +668,7 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
opj_cinfo_t* cinfo = opj_create_compress(CODEC_J2K);
/* catch events using our callbacks and give a local context */
opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr);
opj_set_event_mgr((opj_common_ptr)cinfo, &event_mgr, stderr);
/* setup the encoder parameters using the current image and using user parameters */
opj_setup_encoder(cinfo, &parameters, image);
@ -447,6 +699,8 @@ bool LLImageJ2COJ::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, con
/* free user parameters structure */
if(parameters.cp_matrice) free(parameters.cp_matrice);
#endif
// [/SL:KB]
/* free image data */
opj_image_destroy(image);
@ -535,9 +789,10 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base)
opj_event_mgr_t event_mgr; /* event manager */
opj_image_t *image = NULL;
#ifndef OPENJPEG2
opj_dinfo_t* dinfo = NULL; /* handle to a decompressor */
opj_cio_t *cio = NULL;
#endif
/* configure the event callbacks (not required) */
memset(&event_mgr, 0, sizeof(opj_event_mgr_t));
@ -549,7 +804,9 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base)
opj_set_default_decoder_parameters(&parameters);
// Only decode what's required to get the size data.
#ifndef OPENJPEG2
parameters.cp_limit_decoding=LIMIT_TO_MAIN_HEADER;
#endif
//parameters.cp_reduce = mRawDiscardLevel;
@ -558,6 +815,50 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base)
/* JPEG-2000 codestream */
// [SL:KB] - Patch: Viewer-OpenJPEG2 | Checked: Catznip-5.3
#ifdef OPENJPEG2
/* get a decoder handle */
opj_codec_t* opj_decoder_p = opj_create_decompress(OPJ_CODEC_J2K);
/* catch events using our callbacks and give a local context */
opj_set_error_handler(opj_decoder_p, error_callback, 0);
opj_set_warning_handler(opj_decoder_p, warning_callback, 0);
opj_set_info_handler(opj_decoder_p, info_callback, 0);
/* setup the decoder decoding parameters using user parameters */
bool fSuccess = opj_setup_decoder(opj_decoder_p, &parameters);
if (!fSuccess)
{
opj_destroy_codec(opj_decoder_p);
LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL;
return false;
}
/* open a byte stream */
LLJp2StreamReader streamReader(&base);
opj_stream_t* opj_stream_p = opj_stream_default_create(OPJ_STREAM_READ);
opj_stream_set_read_function(opj_stream_p, LLJp2StreamReader::readStream);
opj_stream_set_skip_function(opj_stream_p, LLJp2StreamReader::skipStream);
opj_stream_set_seek_function(opj_stream_p, LLJp2StreamReader::seekStream);
opj_stream_set_user_data(opj_stream_p, &streamReader, nullptr);
opj_stream_set_user_data_length(opj_stream_p, base.getDataSize());
/* decode the stream and fill the image structure */
fSuccess = opj_read_header(opj_stream_p, opj_decoder_p, &image);
if (!fSuccess)
{
opj_stream_destroy(opj_stream_p);
opj_destroy_codec(opj_decoder_p);
LL_WARNS() << "ERROR -> getMetadata: failed to decode image!" << LL_ENDL;
return false;
}
/* close the byte stream */
opj_stream_destroy(opj_stream_p);
/* free remaining structures */
opj_destroy_codec(opj_decoder_p);
#else
/* get a decoder handle */
dinfo = opj_create_decompress(CODEC_J2K);
@ -581,6 +882,8 @@ bool LLImageJ2COJ::getMetadata(LLImageJ2C &base)
{
opj_destroy_decompress(dinfo);
}
#endif
// [/SL:KB]
if(!image)
{

View File

@ -41,7 +41,7 @@
/// Exported functions
///----------------------------------------------------------------------------
static const std::string INV_ITEM_ID_LABEL("item_id");
static const std::string INV_FOLDER_ID_LABEL("folder_id");
static const std::string INV_FOLDER_ID_LABEL("cat_id");
static const std::string INV_PARENT_ID_LABEL("parent_id");
static const std::string INV_ASSET_TYPE_LABEL("type");
static const std::string INV_PREFERRED_TYPE_LABEL("preferred_type");
@ -228,22 +228,6 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
return TRUE;
}
// exportFile should be replaced with exportLegacyStream
// not sure whether exportLegacyStream(llofstream(fp)) would work, fp may need to get icramented...
BOOL LLInventoryObject::exportFile(LLFILE* fp, BOOL) const
{
std::string uuid_str;
fprintf(fp, "\tinv_object\t0\n\t{\n");
mUUID.toString(uuid_str);
fprintf(fp, "\t\tobj_id\t%s\n", uuid_str.c_str());
mParentUUID.toString(uuid_str);
fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
fprintf(fp,"\t}\n");
return TRUE;
}
BOOL LLInventoryObject::exportLegacyStream(std::ostream& output_stream, BOOL) const
{
std::string uuid_str;
@ -681,243 +665,6 @@ int splitCacheLine( char *aBuffer, char *&aKeyword, char *&aValue )
}
// </FS:ND>
// virtual
BOOL LLInventoryItem::importFile(LLFILE* fp)
{
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[MAX_STRING]; /* Flawfinder: ignore */
// <FS:ND> - cache speedups
//char keyword[MAX_STRING]; /* Flawfinder: ignore */
//char valuestr[MAX_STRING]; /* Flawfinder: ignore */
//char junk[MAX_STRING]; /* Flawfinder: ignore */
//keyword[0] = '\0';
//valuestr[0] = '\0'
char *keyword; /* Flawfinder: ignore */
char *valuestr; /* Flawfinder: ignore */
char *junk; /* Flawfinder: ignore */
// </FS:ND>
BOOL success = TRUE;
mInventoryType = LLInventoryType::IT_NONE;
mAssetUUID.setNull();
while(success && (!feof(fp)))
{
if (fgets(buffer, MAX_STRING, fp) == NULL)
{
buffer[0] = '\0';
}
//sscanf(buffer, " %254s %254s", keyword, valuestr); /* Flawfinder: ignore */
//if(0 == strcmp("{",keyword))
int nKWLen = splitCacheLine( buffer, keyword, valuestr );
if( !nKWLen )
continue;
if( sizeof("{")-1 == nKWLen && 0 == strcmp("{",keyword))
{
continue;
}
//if(0 == strcmp("}", keyword))
if( sizeof("}")-1 == nKWLen && 0 == strcmp("}", keyword))
{
break;
}
else if( sizeof("item_id")-1 == nKWLen && 0 == strcmp("item_id", keyword))
{
mUUID.set(valuestr);
}
//else if(0 == strcmp("parent_id", keyword))
else if( sizeof("parent_id")-1 == nKWLen && 0 == strcmp("parent_id", keyword))
{
mParentUUID.set(valuestr);
}
//else if(0 == strcmp("permissions", keyword))
else if( sizeof("permissions" )-1 == nKWLen && 0 == strcmp("permissions", keyword))
{
success = mPermissions.importFile(fp);
}
//else if(0 == strcmp("sale_info", keyword))
else if(sizeof("sale_info")-1 == nKWLen && 0 == strcmp("sale_info", keyword))
{
// Sale info used to contain next owner perm. It is now in
// the permissions. Thus, we read that out, and fix legacy
// objects. It's possible this op would fail, but it
// should pick up the vast majority of the tasks.
BOOL has_perm_mask = FALSE;
U32 perm_mask = 0;
success = mSaleInfo.importFile(fp, has_perm_mask, perm_mask);
if(has_perm_mask)
{
if(perm_mask == PERM_NONE)
{
perm_mask = mPermissions.getMaskOwner();
}
// fair use fix.
if(!(perm_mask & PERM_COPY))
{
perm_mask |= PERM_TRANSFER;
}
mPermissions.setMaskNext(perm_mask);
}
}
//else if(0 == strcmp("shadow_id", keyword))
else if( sizeof("shadow_id")-1 == nKWLen && 0 == strcmp("shadow_id", keyword))
{
mAssetUUID.set(valuestr);
LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
cipher.decrypt(mAssetUUID.mData, UUID_BYTES);
}
//else if(0 == strcmp("asset_id", keyword))
else if( sizeof("asset_id")-1 == nKWLen && 0 == strcmp("asset_id", keyword))
{
mAssetUUID.set(valuestr);
}
//else if(0 == strcmp("type", keyword))
else if( sizeof("type")-1 == nKWLen && 0 == strcmp("type", keyword))
{
mType = LLAssetType::lookup(valuestr);
}
//else if(0 == strcmp("inv_type", keyword))
else if( sizeof("inv_type")-1 == nKWLen && 0 == strcmp("inv_type", keyword))
{
mInventoryType = LLInventoryType::lookup(std::string(valuestr));
}
//else if(0 == strcmp("flags", keyword))
else if( sizeof("flags")-1 == nKWLen && 0 == strcmp("flags", keyword))
{
//sscanf(valuestr, "%x", &mFlags);
mFlags = strtol( valuestr, 0, 16 );
}
//else if(0 == strcmp("name", keyword))
else if( sizeof("name")-1 == nKWLen && 0 == strcmp("name", keyword))
{
//strcpy(valuestr, buffer + strlen(keyword) + 3);
// *NOTE: Not ANSI C, but widely supported.
// sscanf( /* Flawfinder: ignore */
// buffer,
// " %254s%254[\t]%254[^|]",
// keyword, junk, valuestr);
splitCacheDescOrName( valuestr, junk, valuestr );
// // IW: sscanf chokes and puts | in valuestr if there's no name
// if (valuestr[0] == '|')
// {
// valuestr[0] = '\000';
// }
mName.assign(valuestr);
LLStringUtil::replaceNonstandardASCII(mName, ' ');
LLStringUtil::replaceChar(mName, '|', ' ');
}
//else if(0 == strcmp("desc", keyword))
else if( sizeof("desc")-1 == nKWLen && 0 == strcmp("desc", keyword))
{
//strcpy(valuestr, buffer + strlen(keyword) + 3);
// *NOTE: Not ANSI C, but widely supported.
// sscanf( /* Flawfinder: ignore */
// buffer,
// " %254s%254[\t]%254[^|]",
// keyword, junk, valuestr);
splitCacheDescOrName( valuestr, junk, valuestr );
// if (valuestr[0] == '|')
// {
// valuestr[0] = '\000';
// }
disclaimMem(mDescription);
mDescription.assign(valuestr);
claimMem(mDescription);
LLStringUtil::replaceNonstandardASCII(mDescription, ' ');
/* TODO -- ask Ian about this code
const char *donkey = mDescription.c_str();
if (donkey[0] == '|')
{
LL_ERRS() << "Donkey" << LL_ENDL;
}
*/
}
//else if(0 == strcmp("creation_date", keyword))
else if( sizeof("creation_date")-1 == nKWLen && 0 == strcmp("creation_date", keyword))
{
//S32 date;
//sscanf(valuestr, "%d", &date);
//mCreationDate = date;
mCreationDate = atoi(valuestr);
}
else
{
LL_WARNS() << "unknown keyword '" << keyword
<< "' in inventory import of item " << mUUID << LL_ENDL;
}
}
// Need to convert 1.0 simstate files to a useful inventory type
// and potentially deal with bad inventory tyes eg, a landmark
// marked as a texture.
if((LLInventoryType::IT_NONE == mInventoryType)
|| !inventory_and_asset_types_match(mInventoryType, mType))
{
LL_DEBUGS() << "Resetting inventory type for " << mUUID << LL_ENDL;
mInventoryType = LLInventoryType::defaultForAssetType(mType);
}
mPermissions.initMasks(mInventoryType);
return success;
}
BOOL LLInventoryItem::exportFile(LLFILE* fp, BOOL include_asset_key) const
{
std::string uuid_str;
fprintf(fp, "\tinv_item\t0\n\t{\n");
mUUID.toString(uuid_str);
fprintf(fp, "\t\titem_id\t%s\n", uuid_str.c_str());
mParentUUID.toString(uuid_str);
fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
mPermissions.exportFile(fp);
// Check for permissions to see the asset id, and if so write it
// out as an asset id. Otherwise, apply our cheesy encryption.
if(include_asset_key)
{
U32 mask = mPermissions.getMaskBase();
if(((mask & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED)
|| (mAssetUUID.isNull()))
{
mAssetUUID.toString(uuid_str);
fprintf(fp, "\t\tasset_id\t%s\n", uuid_str.c_str());
}
else
{
LLUUID shadow_id(mAssetUUID);
LLXORCipher cipher(MAGIC_ID.mData, UUID_BYTES);
cipher.encrypt(shadow_id.mData, UUID_BYTES);
shadow_id.toString(uuid_str);
fprintf(fp, "\t\tshadow_id\t%s\n", uuid_str.c_str());
}
}
else
{
LLUUID::null.toString(uuid_str);
fprintf(fp, "\t\tasset_id\t%s\n", uuid_str.c_str());
}
fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
const std::string inv_type_str = LLInventoryType::lookup(mInventoryType);
if(!inv_type_str.empty()) fprintf(fp, "\t\tinv_type\t%s\n", inv_type_str.c_str());
fprintf(fp, "\t\tflags\t%08x\n", mFlags);
mSaleInfo.exportFile(fp);
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
fprintf(fp, "\t\tdesc\t%s|\n", mDescription.c_str());
fprintf(fp, "\t\tcreation_date\t%d\n", (S32) mCreationDate);
fprintf(fp,"\t}\n");
return TRUE;
}
// virtual
BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream)
{
@ -1569,90 +1316,7 @@ void LLInventoryCategory::unpackMessage(LLMessageSystem* msg,
msg->getStringFast(block, _PREHASH_Name, mName, block_num);
LLStringUtil::replaceNonstandardASCII(mName, ' ');
}
// virtual
BOOL LLInventoryCategory::importFile(LLFILE* fp)
{
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[MAX_STRING]; /* Flawfinder: ignore */
char keyword[MAX_STRING]; /* Flawfinder: ignore */
char valuestr[MAX_STRING]; /* Flawfinder: ignore */
keyword[0] = '\0';
valuestr[0] = '\0';
while(!feof(fp))
{
if (fgets(buffer, MAX_STRING, fp) == NULL)
{
buffer[0] = '\0';
}
sscanf( /* Flawfinder: ignore */
buffer,
" %254s %254s",
keyword, valuestr);
if(0 == strcmp("{",keyword))
{
continue;
}
if(0 == strcmp("}", keyword))
{
break;
}
else if(0 == strcmp("cat_id", keyword))
{
mUUID.set(valuestr);
}
else if(0 == strcmp("parent_id", keyword))
{
mParentUUID.set(valuestr);
}
else if(0 == strcmp("type", keyword))
{
mType = LLAssetType::lookup(valuestr);
}
else if(0 == strcmp("pref_type", keyword))
{
mPreferredType = LLFolderType::lookup(valuestr);
}
else if(0 == strcmp("name", keyword))
{
//strcpy(valuestr, buffer + strlen(keyword) + 3);
// *NOTE: Not ANSI C, but widely supported.
sscanf( /* Flawfinder: ignore */
buffer,
" %254s %254[^|]",
keyword, valuestr);
mName.assign(valuestr);
LLStringUtil::replaceNonstandardASCII(mName, ' ');
LLStringUtil::replaceChar(mName, '|', ' ');
}
else
{
LL_WARNS() << "unknown keyword '" << keyword
<< "' in inventory import category " << mUUID << LL_ENDL;
}
}
return TRUE;
}
BOOL LLInventoryCategory::exportFile(LLFILE* fp, BOOL) const
{
std::string uuid_str;
fprintf(fp, "\tinv_category\t0\n\t{\n");
mUUID.toString(uuid_str);
fprintf(fp, "\t\tcat_id\t%s\n", uuid_str.c_str());
mParentUUID.toString(uuid_str);
fprintf(fp, "\t\tparent_id\t%s\n", uuid_str.c_str());
fprintf(fp, "\t\ttype\t%s\n", LLAssetType::lookup(mType));
fprintf(fp, "\t\tpref_type\t%s\n", LLFolderType::lookup(mPreferredType).c_str());
fprintf(fp, "\t\tname\t%s|\n", mName.c_str());
fprintf(fp,"\t}\n");
return TRUE;
}
// virtual
BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream)
{
@ -1731,6 +1395,45 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL)
return TRUE;
}
LLSD LLInventoryCategory::exportLLSD() const
{
LLSD cat_data;
cat_data[INV_FOLDER_ID_LABEL] = mUUID;
cat_data[INV_PARENT_ID_LABEL] = mParentUUID;
cat_data[INV_ASSET_TYPE_LABEL] = LLAssetType::lookup(mType);
cat_data[INV_PREFERRED_TYPE_LABEL] = LLFolderType::lookup(mPreferredType);
cat_data[INV_NAME_LABEL] = mName;
return cat_data;
}
bool LLInventoryCategory::importLLSD(const LLSD& cat_data)
{
if (cat_data.has(INV_FOLDER_ID_LABEL))
{
setUUID(cat_data[INV_FOLDER_ID_LABEL].asUUID());
}
if (cat_data.has(INV_PARENT_ID_LABEL))
{
setParent(cat_data[INV_PARENT_ID_LABEL].asUUID());
}
if (cat_data.has(INV_ASSET_TYPE_LABEL))
{
setType(LLAssetType::lookup(cat_data[INV_ASSET_TYPE_LABEL].asString()));
}
if (cat_data.has(INV_PREFERRED_TYPE_LABEL))
{
setPreferredType(LLFolderType::lookup(cat_data[INV_PREFERRED_TYPE_LABEL].asString()));
}
if (cat_data.has(INV_NAME_LABEL))
{
mName = cat_data[INV_NAME_LABEL].asString();
LLStringUtil::replaceNonstandardASCII(mName, ' ');
LLStringUtil::replaceChar(mName, '|', ' ');
}
return true;
}
///----------------------------------------------------------------------------
/// Local function definitions
///----------------------------------------------------------------------------

View File

@ -95,8 +95,7 @@ public:
// Implemented here so that a minimal information set can be transmitted
// between simulator and viewer.
//--------------------------------------------------------------------
// virtual BOOL importFile(LLFILE* fp);
virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const;
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
@ -197,8 +196,6 @@ public:
// File Support
//--------------------------------------------------------------------
public:
virtual BOOL importFile(LLFILE* fp);
virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const;
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
@ -269,11 +266,11 @@ public:
// File Support
//--------------------------------------------------------------------
public:
virtual BOOL importFile(LLFILE* fp);
virtual BOOL exportFile(LLFILE* fp, BOOL include_asset_key = TRUE) const;
virtual BOOL importLegacyStream(std::istream& input_stream);
virtual BOOL exportLegacyStream(std::ostream& output_stream, BOOL include_asset_key = TRUE) const;
LLSD exportLLSD() const;
bool importLLSD(const LLSD& cat_data);
//--------------------------------------------------------------------
// Member Variables
//--------------------------------------------------------------------

View File

@ -33,10 +33,6 @@
#include "llsingleton.h"
#include "llinvtranslationbrdg.h"
//=========================================================================
namespace {
LLTranslationBridge::ptr_t sTranslator;
}
//=========================================================================
struct SettingsEntry : public LLDictionaryEntry
@ -49,14 +45,14 @@ struct SettingsEntry : public LLDictionaryEntry
mLabel(name),
mIconName(iconName)
{
std::string transdname = sTranslator->getString(mLabel);
std::string transdname = LLSettingsType::getInstance()->mTranslator->getString(mLabel);
if (!transdname.empty())
{
mLabel = transdname;
}
// <FS:Ansariel> Name of newly created setting is not translated
transdname = sTranslator->getString(mDefaultNewName);
transdname = LLSettingsType::getInstance()->mTranslator->getString(mDefaultNewName);
if (!transdname.empty())
{
mDefaultNewName = transdname;
@ -92,6 +88,16 @@ void LLSettingsDictionary::initSingleton()
//=========================================================================
LLSettingsType::LLSettingsType(LLTranslationBridge::ptr_t &trans)
{
mTranslator = trans;
}
LLSettingsType::~LLSettingsType()
{
mTranslator.reset();
}
LLSettingsType::type_e LLSettingsType::fromInventoryFlags(U32 flags)
{
return (LLSettingsType::type_e)(flags & LLInventoryItemFlags::II_FLAGS_SUBTYPE_MASK);
@ -112,13 +118,3 @@ std::string LLSettingsType::getDefaultName(LLSettingsType::type_e type)
return getDefaultName(ST_INVALID);
return entry->mDefaultNewName;
}
void LLSettingsType::initClass(LLTranslationBridge::ptr_t &trans)
{
sTranslator = trans;
}
void LLSettingsType::cleanupClass()
{
sTranslator.reset();
}

View File

@ -30,9 +30,15 @@
#include "llinventorytype.h"
#include "llinvtranslationbrdg.h"
#include "llsingleton.h"
class LLSettingsType
class LLSettingsType : public LLParamSingleton<LLSettingsType>
{
LLSINGLETON(LLSettingsType, LLTranslationBridge::ptr_t &trans);
~LLSettingsType();
friend struct SettingsEntry;
public:
enum type_e
{
@ -48,8 +54,9 @@ public:
static LLInventoryType::EIconName getIconName(type_e type);
static std::string getDefaultName(type_e type);
static void initClass(LLTranslationBridge::ptr_t &trans);
static void cleanupClass();
protected:
LLTranslationBridge::ptr_t mTranslator;
};

View File

@ -565,153 +565,6 @@ void LLPermissions::unpackMessage(LLMessageSystem* msg, const char* block, S32 b
}
//
// File support
//
// <FS:ND>
void splitCacheDescOrName( char *aBuffer, char *&aJunk, char *&aValue );
int splitCacheLine( char *aBuffer, char *&aKeyword, char *&aValue );
// </FS:ND>
BOOL LLPermissions::importFile(LLFILE* fp)
{
init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);
const S32 BUFSIZE = 16384;
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[BUFSIZE]; /* Flawfinder: ignore */
char keyword[256]; /* Flawfinder: ignore */
char valuestr[256]; /* Flawfinder: ignore */
char uuid_str[256]; /* Flawfinder: ignore */
U32 mask;
keyword[0] = '\0';
valuestr[0] = '\0';
while (!feof(fp))
{
if (fgets(buffer, BUFSIZE, fp) == NULL)
{
buffer[0] = '\0';
}
sscanf( /* Flawfinder: ignore */
buffer,
" %255s %255s",
keyword, valuestr);
if (!strcmp("{", keyword))
{
continue;
}
if (!strcmp("}",keyword))
{
break;
}
else if (!strcmp("creator_mask", keyword))
{
// legacy support for "creator" masks
sscanf(valuestr, "%x", &mask);
mMaskBase = mask;
fixFairUse();
}
else if (!strcmp("base_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskBase = mask;
//fixFairUse();
}
else if (!strcmp("owner_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskOwner = mask;
}
else if (!strcmp("group_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskGroup = mask;
}
else if (!strcmp("everyone_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskEveryone = mask;
}
else if (!strcmp("next_owner_mask", keyword))
{
sscanf(valuestr, "%x", &mask);
mMaskNextOwner = mask;
}
else if (!strcmp("creator_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mCreator.set(uuid_str);
}
else if (!strcmp("owner_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mOwner.set(uuid_str);
}
else if (!strcmp("last_owner_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mLastOwner.set(uuid_str);
}
else if (!strcmp("group_id", keyword))
{
sscanf(valuestr, "%255s", uuid_str); /* Flawfinder: ignore */
mGroup.set(uuid_str);
}
else if (!strcmp("group_owned", keyword))
{
sscanf(valuestr, "%d", &mask);
if(mask) mIsGroupOwned = true;
else mIsGroupOwned = false;
}
else
{
LL_INFOS() << "unknown keyword " << keyword << " in permissions import" << LL_ENDL;
}
}
fix();
return TRUE;
}
BOOL LLPermissions::exportFile(LLFILE* fp) const
{
std::string uuid_str;
fprintf(fp, "\tpermissions 0\n");
fprintf(fp, "\t{\n");
fprintf(fp, "\t\tbase_mask\t%08x\n", mMaskBase);
fprintf(fp, "\t\towner_mask\t%08x\n", mMaskOwner);
fprintf(fp, "\t\tgroup_mask\t%08x\n", mMaskGroup);
fprintf(fp, "\t\teveryone_mask\t%08x\n", mMaskEveryone);
fprintf(fp, "\t\tnext_owner_mask\t%08x\n", mMaskNextOwner);
mCreator.toString(uuid_str);
fprintf(fp, "\t\tcreator_id\t%s\n", uuid_str.c_str());
mOwner.toString(uuid_str);
fprintf(fp, "\t\towner_id\t%s\n", uuid_str.c_str());
mLastOwner.toString(uuid_str);
fprintf(fp, "\t\tlast_owner_id\t%s\n", uuid_str.c_str());
mGroup.toString(uuid_str);
fprintf(fp, "\t\tgroup_id\t%s\n", uuid_str.c_str());
if(mIsGroupOwned)
{
fprintf(fp, "\t\tgroup_owned\t1\n");
}
fprintf(fp,"\t}\n");
return TRUE;
}
BOOL LLPermissions::importLegacyStream(std::istream& input_stream)
{
init(LLUUID::null, LLUUID::null, LLUUID::null, LLUUID::null);

View File

@ -312,10 +312,6 @@ public:
void packMessage(LLMessageSystem* msg) const;
void unpackMessage(LLMessageSystem* msg, const char* block, S32 block_num = 0);
// Load/save support
BOOL importFile(LLFILE* fp);
BOOL exportFile(LLFILE* fp) const;
BOOL importLegacyStream(std::istream& input_stream);
BOOL exportLegacyStream(std::ostream& output_stream) const;

View File

@ -78,16 +78,6 @@ U32 LLSaleInfo::getCRC32() const
return rv;
}
BOOL LLSaleInfo::exportFile(LLFILE* fp) const
{
fprintf(fp, "\tsale_info\t0\n\t{\n");
fprintf(fp, "\t\tsale_type\t%s\n", lookup(mSaleType));
fprintf(fp, "\t\tsale_price\t%d\n", mSalePrice);
fprintf(fp,"\t}\n");
return TRUE;
}
BOOL LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
{
output_stream << "\tsale_info\t0\n\t{\n";
@ -129,69 +119,6 @@ bool LLSaleInfo::fromLLSD(const LLSD& sd, BOOL& has_perm_mask, U32& perm_mask)
return true;
}
// Deleted LLSaleInfo::exportFileXML() and LLSaleInfo::importXML()
// because I can't find any non-test code references to it. 2009-05-04 JC
BOOL LLSaleInfo::importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask)
{
has_perm_mask = FALSE;
// *NOTE: Changing the buffer size will require changing the scanf
// calls below.
char buffer[MAX_STRING]; /* Flawfinder: ignore */
char keyword[MAX_STRING]; /* Flawfinder: ignore */
char valuestr[MAX_STRING]; /* Flawfinder: ignore */
BOOL success = TRUE;
keyword[0] = '\0';
valuestr[0] = '\0';
while(success && (!feof(fp)))
{
if (fgets(buffer, MAX_STRING, fp) == NULL)
{
buffer[0] = '\0';
}
sscanf( /* Flawfinder: ignore */
buffer,
" %254s %254s",
keyword, valuestr);
if(!keyword[0])
{
continue;
}
if(0 == strcmp("{",keyword))
{
continue;
}
if(0 == strcmp("}", keyword))
{
break;
}
else if(0 == strcmp("sale_type", keyword))
{
mSaleType = lookup(valuestr);
}
else if(0 == strcmp("sale_price", keyword))
{
sscanf(valuestr, "%d", &mSalePrice);
mSalePrice = llclamp(mSalePrice, 0, S32_MAX);
}
else if (!strcmp("perm_mask", keyword))
{
//LL_INFOS() << "found deprecated keyword perm_mask" << LL_ENDL;
has_perm_mask = TRUE;
sscanf(valuestr, "%x", &perm_mask);
}
else
{
LL_WARNS() << "unknown keyword '" << keyword
<< "' in sale info import" << LL_ENDL;
}
}
return success;
}
BOOL LLSaleInfo::importLegacyStream(std::istream& input_stream, BOOL& has_perm_mask, U32& perm_mask)
{
has_perm_mask = FALSE;

View File

@ -84,11 +84,6 @@ public:
void setSalePrice(S32 price);
//void setNextOwnerPermMask(U32 mask) { mNextOwnerPermMask = mask; }
// file serialization
BOOL exportFile(LLFILE* fp) const;
BOOL importFile(LLFILE* fp, BOOL& has_perm_mask, U32& perm_mask);
BOOL exportLegacyStream(std::ostream& output_stream) const;
LLSD asLLSD() const;
operator LLSD() const { return asLLSD(); }

View File

@ -359,7 +359,6 @@ protected:
virtual parammapping_t getParameterMap() const { return parammapping_t(); }
LLSD mSettings;
bool mIsValid;
LLSD cloneSettings() const;

View File

@ -28,9 +28,9 @@
#include "linden_common.h"
#include "llsd.h"
#include "llsdserialize.h"
#include "../llinventory.h"
#include "../test/lltut.h"
@ -320,27 +320,39 @@ namespace tut
template<> template<>
void inventory_object::test<7>()
{
LLFILE* fp = LLFile::fopen("linden_file.dat","w+");
if(!fp)
std::string filename("linden_file.dat");
llofstream fileXML(filename.c_str());
if (!fileXML.is_open())
{
LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
LLPointer<LLInventoryItem> src1 = create_random_inventory_item();
src1->exportFile(fp, TRUE);
fclose(fp);
fileXML << LLSDOStreamer<LLSDNotationFormatter>(src1->asLLSD()) << std::endl;
fileXML.close();
LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
fp = LLFile::fopen("linden_file.dat","r+");
if(!fp)
LLPointer<LLInventoryItem> src2 = new LLInventoryItem();
llifstream file(filename.c_str());
if (!file.is_open())
{
LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
src2->importFile(fp);
fclose(fp);
std::string line;
LLPointer<LLSDParser> parser = new LLSDNotationParser();
std::getline(file, line);
LLSD s_item;
std::istringstream iss(line);
if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE)
{
LL_ERRS()<< "Parsing cache failed" << LL_ENDL;
return;
}
src2->fromLLSD(s_item);
file.close();
ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());
@ -457,27 +469,39 @@ namespace tut
template<> template<>
void inventory_object::test<13>()
{
LLFILE* fp = LLFile::fopen("linden_file.dat","w");
if(!fp)
std::string filename("linden_file.dat");
llofstream fileXML(filename.c_str());
if (!fileXML.is_open())
{
LL_ERRS() << "file coudnt be opened\n" << LL_ENDL;
LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
LLPointer<LLInventoryCategory> src1 = create_random_inventory_cat();
src1->exportFile(fp, TRUE);
fclose(fp);
LLPointer<LLInventoryCategory> src2 = new LLInventoryCategory();
fp = LLFile::fopen("linden_file.dat","r");
if(!fp)
LLPointer<LLInventoryCategory> src1 = create_random_inventory_cat();
fileXML << LLSDOStreamer<LLSDNotationFormatter>(src1->exportLLSD()) << std::endl;
fileXML.close();
llifstream file(filename.c_str());
if (!file.is_open())
{
LL_ERRS() << "file coudnt be opened\n" << LL_ENDL;
LL_ERRS() << "file could not be opened\n" << LL_ENDL;
return;
}
src2->importFile(fp);
fclose(fp);
std::string line;
LLPointer<LLSDParser> parser = new LLSDNotationParser();
std::getline(file, line);
LLSD s_item;
std::istringstream iss(line);
if (parser->parse(iss, s_item, line.length()) == LLSDParser::PARSE_FAILURE)
{
LL_ERRS()<< "Parsing cache failed" << LL_ENDL;
return;
}
file.close();
LLPointer<LLInventoryCategory> src2 = new LLInventoryCategory();
src2->importLLSD(s_item);
ensure_equals("1.item id::getUUID() failed", src1->getUUID(), src2->getUUID());
ensure_equals("2.parent::getParentUUID() failed", src1->getParentUUID(), src2->getParentUUID());

View File

@ -21,6 +21,7 @@
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-field"
#pragma clang diagnostic ignored "-Wunused-private-field"
#pragma clang diagnostic ignored "-Woverloaded-virtual" //<FS:TS> Silence Clang warning the flag doesn't for some reason
#include kdu_xxxx
#pragma clang diagnostic pop
#elif LL_WINDOWS

View File

@ -32,7 +32,9 @@
//
// KDU core header files
//
#ifndef LL_WINDOWS
#define KDU_NO_THREADS
#endif
#include "kdu_elementary.h"
#include "kdu_messaging.h"

View File

@ -27,14 +27,10 @@
#ifndef LL_LLKDUMEM_H
#define LL_LLKDUMEM_H
//<FS:TS> Silence Clang warning the flag doesn't for some reason
#if __clang__
#pragma clang diagnostic ignored "-Woverloaded-virtual"
#endif
//</FS:TS>
// Support classes for reading and writing from memory buffers in KDU
#ifndef LL_WINDOWS
#define KDU_NO_THREADS
#endif
#define kdu_xxxx "kdu_image.h"
#include "include_kdu_xxxx.h"

View File

@ -360,7 +360,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced
}
// The queue should never fill up.
LL_ERRS("CoProcMgr") << "Enqueue failed (" << unsigned(pushed) << ")" << LL_ENDL;
LL_ERRS("CoProcMgr") << "Enqueue into '" << name << "' failed (" << unsigned(pushed) << ")" << LL_ENDL;
return {}; // never executed, pacify the compiler
}

View File

@ -863,12 +863,12 @@ void LLPluginClassMedia::paste()
}
void LLPluginClassMedia::setUserDataPath(const std::string &user_data_path_cache,
const std::string &user_data_path_cookies,
const std::string &username,
const std::string &user_data_path_cef_log)
{
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_user_data_path");
message.setValue("cache_path", user_data_path_cache);
message.setValue("cookies_path", user_data_path_cookies);
message.setValue("cache_path", user_data_path_cache);
message.setValue("username", username); // cef shares cache between users but creates user-based contexts
message.setValue("cef_log_file", user_data_path_cef_log);
bool cef_verbose_log = gSavedSettings.getBOOL("CefVerboseLog");

View File

@ -195,7 +195,7 @@ public:
bool canPaste() const { return mCanPaste; };
// These can be called before init(), and they will be queued and sent before the media init message.
void setUserDataPath(const std::string &user_data_path_cache, const std::string &user_data_path_cookies, const std::string &user_data_path_cef_log);
void setUserDataPath(const std::string &user_data_path_cache, const std::string &username, const std::string &user_data_path_cef_log);
void setLanguageCode(const std::string &language_code);
void setPluginsEnabled(const bool enabled);
void setJavascriptEnabled(const bool enabled);

View File

@ -225,6 +225,18 @@ void LLPluginProcessChild::idle(void)
}
setState(STATE_UNLOADED);
}
if (mInstance)
{
// Provide some time to the plugin
// example: CEF on "cleanup" sets shutdown request, but it still needs idle loop to actually shutdown
LLPluginMessage message("base", "idle");
message.setValueReal("time", PLUGIN_IDLE_SECONDS);
sendMessageToPlugin(message);
mInstance->idle();
}
break;
case STATE_UNLOADED:

View File

@ -2705,9 +2705,10 @@ LLGLSPipelineBlendSkyBox::LLGLSPipelineBlendSkyBox(bool depth_test, bool depth_w
}
#if LL_WINDOWS
// Expose desired use of high-performance graphics processor to Optimus driver
// Expose desired use of high-performance graphics processor to Optimus driver and to AMD driver
extern "C"
{
_declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
{
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif

View File

@ -1394,6 +1394,15 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S
return FALSE;
}
if (mHasExplicitFormat &&
((mFormatPrimary == GL_RGBA && mComponents < 4) ||
(mFormatPrimary == GL_RGB && mComponents < 3)))
{
LL_WARNS() << "Incorrect format: " << std::hex << mFormatPrimary << " components: " << (U32)mComponents << LL_ENDL;
mHasExplicitFormat = FALSE;
}
if( !mHasExplicitFormat )
{
switch (mComponents)

View File

@ -136,6 +136,7 @@ public:
S32 getMipBytes(S32 discard_level = -1) const;
BOOL getBoundRecently() const;
BOOL isJustBound() const;
BOOL getHasExplicitFormat() const { return mHasExplicitFormat; }
LLGLenum getPrimaryFormat() const { return mFormatPrimary; }
LLGLenum getFormatType() const { return mFormatType; }
@ -203,7 +204,7 @@ private:
U16 mPickMaskWidth;
U16 mPickMaskHeight;
S8 mUseMipMaps;
S8 mHasExplicitFormat; // If false (default), GL format is f(mComponents)
BOOL mHasExplicitFormat; // If false (default), GL format is f(mComponents)
S8 mAutoGenMips;
BOOL mIsMask;

View File

@ -1096,7 +1096,12 @@ LLRender::LLRender()
//mQuadCycle(0), // <FS:Ansariel> Remove QUADS rendering mode
mMode(LLRender::TRIANGLES),
mCurrTextureUnitIndex(0),
mMaxAnisotropy(0.f)
mMaxAnisotropy(0.f),
mLineWidth(1.f), // <FS> Line width OGL core profile fix by Rye Mutt
// <FS:Ansariel> Don't ignore OpenGL max line width
mMaxLineWidthSmooth(1.f),
mMaxLineWidthAliased(1.f)
// </FS:Ansariel>
{
mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS);
for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++)
@ -1162,6 +1167,16 @@ void LLRender::init()
initVB();
// </FS:Ansariel>
stop_glerror();
// <FS:Ansariel> Don't ignore OpenGL max line width
GLint range[2];
glGetIntegerv(GL_ALIASED_LINE_WIDTH_RANGE, range);
stop_glerror();
mMaxLineWidthAliased = F32(range[1]);
glGetIntegerv(GL_SMOOTH_LINE_WIDTH_RANGE, range);
stop_glerror();
mMaxLineWidthSmooth = F32(range[1]);
// </FS:Ansariel>
}
void LLRender::shutdown()
@ -1888,6 +1903,29 @@ void LLRender::setAmbientLightColor(const LLColor4& color)
}
}
// <FS> Line width OGL core profile fix by Rye Mutt
void LLRender::setLineWidth(F32 line_width)
{
if (LLRender::sGLCoreProfile)
{
line_width = 1.f;
}
else if (line_width > 1.f)
{
line_width = llmin(line_width, glIsEnabled(GL_LINE_SMOOTH) ? mMaxLineWidthSmooth : mMaxLineWidthAliased);
}
if (mLineWidth != line_width || mDirty)
{
if (mMode == LLRender::LINES || mMode == LLRender::LINE_STRIP)
{
flush();
}
mLineWidth = line_width;
glLineWidth(line_width);
}
}
// </FS>
bool LLRender::verifyTexUnitActive(U32 unitToVerify)
{
if (mCurrTextureUnitIndex == unitToVerify)

View File

@ -456,6 +456,8 @@ public:
LLLightState* getLight(U32 index);
void setAmbientLightColor(const LLColor4& color);
void setLineWidth(F32 line_width); // <FS> Line width OGL core profile fix by Rye Mutt
LLTexUnit* getTexUnit(U32 index);
U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; }
@ -499,6 +501,11 @@ private:
bool mCurrColorMask[4];
eCompareFunc mCurrAlphaFunc;
F32 mCurrAlphaFuncVal;
F32 mLineWidth; // <FS> Line width OGL core profile fix by Rye Mutt
// <FS:Ansariel> Don't ignore OpenGL max line width
F32 mMaxLineWidthSmooth;
F32 mMaxLineWidthAliased;
// </FS:Ansariel>
LLPointer<LLVertexBuffer> mBuffer;
LLStrider<LLVector3> mVerticesp;

View File

@ -972,7 +972,7 @@ void gl_stippled_line_3d( const LLVector3& start, const LLVector3& end, const LL
gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], color.mV[VALPHA]);
gGL.flush();
glLineWidth(2.5f);
gGL.setLineWidth(2.5f); // <FS> Line width OGL core profile fix by Rye Mutt
if (!LLGLSLShader::sNoFixedFunction)
{
@ -2072,8 +2072,10 @@ void LLRender2D::setScaleFactor(const LLVector2 &scale_factor)
void LLRender2D::setLineWidth(F32 width)
{
gGL.flush();
glLineWidth(width * lerp(mGLScaleFactor.mV[VX], mGLScaleFactor.mV[VY], 0.5f));
// <FS> Line width OGL core profile fix by Rye Mutt
//gGL.flush();
//glLineWidth(width * lerp(mGLScaleFactor.mV[VX], mGLScaleFactor.mV[VY], 0.5f));
gGL.setLineWidth(width * lerp(mGLScaleFactor.mV[VX], mGLScaleFactor.mV[VY], 0.5f));
}
LLPointer<LLUIImage> LLRender2D::getUIImageByID(const LLUUID& image_id, S32 priority)

View File

@ -1367,7 +1367,7 @@ bool LLVertexBuffer::createGLBuffer(U32 size)
return true;
}
bool sucsess = true;
bool success = true;
mEmpty = true;
@ -1389,9 +1389,9 @@ bool LLVertexBuffer::createGLBuffer(U32 size)
if (!mMappedData)
{
sucsess = false;
success = false;
}
return sucsess;
return success;
}
bool LLVertexBuffer::createGLIndices(U32 size)
@ -1406,7 +1406,7 @@ bool LLVertexBuffer::createGLIndices(U32 size)
return true;
}
bool sucsess = true;
bool success = true;
mEmpty = true;
@ -1431,9 +1431,9 @@ bool LLVertexBuffer::createGLIndices(U32 size)
if (!mMappedIndexData)
{
sucsess = false;
success = false;
}
return sucsess;
return success;
}
void LLVertexBuffer::destroyGLBuffer()
@ -1480,7 +1480,7 @@ bool LLVertexBuffer::updateNumVerts(S32 nverts)
{
llassert(nverts >= 0);
bool sucsess = true;
bool success = true;
if (nverts > 65536)
{
@ -1492,34 +1492,34 @@ bool LLVertexBuffer::updateNumVerts(S32 nverts)
if (needed_size > mSize || needed_size <= mSize/2)
{
sucsess &= createGLBuffer(needed_size);
success &= createGLBuffer(needed_size);
}
sVertexCount -= mNumVerts;
mNumVerts = nverts;
sVertexCount += mNumVerts;
return sucsess;
return success;
}
bool LLVertexBuffer::updateNumIndices(S32 nindices)
{
llassert(nindices >= 0);
bool sucsess = true;
bool success = true;
U32 needed_size = sizeof(U16) * nindices;
if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2)
{
sucsess &= createGLIndices(needed_size);
success &= createGLIndices(needed_size);
}
sIndexCount -= mNumIndices;
mNumIndices = nindices;
sIndexCount += mNumIndices;
return sucsess;
return success;
}
bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
@ -1532,10 +1532,10 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
LL_ERRS() << "Bad vertex buffer allocation: " << nverts << " : " << nindices << LL_ENDL;
}
bool sucsess = true;
bool success = true;
sucsess &= updateNumVerts(nverts);
sucsess &= updateNumIndices(nindices);
success &= updateNumVerts(nverts);
success &= updateNumIndices(nindices);
if (create && (nverts || nindices))
{
@ -1551,7 +1551,7 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create)
}
}
return sucsess;
return success;
}
static LLTrace::BlockTimerStatHandle FTM_SETUP_VERTEX_ARRAY("Setup VAO");

View File

@ -3424,6 +3424,22 @@ void LLFloaterView::setUtilityBarRect(LLLayoutPanel* panel, const LLRect& utilit
// Just assume right end of utility bar is always the border of the window
mUtilityBarRect.mRight = S32_MAX;
}
const LLRect& LLFloaterView::getToolbarRect(LLToolBarEnums::EToolBarLocation tb) const
{
switch (tb)
{
case LLToolBarEnums::TOOLBAR_LEFT:
return mToolbarLeftRect;
case LLToolBarEnums::TOOLBAR_BOTTOM:
return mToolbarBottomRect;
case LLToolBarEnums::TOOLBAR_RIGHT:
return mToolbarRightRect;
default:
LL_WARNS() << "getToolbarRect() passed odd toolbar number " << (S32) tb << LL_ENDL;
return LLRect::null;
}
}
// </FS:Ansariel>
void LLFloater::setInstanceName(const std::string& name)

View File

@ -629,6 +629,9 @@ public:
// <FS:Ansariel> Prevent floaters being dragged under main chat bar
void setMainChatbarRect(LLLayoutPanel* panel, const LLRect& chatbar_rect);
void setUtilityBarRect(LLLayoutPanel* panel, const LLRect& utility_bar_rect);
const LLRect& getMainChatbarRect() const { return mMainChatbarRect; }
const LLRect& getUtilityBarRect() const { return mUtilityBarRect; }
const LLRect& getToolbarRect(LLToolBarEnums::EToolBarLocation tb) const;
private:
void hiddenFloaterClosed(LLFloater* floater);

View File

@ -346,12 +346,9 @@ static LLTrace::BlockTimerStatHandle FTM_FILTER("Filter Folder View");
void LLFolderView::filter( LLFolderViewFilter& filter )
{
LL_RECORD_BLOCK_TIME(FTM_FILTER);
// <FS:Ansariel> Replace frequently called gSavedSettings
//filter.resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32(mParentPanel.get()->getVisible() ? "FilterItemsMaxTimePerFrameVisible" : "FilterItemsMaxTimePerFrameUnvisible"), 1, 100));
static LLCachedControl<S32> sFilterItemsMaxTimePerFrameVisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible");
static LLCachedControl<S32> sFilterItemsMaxTimePerFrameUnvisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible");
filter.resetTime(llclamp((mParentPanel.get()->getVisible() ? sFilterItemsMaxTimePerFrameVisible() : sFilterItemsMaxTimePerFrameUnvisible()), 1, 100));
// </FS:Ansariel>
static LLCachedControl<S32> filter_visible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10);
static LLCachedControl<S32> filter_hidden(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameUnvisible", 1);
filter.resetTime(llclamp(mParentPanel.get()->getVisible() ? filter_visible() : filter_hidden(), 1, 100));
// Note: we filter the model, not the view
getViewModelItem()->filter(filter);

View File

@ -129,6 +129,7 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
: LLView(p),
mLabelWidth(0),
mLabelWidthDirty(false),
mSuffixNeedsRefresh(false),
mLabelPaddingRight(DEFAULT_LABEL_PADDING_RIGHT),
mParentFolder( NULL ),
mIsSelected( FALSE ),
@ -200,11 +201,25 @@ LLFolderViewItem::~LLFolderViewItem()
BOOL LLFolderViewItem::postBuild()
{
refresh();
LLFolderViewModelItem& vmi = *getViewModelItem();
// getDisplayName() is expensive (due to internal getLabelSuffix() and name building)
// it also sets search strings so it requires a filter reset
mLabel = vmi.getDisplayName();
setToolTip(vmi.getName());
// Dirty the filter flag of the model from the view (CHUI-849)
vmi.dirtyFilter();
// Don't do full refresh on constructor if it is possible to avoid
// it significantly slows down bulk view creation.
// Todo: Ideally we need to move getDisplayName() out of constructor as well.
// Like: make a logic that will let filter update search string,
// while LLFolderViewItem::arrange() updates visual part
mSuffixNeedsRefresh = true;
mLabelWidthDirty = true;
return TRUE;
}
LLFolderView* LLFolderViewItem::getRoot()
{
return mRoot;
@ -299,24 +314,51 @@ BOOL LLFolderViewItem::isPotentiallyVisible(S32 filter_generation)
void LLFolderViewItem::refresh()
{
LLFolderViewModelItem& vmi = *getViewModelItem();
LLFolderViewModelItem& vmi = *getViewModelItem();
mLabel = vmi.getDisplayName();
mLabel = vmi.getDisplayName();
setToolTip(vmi.getName());
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
mIcon = vmi.getIcon();
mIconOpen = vmi.getIconOpen();
mIconOverlay = vmi.getIconOverlay();
setToolTip(vmi.getName());
mIcon = vmi.getIcon();
mIconOpen = vmi.getIconOpen();
mIconOverlay = vmi.getIconOverlay();
if (mRoot->useLabelSuffix())
{
// Very Expensive!
// Can do a number of expensive checks, like checking active motions, wearables or friend list
mLabelStyle = vmi.getLabelStyle();
mLabelSuffix = vmi.getLabelSuffix();
}
// Dirty the filter flag of the model from the view (CHUI-849)
vmi.dirtyFilter();
mLabelWidthDirty = true;
mSuffixNeedsRefresh = false;
}
void LLFolderViewItem::refreshSuffix()
{
LLFolderViewModelItem const* vmi = getViewModelItem();
// icons are slightly expensive to get, can be optimized
// see LLInventoryIcon::getIcon()
mIcon = vmi->getIcon();
mIconOpen = vmi->getIconOpen();
mIconOverlay = vmi->getIconOverlay();
if (mRoot->useLabelSuffix())
{
mLabelStyle = vmi.getLabelStyle();
mLabelSuffix = vmi.getLabelSuffix();
// Very Expensive!
// Can do a number of expensive checks, like checking active motions, wearables or friend list
mLabelStyle = vmi->getLabelStyle();
mLabelSuffix = vmi->getLabelSuffix();
}
mLabelWidthDirty = true;
// Dirty the filter flag of the model from the view (CHUI-849)
vmi.dirtyFilter();
mLabelWidthDirty = true;
mSuffixNeedsRefresh = false;
}
// Utility function for LLFolderView
@ -385,6 +427,12 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height )
if (mLabelWidthDirty)
{
if (mSuffixNeedsRefresh)
{
// Expensive. But despite refreshing label,
// it is purely visual, so it is fine to do at our laisure
refreshSuffix();
}
mLabelWidth = getLabelXPos() + getLabelFontForStyle(mLabelStyle)->getWidth(mLabel) + getLabelFontForStyle(mLabelStyle)->getWidth(mLabelSuffix) + mLabelPaddingRight;
mLabelWidthDirty = false;
}

View File

@ -99,6 +99,7 @@ protected:
LLPointer<LLFolderViewModelItem> mViewModelItem;
LLFontGL::StyleFlags mLabelStyle;
std::string mLabelSuffix;
bool mSuffixNeedsRefresh; //suffix and icons
LLUIImagePtr mIcon,
mIconOpen,
mIconOverlay;
@ -276,8 +277,13 @@ public:
virtual BOOL passedFilter(S32 filter_generation = -1);
virtual BOOL isPotentiallyVisible(S32 filter_generation = -1);
// refresh information from the object being viewed.
virtual void refresh();
// refresh information from the object being viewed.
// refreshes label, suffixes and sets icons. Expensive!
// Causes filter update
virtual void refresh();
// refreshes suffixes and sets icons. Expensive!
// Does not need filter update
virtual void refreshSuffix();
// LLView functionality
virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask );

View File

@ -48,11 +48,8 @@ std::string LLFolderViewModelCommon::getStatusText()
void LLFolderViewModelCommon::filter()
{
// <FS:Ansariel> Replace frequently called gSavedSettings
//getFilter().resetTime(llclamp(LLUI::getInstance()->mSettingGroups["config"]->getS32("FilterItemsMaxTimePerFrameVisible"), 1, 100));
static LLCachedControl<S32> sFilterItemsMaxTimePerFrameVisible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible");
getFilter().resetTime(llclamp(sFilterItemsMaxTimePerFrameVisible(), 1, 100));
// </FS:Ansariel>
static LLCachedControl<S32> filter_visible(*LLUI::getInstance()->mSettingGroups["config"], "FilterItemsMaxTimePerFrameVisible", 10);
getFilter().resetTime(llclamp(filter_visible(), 1, 100));
mFolderView->getViewModelItem()->filter(getFilter());
}

View File

@ -295,26 +295,7 @@ public:
typedef std::list<LLFolderViewModelItem*> child_list_t;
virtual void addChild(LLFolderViewModelItem* child)
{
// Avoid duplicates: bail out if that child is already present in the list
// Note: this happens when models are created before views
// <FS:ND> Ugh, linear search! Replace this by simply looking if the parent matches
// child_list_t::const_iterator iter;
// for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
// {
// if (child == *iter)
// {
// return;
// }
// }
if( child->getParent() == this )
return;
// </FS:ND>
{
mChildren.push_back(child);
child->setParent(this);
dirtyFilter();

View File

@ -4019,25 +4019,54 @@ void LLTearOffMenu::closeTearOff()
}
LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p)
: LLMenuItemGL(p),
mBranch( p.branch()->getHandle() )
: LLMenuItemGL(p)
//mBranch( p.branch()->getHandle() ) // <FS> Context menu memory leak fix by Rye Mutt
{
mBranch.get()->hide();
mBranch.get()->setParentMenuItem(this);
// <FS> Context menu memory leak fix by Rye Mutt
//mBranch.get()->hide();
//mBranch.get()->setParentMenuItem(this);
// </FS>
LLContextMenu* branch = static_cast<LLContextMenu*>(p.branch);
if (branch)
{
mBranch = branch->getHandle();
branch->hide();
branch->setParentMenuItem(this);
}
}
// <FS> Context menu memory leak fix by Rye Mutt
LLContextMenuBranch::~LLContextMenuBranch()
{
if (mBranch.get())
{
mBranch.get()->die();
}
}
// </FS>
// called to rebuild the draw label
void LLContextMenuBranch::buildDrawLabel( void )
{
// <FS> Context menu memory leak fix by Rye Mutt
auto menu = getBranch();
if (menu)
// </FS>
{
// default enablement is this -- if any of the subitems are
// enabled, this item is enabled. JC
U32 sub_count = mBranch.get()->getItemCount();
// <FS> Context menu memory leak fix by Rye Mutt
//U32 sub_count = mBranch.get()->getItemCount();
U32 sub_count = menu->getItemCount();
// </FS>
U32 i;
BOOL any_enabled = FALSE;
for (i = 0; i < sub_count; i++)
{
LLMenuItemGL* item = mBranch.get()->getItem(i);
// <FS> Context menu memory leak fix by Rye Mutt
//LLMenuItemGL* item = mBranch.get()->getItem(i);
LLMenuItemGL* item = menu->getItem(i);
// </FS>
item->buildDrawLabel();
if (item->getEnabled() && !item->getDrawTextDisabled() )
{
@ -4059,14 +4088,28 @@ void LLContextMenuBranch::buildDrawLabel( void )
void LLContextMenuBranch::showSubMenu()
{
LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem();
if (menu_item != NULL && menu_item->getVisible())
// <FS> Context menu memory leak fix by Rye Mutt
//LLMenuItemGL* menu_item = mBranch.get()->getParentMenuItem();
//if (menu_item != NULL && menu_item->getVisible())
//{
// S32 center_x;
// S32 center_y;
// localPointToScreen(getRect().getWidth(), getRect().getHeight() , &center_x, &center_y);
// mBranch.get()->show(center_x, center_y);
//}
auto menu = getBranch();
if (menu)
{
S32 center_x;
S32 center_y;
localPointToScreen(getRect().getWidth(), getRect().getHeight() , &center_x, &center_y);
mBranch.get()->show(center_x, center_y);
LLMenuItemGL* menu_item = menu->getParentMenuItem();
if (menu_item != NULL && menu_item->getVisible())
{
S32 center_x;
S32 center_y;
localPointToScreen(getRect().getWidth(), getRect().getHeight() , &center_x, &center_y);
menu->show(center_x, center_y);
}
}
// </FS>
}
// onCommit() - do the primary funcationality of the menu item.
@ -4079,14 +4122,28 @@ void LLContextMenuBranch::setHighlight( BOOL highlight )
{
if (highlight == getHighlight()) return;
LLMenuItemGL::setHighlight(highlight);
if( highlight )
// <FS> Context menu memory leak fix by Rye Mutt
//if( highlight )
//{
// showSubMenu();
//}
//else
//{
// mBranch.get()->hide();
//}
auto menu = getBranch();
if (menu)
{
showSubMenu();
}
else
{
mBranch.get()->hide();
if (highlight)
{
showSubMenu();
}
else
{
menu->hide();
}
}
// </FS>
}

View File

@ -744,8 +744,11 @@ public:
LLContextMenuBranch(const Params&);
virtual ~LLContextMenuBranch()
{}
// <FS> Context menu memory leak fix by Rye Mutt
//virtual ~LLContextMenuBranch()
//{}
virtual ~LLContextMenuBranch();
// </FS>
// called to rebuild the draw label
virtual void buildDrawLabel( void );

View File

@ -499,7 +499,8 @@ LLNotification::LLNotification(const LLSDParamAdapter<Params>& p) :
mResponderObj(NULL),
mId(p.id.isProvided() ? p.id : LLUUID::generateNewID()),
mOfferFromAgent(p.offer_from_agent),
mIsDND(p.is_dnd)
mIsDND(p.is_dnd),
mIsFromStorage(false)// <FS:Ansariel> FIRE-11339: Persisted group notifications get logged to IM on each login
{
if (p.functor.name.isChosen())
{

View File

@ -400,6 +400,7 @@ private:
LLNotificationResponderPtr mResponder;
bool mOfferFromAgent;
bool mIsDND;
bool mIsFromStorage; // <FS:Ansariel> FIRE-11339: Persisted group notifications get logged to IM on each login
// a reference to the template
LLNotificationTemplatePtr mTemplatep;
@ -557,6 +558,18 @@ public:
mIsDND = flag;
}
// <FS:Ansariel> FIRE-11339: Persisted group notifications get logged to IM on each login
bool isFromStorage() const
{
return mIsFromStorage;
}
void setIsFromStorage(bool logged)
{
mIsFromStorage = logged;
}
// </FS:Ansariel>
std::string getType() const;
std::string getMessage() const;
std::string getFooter() const;

View File

@ -49,8 +49,6 @@ LLSpellChecker::settings_change_signal_t LLSpellChecker::sSettingsChangeSignal;
LLSpellChecker::LLSpellChecker()
: mHunspell(NULL)
{
// Load initial dictionary information
//refreshDictionaryMap(); // <FS:Ansariel> FIRE-29649: Crash when opening spellcheck settings
}
LLSpellChecker::~LLSpellChecker()
@ -58,13 +56,11 @@ LLSpellChecker::~LLSpellChecker()
delete mHunspell;
}
// <FS:Ansariel> FIRE-29649: Crash when opening spellcheck settings
void LLSpellChecker::initSingleton()
{
// Load initial dictionary information
refreshDictionaryMap();
}
// </FS:Ansariel>
bool LLSpellChecker::checkSpelling(const std::string& word) const
{

View File

@ -47,7 +47,7 @@ public:
protected:
void addToDictFile(const std::string& dict_path, const std::string& word);
void initHunspell(const std::string& dict_language);
void initSingleton(); // <FS:Ansariel> FIRE-29649: Crash when opening spellcheck settings
void initSingleton();
public:
typedef std::list<std::string> dict_list_t;

View File

@ -1181,7 +1181,10 @@ BOOL LLTextBase::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLTextBase::handleMouseUp(S32 x, S32 y, MASK mask)
{
LLTextSegmentPtr cur_segment = getSegmentAtLocalPos(x, y);
if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask))
// <FS:Beq> FIRE-23523 left click does not work on notifications with embedded links
// if (hasMouseCapture() && cur_segment && cur_segment->handleMouseUp(x, y, mask))
if (cur_segment && cur_segment->handleMouseUp(x, y, mask))
// </FS:Beq>
{
// Did we just click on a link?
if (mURLClickSignal

View File

@ -500,6 +500,19 @@ void LLUI::positionViewNearMouse(LLView* view, S32 spawn_x, S32 spawn_y)
LLRect virtual_window_rect = parent->getLocalRect();
// <FS:Ansariel> FIRE-5369: Make sure inspect floater and tooltips don't open partially underneath toolbars
if (parent == gFloaterView)
{
S32 left_toolbar_width = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_LEFT).getWidth();
S32 right_toolbar_width = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_RIGHT).getWidth();
S32 bottom_toolbar_height = gFloaterView->getToolbarRect(LLToolBarEnums::TOOLBAR_BOTTOM).getHeight();
virtual_window_rect.mLeft += (left_toolbar_width - 2 * FLOATER_MIN_VISIBLE_PIXELS);
virtual_window_rect.mRight -= (right_toolbar_width - 2 * FLOATER_MIN_VISIBLE_PIXELS);
virtual_window_rect.mBottom += (bottom_toolbar_height - 2 * FLOATER_MIN_VISIBLE_PIXELS);
virtual_window_rect.mBottom += gFloaterView->getUtilityBarRect().getHeight();
}
// </FS:Ansariel>
LLRect mouse_rect;
const S32 MOUSE_CURSOR_PADDING = 1;
mouse_rect.setLeftTopAndSize(mouse_x - MOUSE_CURSOR_PADDING,

View File

@ -520,13 +520,17 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
}
//
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ *lindenlab.com/ and *tilia-inc.com/ urls to substitute icon 'hand.png' before link
// LLUrlEntrySeconlifeURL Describes *secondlife.com/ *lindenlab.com/ *secondlifegrid.net/ and *tilia-inc.com/ urls to substitute icon 'hand.png' before link
//
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com)"
"|"
"(https://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(:\\d{1,5})?))"
"(http://([-\\w\\.]*\\.)?secondlifegrid\\.net)"
"|"
"(https://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(:\\d{1,5})?)"
"|"
"(https://([-\\w\\.]*\\.)?secondlifegrid\\.net(:\\d{1,5})?))"
"\\/\\S*",
boost::regex::perl|boost::regex::icase);
@ -564,12 +568,14 @@ std::string LLUrlEntrySecondlifeURL::getTooltip(const std::string &url) const
}
//
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com *lindenlab.com and *tilia-inc.com urls to substitute icon 'hand.png' before link
// LLUrlEntrySimpleSecondlifeURL Describes *secondlife.com *lindenlab.com *secondlifegrid.net and *tilia-inc.com urls to substitute icon 'hand.png' before link
//
LLUrlEntrySimpleSecondlifeURL::LLUrlEntrySimpleSecondlifeURL()
{
mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(?!\\S)",
boost::regex::perl|boost::regex::icase);
mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab|tilia-inc)\\.com(?!\\S)"
"|"
"https?://([-\\w\\.]*\\.)?secondlifegrid\\.net(?!\\S)",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
mMenuName = "menu_url_http.xml";

View File

@ -229,7 +229,9 @@ S32 LLDXHardware::getMBVideoMemoryViaWMI()
}
//Getting the version of graphics controller driver via WMI
std::string LLDXHardware::getDriverVersionWMI()
// <FS:Ansariel> FIRE-8264: System info displays wrong driver version on Optimus systems
//std::string LLDXHardware::getDriverVersionWMI()
std::string LLDXHardware::getDriverVersionWMI(const std::string& vendor)
{
std::string mDriverVersion;
HRESULT hrCoInitialize = S_OK;
@ -328,6 +330,29 @@ std::string LLDXHardware::getDriverVersionWMI()
VARIANT vtProp;
// <FS:Ansariel> FIRE-8264: System info displays wrong driver version on Optimus systems
hr = pclsObj->Get(L"AdapterCompatibility", 0, &vtProp, 0, 0);
if (FAILED(hr))
{
LL_WARNS("AppInit") << "Query for name property failed." << " Error code = 0x" << hr << LL_ENDL;
pSvc->Release();
pLoc->Release();
CoUninitialize();
return std::string(); // Program has failed.
}
BSTR vendorCompatibility(vtProp.bstrVal);
std::wstring vc_ws(vendorCompatibility, SysStringLen(vendorCompatibility));
std::string vc_str(vc_ws.begin(), vc_ws.end());
LLStringUtil::toUpper(vc_str);
if (vc_str.find(vendor) == std::string::npos)
{
continue;
}
// </FS:Ansariel>
// Get the value of the Name property
hr = pclsObj->Get(L"DriverVersion", 0, &vtProp, 0, 0);

View File

@ -91,7 +91,9 @@ public:
BOOL getInfo(BOOL vram_only, bool disable_wmi);
// </FS:Ansariel>
std::string getDriverVersionWMI();
// <FS:Ansariel> FIRE-8264: System info displays wrong driver version on Optimus systems
//std::string getDriverVersionWMI();
std::string getDriverVersionWMI(const std::string& vendor);
S32 getVRAM() const { return mVRAM; }

View File

@ -787,9 +787,6 @@ void LLWindowWin32::close()
resetDisplayResolution();
}
// Don't process events in our mainWindowProc any longer.
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, NULL);
// Make sure cursor is visible and we haven't mangled the clipping state.
showCursor();
setMouseClipping(FALSE);
@ -835,16 +832,24 @@ void LLWindowWin32::close()
LL_DEBUGS("Window") << "Destroying Window" << LL_ENDL;
// Make sure we don't leave a blank toolbar button.
ShowWindow(mWindowHandle, SW_HIDE);
if (IsWindow(mWindowHandle))
{
// Make sure we don't leave a blank toolbar button.
ShowWindow(mWindowHandle, SW_HIDE);
// This causes WM_DESTROY to be sent *immediately*
if (!destroy_window_handler(mWindowHandle))
{
OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
mCallbacks->translateString("MBShutdownErr"),
OSMB_OK);
}
// This causes WM_DESTROY to be sent *immediately*
if (!destroy_window_handler(mWindowHandle))
{
OSMessageBox(mCallbacks->translateString("MBDestroyWinFailed"),
mCallbacks->translateString("MBShutdownErr"),
OSMB_OK);
}
}
else
{
// Something killed the window while we were busy destroying gl or handle somehow got broken
LL_WARNS("Window") << "Failed to destroy Window, invalid handle!" << LL_ENDL;
}
mWindowHandle = NULL;
}
@ -1136,7 +1141,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
<< " Height: " << (window_rect.bottom - window_rect.top)
<< " Fullscreen: " << mFullscreen
<< LL_ENDL;
DestroyWindow(mWindowHandle);
if (!destroy_window_handler(mWindowHandle))
{
LL_WARNS("Window") << "Failed to properly close window before recreating it!" << LL_ENDL;
}
mWindowHandle = CreateWindowEx(dw_ex_style,
mWindowClassName,
mWindowTitle,
@ -1456,8 +1464,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
ReleaseDC (mWindowHandle, mhDC); // Release The Device Context
mhDC = 0; // Zero The Device Context
}
DestroyWindow (mWindowHandle); // Destroy The Window
// Destroy The Window
if (!destroy_window_handler(mWindowHandle))
{
LL_WARNS("Window") << "Failed to properly close window!" << LL_ENDL;
}
mWindowHandle = CreateWindowEx(dw_ex_style,
mWindowClassName,
@ -1559,9 +1571,9 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
if (wglCreateContextAttribsARB)
{ //attempt to create a specific versioned context
S32 attribs[] =
{ //start at 4.2
{ //start at 4.6
WGL_CONTEXT_MAJOR_VERSION_ARB, 4,
WGL_CONTEXT_MINOR_VERSION_ARB, 2,
WGL_CONTEXT_MINOR_VERSION_ARB, 6,
WGL_CONTEXT_PROFILE_MASK_ARB, LLRender::sGLCoreProfile ? WGL_CONTEXT_CORE_PROFILE_BIT_ARB : WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
WGL_CONTEXT_FLAGS_ARB, gDebugGL ? WGL_CONTEXT_DEBUG_BIT_ARB : 0,
0
@ -3455,7 +3467,10 @@ void LLSplashScreenWin32::hideImpl()
{
if (mWindow)
{
DestroyWindow(mWindow);
if (!destroy_window_handler(mWindow))
{
LL_WARNS("Window") << "Failed to properly close splash screen window!" << LL_ENDL;
}
mWindow = NULL;
}
}

View File

@ -5,17 +5,17 @@ if (LINUX)
# add_subdirectory(gstreamer010)
add_subdirectory(cef)
add_subdirectory(libvlc)
add_subdirectory(example)
#add_subdirectory(example)
endif (LINUX)
if (DARWIN)
add_subdirectory(cef)
add_subdirectory(libvlc)
add_subdirectory(example)
#add_subdirectory(example)
endif (DARWIN)
if (WINDOWS)
add_subdirectory(cef)
add_subdirectory(libvlc)
add_subdirectory(example)
#add_subdirectory(example)
endif (WINDOWS)

View File

@ -99,7 +99,9 @@ private:
bool mCanCut;
bool mCanCopy;
bool mCanPaste;
std::string mRootCachePath;
std::string mCachePath;
std::string mContextCachePath;
std::string mCefLogFile;
bool mCefLogVerbose;
std::vector<std::string> mPickedFiles;
@ -459,7 +461,6 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
}
else if (message_name == "cleanup")
{
mVolumeCatcher.setVolume(0); // Hack: masks CEF exit issues
mCEFLib->requestExit();
}
else if (message_name == "force_exit")
@ -528,7 +529,9 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
settings.accept_language_list = mHostLanguage;
settings.background_color = 0xffffffff;
settings.cache_enabled = true;
settings.root_cache_path = mRootCachePath;
settings.cache_path = mCachePath;
settings.context_cache_path = mContextCachePath;
settings.cookies_enabled = mCookiesEnabled;
settings.disable_gpu = mDisableGPU;
#if LL_DARWIN
@ -586,9 +589,25 @@ void MediaPluginCEF::receiveMessage(const char* message_string)
else if (message_name == "set_user_data_path")
{
std::string user_data_path_cache = message_in.getValue("cache_path");
std::string user_data_path_cookies = message_in.getValue("cookies_path");
std::string subfolder = message_in.getValue("username");
mCachePath = user_data_path_cache + "cef_cache";
mRootCachePath = user_data_path_cache + "cef_cache";
if (!subfolder.empty())
{
std::string delim;
#if LL_WINDOWS
// media plugin doesn't have access to gDirUtilp
delim = "\\";
#else
delim = "/";
#endif
mCachePath = mRootCachePath + delim + subfolder;
}
else
{
mCachePath = mRootCachePath;
}
mContextCachePath = ""; // disabled by ""
mCefLogFile = message_in.getValue("cef_log_file");
mCefLogVerbose = message_in.getValueBoolean("cef_verbose_log");
}

View File

@ -2209,9 +2209,11 @@ if (WINDOWS)
${SHARED_LIB_STAGING_DIR}/Release/libcollada14dom22.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libcollada14dom22.dll
${SHARED_LIB_STAGING_DIR}/Debug/libcollada14dom22-d.dll
${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll
${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll
# <FS:Ansariel> Only copy OpenJPEG dll if needed
#${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll
#${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjp2.dll
#${SHARED_LIB_STAGING_DIR}/Debug/openjp2.dll
# </FS:Ansariel>
${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
@ -2231,10 +2233,20 @@ if (WINDOWS)
SLPlugin
media_plugin_cef
media_plugin_libvlc
media_plugin_example
#media_plugin_example # <FS:Ansariel> Don't package example plugin
windows-crash-logger
)
# <FS:Ansariel> Only copy OpenJPEG dll if needed
if (NOT USE_KDU)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/Release/openjp2.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjp2.dll
${SHARED_LIB_STAGING_DIR}/Debug/openjp2.dll
)
endif (NOT USE_KDU)
# </FS:Ansariel>
if (ADDRESS_SIZE EQUAL 64)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxsdk_x64.dll

View File

@ -386,32 +386,40 @@ void NACLFloaterExploreSounds::handleLookAt()
void NACLFloaterExploreSounds::handleStop()
{
std::vector<LLScrollListItem*> selection = mHistoryScroller->getAllSelected();
std::vector<LLScrollListItem*>::iterator selection_iter = selection.begin();
std::vector<LLScrollListItem*>::iterator selection_end = selection.end();
for( ; selection_iter != selection_end; ++selection_iter)
for (const auto& selection_item : selection)
{
LLSoundHistoryItem item = getItem((*selection_iter)->getValue());
if(item.mID.isNull()) continue;
if(item.mPlaying)
LLSoundHistoryItem item = getItem(selection_item->getValue());
if (item.mID.notNull() && item.mPlaying)
{
// Make sure the audio source in question is still in the system to prevent
// crashes by using a stale pointer. This can happen when the same UUID is
// played twice without stopping it first. -Zi
if(!gAudiop->findAudioSource(item.mSourceID))
{
LL_WARNS("SoundExplorer") << "audio source " << item.mAudioSource << " already gone but still marked as playing. Fixing ..." << LL_ENDL;
gSoundHistory[item.mID].mPlaying = false;
gSoundHistory[item.mID].mAudioSource = NULL;
gSoundHistory[item.mID].mTimeStopped = LLTimer::getElapsedSeconds();
continue;
}
if(item.mAudioSource)
LLAudioSource* audio_source = gAudiop->findAudioSource(item.mSourceID);
if (audio_source)
{
S32 type = item.mType;
item.mAudioSource->setType(LLAudioEngine::AUDIO_TYPE_UI);
item.mAudioSource->play(LLUUID::null);
item.mAudioSource->setType(type);
audio_source->setType(LLAudioEngine::AUDIO_TYPE_UI);
audio_source->play(LLUUID::null);
audio_source->setType(type);
}
else
{
LL_WARNS("SoundExplorer") << "audio source for source ID " << item.mSourceID << " already gone but still marked as playing. Fixing ..." << LL_ENDL;
if (gSoundHistory.find(item.mID) != gSoundHistory.end())
{
gSoundHistory[item.mID].mPlaying = false;
gSoundHistory[item.mID].mTimeStopped = LLTimer::getElapsedSeconds();
}
else
{
for (auto& histItem : mLastHistory)
{
if (histItem.mID == item.mID)
{
histItem.mPlaying = false;
histItem.mTimeStopped = LLTimer::getElapsedSeconds();
break;
}
}
}
continue;
}
}
}

View File

@ -1 +1 @@
6.4.11
6.4.12

View File

@ -39,14 +39,14 @@
#include "utilitybar.h"
FloaterAO::FloaterAO(const LLSD& key)
: LLTransientDockableFloater(NULL, true, key), LLEventTimer(10.f),
: LLTransientDockableFloater(nullptr, true, key), LLEventTimer(10.f),
mSetList(0),
mSelectedSet(0),
mSelectedState(0),
mCanDragAndDrop(FALSE),
mImportRunning(FALSE),
mCurrentBoldItem(NULL),
mMore(TRUE)
mCanDragAndDrop(false),
mImportRunning(false),
mCurrentBoldItem(nullptr),
mMore(true)
{
mEventTimer.stop();
}
@ -55,9 +55,9 @@ FloaterAO::~FloaterAO()
{
}
void FloaterAO::reloading(BOOL yes)
void FloaterAO::reloading(bool reload)
{
if (yes)
if (reload)
{
mEventTimer.start();
}
@ -66,9 +66,9 @@ void FloaterAO::reloading(BOOL yes)
mEventTimer.stop();
}
mReloadCoverPanel->setVisible(yes);
enableSetControls(!yes);
enableStateControls(!yes);
mReloadCoverPanel->setVisible(reload);
enableSetControls(!reload);
enableStateControls(!reload);
}
BOOL FloaterAO::tick()
@ -84,7 +84,7 @@ void FloaterAO::updateSetParameters()
mOverrideSitsCheckBox->setValue(mSelectedSet->getSitOverride());
mOverrideSitsCheckBoxSmall->setValue(mSelectedSet->getSitOverride());
mSmartCheckBox->setValue(mSelectedSet->getSmart());
mDisableMouselookCheckBox->setValue(mSelectedSet->getMouselookDisable());
mDisableMouselookCheckBox->setValue(mSelectedSet->getMouselookStandDisable());
BOOL isDefault = (mSelectedSet == AOEngine::instance().getDefaultSet());
mDefaultCheckBox->setValue(isDefault);
mDefaultCheckBox->setEnabled(!isDefault);
@ -112,7 +112,7 @@ void FloaterAO::updateAnimationList()
mStateSelector->add(stateName, state, ADD_BOTTOM, TRUE);
}
enableStateControls(TRUE);
enableStateControls(true);
if (currentStateSelected == -1)
{
@ -129,7 +129,7 @@ void FloaterAO::updateAnimationList()
void FloaterAO::updateList()
{
mReloadButton->setEnabled(TRUE);
mImportRunning = FALSE;
mImportRunning = false;
// Lambda provides simple Alpha sorting, note this is case sensitive.
auto sortRuleLambda = [](const AOSet* s1, const AOSet* s2) -> bool
@ -137,7 +137,7 @@ void FloaterAO::updateList()
return s1->getName() < s2->getName();
};
mSetList=AOEngine::instance().getSetList();
mSetList = AOEngine::instance().getSetList();
std::sort(mSetList.begin(), mSetList.end(), sortRuleLambda);
// remember currently selected animation set name
@ -149,8 +149,8 @@ void FloaterAO::updateList()
mSetSelectorSmall->clear();
mAnimationList->deleteAllItems();
mCurrentBoldItem = NULL;
reloading(FALSE);
mCurrentBoldItem = nullptr;
reloading(false);
if (mSetList.empty())
{
@ -292,43 +292,43 @@ BOOL FloaterAO::postBuild()
return LLDockableFloater::postBuild();
}
void FloaterAO::enableSetControls(BOOL yes)
void FloaterAO::enableSetControls(BOOL enable)
{
mSetSelector->setEnabled(yes);
mSetSelectorSmall->setEnabled(yes);
mActivateSetButton->setEnabled(yes);
mRemoveButton->setEnabled(yes);
mDefaultCheckBox->setEnabled(yes && (mSelectedSet != AOEngine::instance().getDefaultSet()));
mOverrideSitsCheckBox->setEnabled(yes);
mOverrideSitsCheckBoxSmall->setEnabled(yes);
mDisableMouselookCheckBox->setEnabled(yes);
mSetSelector->setEnabled(enable);
mSetSelectorSmall->setEnabled(enable);
mActivateSetButton->setEnabled(enable);
mRemoveButton->setEnabled(enable);
mDefaultCheckBox->setEnabled(enable && (mSelectedSet != AOEngine::instance().getDefaultSet()));
mOverrideSitsCheckBox->setEnabled(enable);
mOverrideSitsCheckBoxSmall->setEnabled(enable);
mDisableMouselookCheckBox->setEnabled(enable);
if (!yes)
if (!enable)
{
enableStateControls(yes);
enableStateControls(enable);
}
}
void FloaterAO::enableStateControls(BOOL yes)
void FloaterAO::enableStateControls(BOOL enable)
{
mStateSelector->setEnabled(yes);
mAnimationList->setEnabled(yes);
mCycleCheckBox->setEnabled(yes);
if (yes)
mStateSelector->setEnabled(enable);
mAnimationList->setEnabled(enable);
mCycleCheckBox->setEnabled(enable);
if (enable)
{
updateCycleParameters();
}
else
{
mRandomizeCheckBox->setEnabled(yes);
mCycleTimeTextLabel->setEnabled(yes);
mCycleTimeSpinner->setEnabled(yes);
mRandomizeCheckBox->setEnabled(enable);
mCycleTimeTextLabel->setEnabled(enable);
mCycleTimeSpinner->setEnabled(enable);
}
mPreviousButton->setEnabled(yes);
mPreviousButtonSmall->setEnabled(yes);
mNextButton->setEnabled(yes);
mNextButtonSmall->setEnabled(yes);
mCanDragAndDrop = yes;
mPreviousButton->setEnabled(enable);
mPreviousButtonSmall->setEnabled(enable);
mNextButton->setEnabled(enable);
mNextButtonSmall->setEnabled(enable);
mCanDragAndDrop = enable;
}
void FloaterAO::onOpen(const LLSD& key)
@ -440,7 +440,7 @@ LLScrollListItem* FloaterAO::addAnimation(const std::string& name)
void FloaterAO::onSelectState()
{
mAnimationList->deleteAllItems();
mCurrentBoldItem = NULL;
mCurrentBoldItem = nullptr;
mAnimationList->setCommentText(getString("ao_no_animations_loaded"));
mAnimationList->setEnabled(FALSE);
@ -482,10 +482,10 @@ void FloaterAO::onSelectState()
void FloaterAO::onClickReload()
{
reloading(TRUE);
reloading(true);
mSelectedSet = 0;
mSelectedState = 0;
mSelectedSet = nullptr;
mSelectedState = nullptr;
AOEngine::instance().reload(false);
updateList();
@ -496,7 +496,7 @@ void FloaterAO::onClickAdd()
LLNotificationsUtil::add("NewAOSet", LLSD(), LLSD(), boost::bind(&FloaterAO::newSetCallback, this, _1, _2));
}
BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response)
bool FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response)
{
std::string newSetName = response["message"].asString();
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@ -507,7 +507,7 @@ BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response)
if (newSetName.empty())
{
return FALSE;
return false;
}
else if (
!LLTextValidate::validateASCIIPrintableNoPipe(new_set_name.getWString()) || // only allow ASCII
@ -516,18 +516,18 @@ BOOL FloaterAO::newSetCallback(const LLSD& notification, const LLSD& response)
LLSD args;
args["AO_SET_NAME"] = newSetName;
LLNotificationsUtil::add("NewAOCantContainNonASCII", args);
return FALSE;
return false;
}
if (option == 0)
{
if (AOEngine::instance().addSet(newSetName).notNull())
{
reloading(TRUE);
return TRUE;
reloading(true);
return true;
}
}
return FALSE;
return false;
}
void FloaterAO::onClickRemove()
@ -542,7 +542,7 @@ void FloaterAO::onClickRemove()
LLNotificationsUtil::add("RemoveAOSet", args, LLSD(), boost::bind(&FloaterAO::removeSetCallback, this, _1, _2));
}
BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response)
bool FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
@ -550,7 +550,7 @@ BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response
{
if (AOEngine::instance().removeSet(mSelectedSet))
{
reloading(TRUE);
reloading(true);
// to prevent snapping back to deleted set
mSetSelector->removeall();
mSetSelectorSmall->removeall();
@ -558,11 +558,11 @@ BOOL FloaterAO::removeSetCallback(const LLSD& notification, const LLSD& response
mSetSelector->clear();
mSetSelectorSmall->clear();
mAnimationList->deleteAllItems();
mCurrentBoldItem = NULL;
return TRUE;
mCurrentBoldItem = nullptr;
return true;
}
}
return FALSE;
return false;
}
void FloaterAO::onCheckDefault()
@ -606,7 +606,7 @@ void FloaterAO::onCheckDisableStands()
{
if (mSelectedSet)
{
AOEngine::instance().setDisableStands(mSelectedSet, mDisableMouselookCheckBox->getValue().asBoolean());
AOEngine::instance().setDisableMouselookStands(mSelectedSet, mDisableMouselookCheckBox->getValue().asBoolean());
}
}
@ -698,7 +698,7 @@ void FloaterAO::onClickTrash()
}
std::vector<LLScrollListItem*> list = mAnimationList->getAllSelected();
if (list.size() == 0)
if (list.empty())
{
return;
}
@ -709,23 +709,23 @@ void FloaterAO::onClickTrash()
}
mAnimationList->deleteSelectedItems();
mCurrentBoldItem = NULL;
mCurrentBoldItem = nullptr;
}
void FloaterAO::updateCycleParameters()
{
BOOL yes = mCycleCheckBox->getValue().asBoolean();
mRandomizeCheckBox->setEnabled(yes);
mCycleTimeTextLabel->setEnabled(yes);
mCycleTimeSpinner->setEnabled(yes);
BOOL enabled = mCycleCheckBox->getValue().asBoolean();
mRandomizeCheckBox->setEnabled(enabled);
mCycleTimeTextLabel->setEnabled(enabled);
mCycleTimeSpinner->setEnabled(enabled);
}
void FloaterAO::onCheckCycle()
{
if (mSelectedState)
{
BOOL yes = mCycleCheckBox->getValue().asBoolean();
AOEngine::instance().setCycle(mSelectedState, yes);
bool cycle = mCycleCheckBox->getValue().asBoolean();
AOEngine::instance().setCycle(mSelectedState, cycle);
updateCycleParameters();
}
}
@ -770,7 +770,7 @@ void FloaterAO::onClickMore()
fullSize.setOriginAndSize(fullSize.mLeft, fullSize.mBottom, getRect().getWidth(), fullSize.getHeight());
}
mMore = TRUE;
mMore = true;
mSmallInterfacePanel->setVisible(FALSE);
mMainInterfacePanel->setVisible(TRUE);
@ -789,7 +789,7 @@ void FloaterAO::onClickLess()
gSavedPerAccountSettings.setRect("floater_rect_animation_overrider_full", fullSize);
mMore = FALSE;
mMore = false;
mSmallInterfacePanel->setVisible(TRUE);
mMainInterfacePanel->setVisible(FALSE);
@ -812,7 +812,7 @@ void FloaterAO::onAnimationChanged(const LLUUID& animation)
LLScrollListText* column = (LLScrollListText*)mCurrentBoldItem->getColumn(1);
column->setFontStyle(LLFontGL::NORMAL);
mCurrentBoldItem = NULL;
mCurrentBoldItem = nullptr;
}
if (animation.isNull())
@ -888,7 +888,7 @@ BOOL FloaterAO::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDr
// TODO: this would be the right thing to do, but it blocks multi drop
// before final release this must be resolved
reloading(TRUE);
reloading(true);
}
}
}

View File

@ -92,16 +92,16 @@ class FloaterAO
void onAnimationChanged(const LLUUID& animation);
void reloading(BOOL yes);
void reloading(bool reload);
void updateSmart();
void updateCycleParameters();
void enableSetControls(BOOL yes);
void enableStateControls(BOOL yes);
void enableSetControls(BOOL enable);
void enableStateControls(BOOL enable);
BOOL newSetCallback(const LLSD& notification, const LLSD& response);
BOOL removeSetCallback(const LLSD& notification, const LLSD& response);
bool newSetCallback(const LLSD& notification, const LLSD& response);
bool removeSetCallback(const LLSD& notification, const LLSD& response);
virtual BOOL tick();
@ -151,9 +151,9 @@ class FloaterAO
LLButton* mNextButtonSmall;
LLCheckBoxCtrl* mOverrideSitsCheckBoxSmall;
BOOL mCanDragAndDrop;
BOOL mImportRunning;
BOOL mMore;
bool mCanDragAndDrop;
bool mImportRunning;
bool mMore;
};
#endif // AO_H

File diff suppressed because it is too large Load Diff

View File

@ -25,17 +25,13 @@
#ifndef AOENGINE_H
#define AOENGINE_H
#include <boost/signals2.hpp>
#include "aoset.h"
#include "llassettype.h"
#include "lleventtimer.h"
#include "llsingleton.h"
// NaCl - feex
#include "llextendedstatus.h"
// NaCl End
#include "llsingleton.h"
#include <boost/signals2.hpp>
class AOTimerCollection
: public LLEventTimer
@ -46,18 +42,18 @@ class AOTimerCollection
virtual BOOL tick();
void enableInventoryTimer(BOOL yes);
void enableSettingsTimer(BOOL yes);
void enableReloadTimer(BOOL yes);
void enableImportTimer(BOOL yes);
void enableInventoryTimer(bool enable);
void enableSettingsTimer(bool enable);
void enableReloadTimer(bool enable);
void enableImportTimer(bool enable);
protected:
void updateTimers();
BOOL mInventoryTimer;
BOOL mSettingsTimer;
BOOL mReloadTimer;
BOOL mImportTimer;
bool mInventoryTimer;
bool mSettingsTimer;
bool mReloadTimer;
bool mImportTimer;
};
// ----------------------------------------------------
@ -98,35 +94,35 @@ class AOEngine
CyclePrevious
};
void enable(BOOL yes);
void enable_stands(BOOL yes);
const LLUUID override(const LLUUID& motion, BOOL start);
void enable(bool enable);
void enableStands(bool enable_stands);
const LLUUID override(const LLUUID& motion, bool start);
void tick();
void update();
void reload(bool);
void reloadStateAnimations(AOSet::AOState* state);
void clear( bool );
void clear(bool from_timer);
const LLUUID& getAOFolder() const;
LLUUID addSet(const std::string& name, BOOL reload = TRUE);
BOOL removeSet(AOSet* set);
LLUUID addSet(const std::string& name, bool reload = true);
bool removeSet(AOSet* set);
BOOL addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, BOOL reload = TRUE);
BOOL removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index);
bool addAnimation(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item, bool reload = true);
bool removeAnimation(const AOSet* set, AOSet::AOState* state, S32 index);
void checkSitCancel();
void checkBelowWater(BOOL yes);
void checkBelowWater(bool check_underwater);
BOOL importNotecard(const LLInventoryItem* item);
void processImport(bool);
bool importNotecard(const LLInventoryItem* item);
void processImport(bool from_timer);
BOOL swapWithPrevious(AOSet::AOState* state, S32 index);
BOOL swapWithNext(AOSet::AOState* state, S32 index);
bool swapWithPrevious(AOSet::AOState* state, S32 index);
bool swapWithNext(AOSet::AOState* state, S32 index);
void cycleTimeout(const AOSet* set);
void cycle(eCycleMode cycleMode);
void inMouselook(BOOL yes);
void inMouselook(bool mouselook);
void selectSet(AOSet* set);
AOSet* selectSetByName(const std::string& name);
AOSet* getSetByName(const std::string& name) const;
@ -137,14 +133,14 @@ class AOEngine
const std::vector<AOSet*> getSetList() const;
const std::string getCurrentSetName() const;
const AOSet* getDefaultSet() const;
BOOL renameSet(AOSet* set, const std::string& name);
bool renameSet(AOSet* set, const std::string& name);
void setDefaultSet(AOSet* set);
void setOverrideSits(AOSet* set, BOOL yes);
void setSmart(AOSet* set, BOOL yes);
void setDisableStands(AOSet* set, BOOL yes);
void setCycle(AOSet::AOState* set, BOOL yes);
void setRandomize(AOSet::AOState* state, BOOL yes);
void setOverrideSits(AOSet* set, bool override_sit);
void setSmart(AOSet* set, bool smart);
void setDisableMouselookStands(AOSet* set, bool disabled);
void setCycle(AOSet::AOState* set, bool cycle);
void setRandomize(AOSet::AOState* state, bool randomize);
void setCycleTime(AOSet::AOState* state, F32 time);
void saveSettings();
@ -171,7 +167,7 @@ class AOEngine
void stopAllStandVariants();
void stopAllSitVariants();
BOOL foreignAnimations();
bool foreignAnimations();
AOSet::AOState* mapSwimming(const LLUUID& motion) const;
AOSet::AOState* getStateForMotion(const LLUUID& motion) const;
@ -179,8 +175,8 @@ class AOEngine
void saveSet(const AOSet* set);
void saveState(const AOSet::AOState* state);
BOOL createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item);
BOOL findForeignItems(const LLUUID& uuid) const;
bool createAnimationLink(const AOSet* set, AOSet::AOState* state, const LLInventoryItem* item);
bool findForeignItems(const LLUUID& uuid) const;
void purgeFolder(const LLUUID& uuid) const;
void onRegionChange();
@ -197,10 +193,10 @@ class AOEngine
AOTimerCollection mTimerCollection;
AOSitCancelTimer mSitCancelTimer;
BOOL mEnabled;
BOOL mEnabledStands;
BOOL mInMouselook;
BOOL mUnderWater;
bool mEnabled;
bool mEnabledStands;
bool mInMouselook;
bool mUnderWater;
LLUUID mAOFolder;
LLUUID mLastMotion;

View File

@ -32,11 +32,11 @@ AOSet::AOSet(const LLUUID inventoryID)
: LLEventTimer(10000.0f),
mInventoryID(inventoryID),
mName("** New AO Set **"),
mSitOverride(FALSE),
mSmart(FALSE),
mMouselookDisable(FALSE),
mComplete(FALSE),
mDirty(FALSE),
mSitOverride(false),
mSmart(false),
mMouselookStandDisable(false),
mComplete(false),
mDirty(false),
mCurrentMotion(LLUUID())
{
LL_DEBUGS("AOEngine") << "Creating new AO set: " << this << LL_ENDL;
@ -113,10 +113,10 @@ AOSet::AOSet(const LLUUID inventoryID)
mStates[index].mInventoryUUID = LLUUID::null;
mStates[index].mCurrentAnimation = 0;
mStates[index].mCurrentAnimationID = LLUUID::null;
mStates[index].mCycle = FALSE;
mStates[index].mRandom = FALSE;
mStates[index].mCycle = false;
mStates[index].mRandom = false;
mStates[index].mCycleTime = 0.0f;
mStates[index].mDirty = FALSE;
mStates[index].mDirty = false;
mStateNames.push_back(stateNameList[0]);
}
stopTimer();
@ -145,7 +145,7 @@ AOSet::AOState* AOSet::getStateByName(const std::string& name)
}
}
}
return NULL;
return nullptr;
}
AOSet::AOState* AOSet::getStateByRemapID(const LLUUID& id)
@ -163,7 +163,7 @@ AOSet::AOState* AOSet::getStateByRemapID(const LLUUID& id)
return &mStates[index];
}
}
return NULL;
return nullptr;
}
const LLUUID& AOSet::getAnimationForState(AOState* state) const
@ -240,54 +240,54 @@ void AOSet::setName(const std::string& name)
mName=name;
}
BOOL AOSet::getSitOverride() const
bool AOSet::getSitOverride() const
{
return mSitOverride;
}
void AOSet::setSitOverride(BOOL yes)
void AOSet::setSitOverride(bool override_sit)
{
mSitOverride = yes;
mSitOverride = override_sit;
}
BOOL AOSet::getSmart() const
bool AOSet::getSmart() const
{
return mSmart;
}
void AOSet::setSmart(BOOL yes)
void AOSet::setSmart(bool smart)
{
mSmart = yes;
mSmart = smart;
}
BOOL AOSet::getMouselookDisable() const
bool AOSet::getMouselookStandDisable() const
{
return mMouselookDisable;
return mMouselookStandDisable;
}
void AOSet::setMouselookDisable(BOOL yes)
void AOSet::setMouselookStandDisable(bool disable)
{
mMouselookDisable = yes;
mMouselookStandDisable = disable;
}
BOOL AOSet::getComplete() const
bool AOSet::getComplete() const
{
return mComplete;
}
void AOSet::setComplete(BOOL yes)
void AOSet::setComplete(bool complete)
{
mComplete = yes;
mComplete = complete;
}
BOOL AOSet::getDirty() const
bool AOSet::getDirty() const
{
return mDirty;
}
void AOSet::setDirty(BOOL yes)
void AOSet::setDirty(bool dirty)
{
mDirty = yes;
mDirty = dirty;
}
void AOSet::setMotion(const LLUUID& motion)

View File

@ -79,14 +79,14 @@ class AOSet
std::string mName;
std::vector<std::string> mAlternateNames;
LLUUID mRemapID;
BOOL mCycle;
BOOL mRandom;
bool mCycle;
bool mRandom;
S32 mCycleTime;
std::vector<AOAnimation> mAnimations;
U32 mCurrentAnimation;
LLUUID mCurrentAnimationID;
LLUUID mInventoryUUID;
BOOL mDirty;
bool mDirty;
};
const LLUUID& getInventoryUUID() const;
@ -95,23 +95,23 @@ class AOSet
const std::string& getName() const;
void setName(const std::string& name);
BOOL getSitOverride() const;
void setSitOverride(BOOL yes);
bool getSitOverride() const;
void setSitOverride(bool override_sit);
BOOL getSmart() const;
void setSmart(BOOL yes);
bool getSmart() const;
void setSmart(bool smart);
BOOL getMouselookDisable() const;
void setMouselookDisable(BOOL yes);
bool getMouselookStandDisable() const;
void setMouselookStandDisable(bool disable);
BOOL getComplete() const;
void setComplete(BOOL yes);
bool getComplete() const;
void setComplete(bool complete);
const LLUUID& getMotion() const;
void setMotion(const LLUUID& motion);
BOOL getDirty() const;
void setDirty(BOOL yes);
bool getDirty() const;
void setDirty(bool dirty);
AOState* getState(S32 eName);
AOState* getStateByName(const std::string& name);
@ -128,12 +128,12 @@ class AOSet
LLUUID mInventoryID;
std::string mName;
BOOL mSitOverride;
BOOL mSmart;
BOOL mMouselookDisable;
BOOL mComplete;
bool mSitOverride;
bool mSmart;
bool mMouselookStandDisable;
bool mComplete;
LLUUID mCurrentMotion;
BOOL mDirty;
bool mDirty;
AOState mStates[AOSTATES_MAX];
};

View File

@ -1108,5 +1108,47 @@
<key>name</key>
<string>login.aurorascape.com:8002</string>
</map>
<key>vidadupla.com.br:8002</key>
<map>
<key>DirectoryFee</key>
<string>0</string>
<key>LastModified</key>
<date>2020-11-06T14:42:01.07Z</date>
<key>SendGridInfoToViewerOnLogin</key>
<string>true</string>
<key>about</key>
<string>http://vidadupla.com.br</string>
<key>gatekeeper</key>
<string>vidadupla.com.br:8002</string>
<key>gridname</key>
<string>Vida Dupla</string>
<key>gridnick</key>
<string>VD</string>
<key>helperuri</key>
<string>http://vidadupla.com.br/helper_scripts/helper/</string>
<key>login_identifier_types</key>
<array>
<string>agent</string>
<string>account</string>
</array>
<key>loginpage</key>
<string>http://vidadupla.com.br/splash</string>
<key>loginuri</key>
<array>
<string>http://vidadupla.com.br:8002/</string>
</array>
<key>name</key>
<string>vidadupla.com.br:8002</string>
<key>password</key>
<string>http://vidadupla.com.br:8002/wifi/forgotpassword</string>
<key>platform</key>
<string>OpenSim</string>
<key>register</key>
<string>http://vidadupla.com.br:8002/wifi/user/account/</string>
<key>search</key>
<string>http://vidadupla.com.br/ossearch/query.php</string>
<key>slurl_base</key>
<string>hop://vidadupla.com.br:8002/</string>
</map>
</map>
</llsd>

View File

@ -1,56 +1,56 @@
<llsd>
<map>
<key>febde518-eba6-1628-9070-a2c227852324</key>
<key>d6fee4de-09af-80b2-72c9-dd5eb509f18c</key>
<map>
<key>name</key>
<string>PS_T_Pose</string>
</map>
<key>8c607ae7-80a9-0004-5186-4e2bedafb256</key>
<key>63db3570-950d-089c-54c5-b406cb32635b</key>
<map>
<key>name</key>
<string>PS_Arms_Down_Legs_together</string>
</map>
<key>7ec0f76c-88ac-b9f2-778f-8fd95a30c7fc</key>
<key>46d5043d-6d86-c237-ab9c-c088d5608f37</key>
<map>
<key>name</key>
<string>PS_Arms_down_sitting</string>
</map>
<key>a0f213b6-5506-3cf8-32ac-cfc9684048e7</key>
<key>767d488a-faa5-aeca-128f-af0b196967f1</key>
<map>
<key>name</key>
<string>PS_Arms_downward_Legs_apart</string>
</map>
<key>9e95943d-8020-e622-a4e0-4c9f8058091a</key>
<key>c2a3ba2f-499f-6129-2c43-2085815b3c81</key>
<map>
<key>name</key>
<string>PS_Arms_downward_Legs_together</string>
</map>
<key>6c5e15de-7079-f558-d635-7123b7379dec</key>
<key>9e6fbfdb-d83e-a590-d59d-571c49002a7c</key>
<map>
<key>name</key>
<string>PS_Arms_forward_Legs_apart</string>
</map>
<key>58401663-f5d3-828c-6cb5-ff618308e6be</key>
<key>64d9b2e0-a124-b5fa-73f1-8703218f9aa8</key>
<map>
<key>name</key>
<string>PS_Arms_forward_Legs_together</string>
</map>
<key>7598be4b-6b1d-afaf-bc5e-0708fa3c214a</key>
<key>a5b4ae9f-05d2-998f-5ca5-63ac5cfdf595</key>
<map>
<key>name</key>
<string>PS_Arms_straight_Legs_apart</string>
</map>
<key>5acb15c0-1b14-6276-bd52-afdaad13cc1d</key>
<key>16ca97b1-732d-8964-f044-1575d8bc2f98</key>
<map>
<key>name</key>
<string>PS_Arms_straight_sitting</string>
</map>
<key>b28ee0ca-81b3-82f0-c3a3-5308efacf774</key>
<key>284ff48c-5f45-8351-c459-020f0bc1cd77</key>
<map>
<key>name</key>
<string>PS_Arms_upward_Legs_apart</string>
</map>
<key>e2f67928-18ab-3991-4612-658cd88a1b4f</key>
<key>76e563a3-6a97-0487-f8dc-70a673fa58d8</key>
<map>
<key>name</key>
<string>PS_Arms_upward_Legs_together</string>

View File

@ -9118,6 +9118,188 @@
<key>Backup</key>
<integer>0</integer>
</map>
<key>MeshPreviewCanvasColor</key>
<map>
<key>Comment</key>
<string>Canvas colour for the Mesh uploader</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.169</real>
<real>0.169</real>
<real>0.169</real>
<real>1.0</real>
</array>
</map>
<key>MeshPreviewEdgeColor</key>
<map>
<key>Comment</key>
<string>Edge colour for the Mesh uploader preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.4</real>
<real>0.4</real>
<real>0.4</real>
<real>1.0</real>
</array>
</map>
<key>MeshPreviewBaseColor</key>
<map>
<key>Comment</key>
<string>base diffuse colour for the Mesh uploader</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.5</real>
<real>0.5</real>
<real>0.5</real>
<real>1.0</real>
</array>
</map>
<key>MeshPreviewBrightnessColor</key>
<map>
<key>Comment</key>
<string>Brightness modifier</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color3</string>
<key>Value</key>
<array>
<real>0.9</real>
<real>0.9</real>
<real>0.9</real>
</array>
</map>
<key>MeshPreviewEdgeWidth</key>
<map>
<key>Comment</key>
<string>line thickness used when display edges is selected in mesh preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>MeshPreviewPhysicsEdgeColor</key>
<map>
<key>Comment</key>
<string>Edge colour for the Mesh uploader physics preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.0</real>
<real>0.25</real>
<real>0.5</real>
<real>0.25</real>
</array>
</map>
<key>MeshPreviewPhysicsFillColor</key>
<map>
<key>Comment</key>
<string>Fill colour for the Mesh uploader physics preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>0.0</real>
<real>0.5</real>
<real>1.0</real>
<real>0.5</real>
</array>
</map>
<key>MeshPreviewPhysicsEdgeWidth</key>
<map>
<key>Comment</key>
<string>line thickness used when display physics is selected in mesh preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>1.0</real>
</map>
<key>MeshPreviewDegenerateEdgeColor</key>
<map>
<key>Comment</key>
<string>Edge colour for the Mesh uploader Degenerate preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>1.0</real>
<real>0.0</real>
<real>0.0</real>
<real>1.0</real>
</array>
</map>
<key>MeshPreviewDegenerateFillColor</key>
<map>
<key>Comment</key>
<string>Fill colour for the Mesh uploader Degenerate preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Color4</string>
<key>Value</key>
<array>
<real>1.0</real>
<real>0.0</real>
<real>0.0</real>
<real>0.5</real>
</array>
</map>
<key>MeshPreviewDegenerateEdgeWidth</key>
<map>
<key>Comment</key>
<string>line thickness used when display Degenerate is selected in mesh preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>3.0</real>
</map>
<key>MeshPreviewDegeneratePointSize</key>
<map>
<key>Comment</key>
<string>Large point size used to highlight degenerate triangle vertices in Mesh preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>8.0</real>
</map>
<key>MeshPreviewZoomLimit</key>
<map>
<key>Comment</key>
<string>Maximum Zoom level in preview</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>10.0</real>
</map>
<key>FSMeshPreviewUVGuideFile</key>
<map>
<key>Comment</key>
@ -10474,6 +10656,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>13</integer>
</map>
<key>PreviewRenderSize</key>
<map>
<key>Comment</key>
<string>Resolution of the image rendered for the mesh upload preview (must be a power of 2)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>1024</integer>
</map>
<key>PreviewAmbientColor</key>
<map>
<key>Comment</key>
@ -12517,7 +12710,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>RenderGLCoreProfile</key>
<map>
<key>Comment</key>
<string>Don't use a compatibility profile OpenGL context. Requires restart. Basic shaders MUST be enabled.</string>
<string>Don't use a compatibility profile OpenGL context. Requires restart.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -14999,7 +15192,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Comment</key>
<string>SyncMaterialSettings</string>
<key>Persist</key>
<integer>1</integer>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
@ -24626,6 +24819,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSLegacyNotificationWellAutoResize</key>
<map>
<key>Comment</key>
<string>Enables the automatic resizing of the legacy notifications and system messages well</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSShowIMSendButton</key>
<map>
<key>Comment</key>
@ -25252,5 +25456,71 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSAllowWaterDistortionOcclusion</key>
<map>
<key>Comment</key>
<string>If allowed, object occlusion setting will be restored for generating the water reflection distortion. This was allowed pre-EEP and got disabled for EEP. While generating is more exact without occlusion, it can cause a huge performance impact.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSDynamicTextureMemory</key>
<map>
<key>Comment</key>
<string>If enabled, Firestorm dynamically uses available memory for textures</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>FSDynamicTextureMemoryCacheReserve</key>
<map>
<key>Comment</key>
<string>Percentage of total physical GPU memory to reserve for textures loaded, but currently not being rendered</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>10</integer>
</map>
<key>FSDynamicTextureMemoryGPUReserve</key>
<map>
<key>Comment</key>
<string>Percentage of total physical video memory to reserve for other usage</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>10</integer>
</map>
<key>FSDynamicTextureMemoryMinTextureMemory</key>
<map>
<key>Comment</key>
<string>Minimum amount of GPU memory in Megabytes that should be used for textures (takes reserves and total physical GPU memory into account)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>512</integer>
</map>
<key>FSAllowDoubleClickOnScriptedObjects</key>
<map>
<key>Comment</key>
<string>If enabled, allows double-click movement action (walk/teleport) to scripted objects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
</map>
</llsd>

View File

@ -91,7 +91,7 @@ void main()
// Collect normal lights (need to be divided by two, as we later multiply by 2)
col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
col.rgb += light_diffuse[2].rgb * calcDirectionalLight(norm, light_position[2].xyz);
col.rgb += light_diffuse[3].rgb * calcDirectionalLight(norm, light_position[3].xyz);
col.rgb += light_diffuse[2].rgb*calcLocalLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z);
col.rgb += light_diffuse[3].rgb*calcLocalLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z);
vertex_color = col*color;
}

View File

@ -181,7 +181,7 @@ class FSViewerManifest:
os.rename("%s/firestorm-symbols-%s-%d.tar.bz2" % (self.args['configuration'].lower(), osname, self.address_size), sName)
# New llmanifest is braindead and does not allow any optional files. for some files.
# New llmanifest is braindead and does not allow any optional files.
# For some files likes jemalloc or openjpeg it makes sense to allow them to be abesent
def fs_try_path( self, src, dst=None ):
if self.path( src,dst ) == 0:

View File

@ -65,6 +65,7 @@
#include "llstring.h"
#include "llurlaction.h"
#include "llviewercontrol.h"
#include "llviewermenu.h"
#include "llviewernetwork.h"
#include "fscommon.h"
@ -156,6 +157,18 @@ public:
{
mAvatarNameCacheConnection.disconnect();
}
auto menu = mPopupMenuHandleAvatar.get();
if (menu)
{
menu->die();
mPopupMenuHandleAvatar.markDead();
}
menu = mPopupMenuHandleObject.get();
if (menu)
{
menu->die();
mPopupMenuHandleObject.markDead();
}
}
BOOL handleMouseUp(S32 x, S32 y, MASK mask)
@ -557,36 +570,6 @@ public:
BOOL postBuild()
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
registrar.add("AvatarIcon.Action", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
registrar_enable.add("AvatarIcon.Check", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
registrar_enable.add("AvatarIcon.Enable", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2));
registrar_enable.add("AvatarIcon.Visible", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2));
registrar.add("ObjectIcon.Action", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
registrar_enable.add("ObjectIcon.Visible", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (menu)
{
mPopupMenuHandleAvatar = menu->getHandle();
}
else
{
LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL;
}
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (menu)
{
mPopupMenuHandleObject = menu->getHandle();
}
else
{
LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL;
}
setDoubleClickCallback(boost::bind(&FSChatHistoryHeader::showInspector, this));
setMouseEnterCallback(boost::bind(&FSChatHistoryHeader::showInfoCtrl, this));
@ -930,14 +913,57 @@ protected:
void showObjectContextMenu(S32 x,S32 y)
{
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get();
if(menu)
if (!menu)
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
registrar.add("ObjectIcon.Action", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
registrar_enable.add("ObjectIcon.Visible", boost::bind(&FSChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (menu)
{
mPopupMenuHandleObject = menu->getHandle();
menu->updateParent(LLMenuGL::sMenuContainer);
LLMenuGL::showPopup(this, menu, x, y);
}
else
{
LL_WARNS() << " Failed to create menu_object_icon.xml" << LL_ENDL;
}
}
else
{
LLMenuGL::showPopup(this, menu, x, y);
}
}
void showAvatarContextMenu(S32 x,S32 y)
{
LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleAvatar.get();
if (!menu)
{
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar registrar_enable;
registrar.add("AvatarIcon.Action", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
registrar_enable.add("AvatarIcon.Check", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
registrar_enable.add("AvatarIcon.Enable", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemEnabled, this, _2));
registrar_enable.add("AvatarIcon.Visible", boost::bind(&FSChatHistoryHeader::onAvatarIconContextMenuItemVisible, this, _2));
menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
if (menu)
{
mPopupMenuHandleAvatar = menu->getHandle();
}
else
{
LL_WARNS() << " Failed to create menu_avatar_icon.xml" << LL_ENDL;
}
}
if(menu)
{
bool is_friend = LLAvatarActions::isFriend(mAvatarID);

View File

@ -1012,12 +1012,14 @@ LLSD FSData::getSystemInfo()
LLSD info = LLAppViewer::instance()->getViewerInfo();
std::string sysinfo1("\n");
sysinfo1 += llformat("%s %s (%d) %s %s (%s %dbit) %s\n\n", LLAppViewer::instance()->getSecondLifeTitle().c_str(),
LLVersionInfo::getInstance()->getShortVersion().c_str(),
LLVersionInfo::getInstance()->getBuild(),
info["BUILD_DATE"].asString().c_str(), info["BUILD_TIME"].asString().c_str(),
LLVersionInfo::getInstance()->getChannel().c_str(),
info["ADDRESS_SIZE"].asInteger(), info["BUILD_TYPE"].asString().c_str());
sysinfo1 += llformat("%s %s (%d) %s %s (%s %dbit / %s) %s\n\n", LLAppViewer::instance()->getSecondLifeTitle().c_str(),
LLVersionInfo::getInstance()->getShortVersion().c_str(),
LLVersionInfo::getInstance()->getBuild(),
info["BUILD_DATE"].asString().c_str(), info["BUILD_TIME"].asString().c_str(),
LLVersionInfo::getInstance()->getChannel().c_str(),
info["ADDRESS_SIZE"].asInteger(),
info["SIMD"].asString().c_str(),
info["BUILD_TYPE"].asString().c_str());
sysinfo1 += llformat("Build with %s version %s\n\n", info["COMPILER"].asString().c_str(), info["COMPILER_VERSION"].asString().c_str());
sysinfo1 += llformat("I am in %s located at %s (%s)\n", info["REGION"].asString().c_str(), info["HOSTNAME"].asString().c_str(), info["HOSTIP"].asString().c_str());
sysinfo1 += llformat("%s\n\n", info["SERVER_VERSION"].asString().c_str());
@ -1027,7 +1029,8 @@ LLSD FSData::getSystemInfo()
sysinfo1 += llformat("OS: %s\n", info["OS_VERSION"].asString().c_str());
sysinfo1 += llformat("Graphics Card Vendor: %s\n", info["GRAPHICS_CARD_VENDOR"].asString().c_str());
sysinfo1 += llformat("Graphics Card: %s\n", info["GRAPHICS_CARD"].asString().c_str());
sysinfo1 += llformat("Graphics Card Memory: %d MB\n", info["GRAPHICS_CARD_MEMORY"].asInteger());
if (info.has("GRAPHICS_DRIVER_VERSION"))
{
sysinfo1 += llformat("Graphics Card Driver Version: %s\n", info["GRAPHICS_DRIVER_VERSION"].asString().c_str());
@ -1058,9 +1061,16 @@ LLSD FSData::getSystemInfo()
sysinfo2 += llformat("Draw Distance: %d m\n", info["DRAW_DISTANCE"].asInteger());
sysinfo2 += llformat("Bandwidth: %d kbit/s\n", info["BANDWIDTH"].asInteger());
sysinfo2 += llformat("LOD Factor: %.3f\n", info["LOD"].asReal());
sysinfo2 += llformat("Render quality: %s\n", info["RENDERQUALITY_FSDATA_ENGLISH"].asString().c_str()); // <FS:PP> FIRE-4785: Current render quality setting in sysinfo / about floater
sysinfo2 += llformat("Render quality: %s\n", info["RENDERQUALITY_FSDATA_ENGLISH"].asString().c_str());
sysinfo2 += llformat("ALM enabled: %s\n", info["ALMSTATUS_FSDATA_ENGLISH"].asString().c_str());
sysinfo2 += llformat("Texture memory: %d MB (%.2f)\n", info["TEXTUREMEMORY"].asInteger(), info["TEXTUREMEMORYMULTIPLIER"].asReal());
if (info["TEXTUREMEMORYDYNAMIC"].asBoolean())
{
sysinfo2 += llformat("Texture memory: Dynamic (%d MB min / %d%% Cache / %d%% VRAM)\n", info["TEXTUREMEMORYMIN"].asInteger(), info["TEXTUREMEMORYCACHERESERVE"].asInteger(), info["TEXTUREMEMORYGPURESERVE"].asInteger());
}
else
{
sysinfo2 += llformat("Texture memory: %d MB (%.2f)\n", info["TEXTUREMEMORY"].asInteger(), info["TEXTUREMEMORYMULTIPLIER"].asReal());
}
sysinfo2 += "VFS (cache) creation time (UTC) " + info["VFS_DATE"].asString();
LLSD sysinfos;

View File

@ -105,8 +105,7 @@ bool FSExportPermsCheck::canExportNode(LLSelectNode* node, bool dae)
{
if (dae)
{
LLSD mesh_header = gMeshRepo.getMeshHeader(sculpt_params->getSculptTexture());
exportable = mesh_header["creator"].asUUID() == gAgentID;
exportable = gMeshRepo.getCreatorFromHeader(sculpt_params->getSculptTexture()) == gAgentID;
}
else
{

View File

@ -36,8 +36,8 @@
#include "llslurl.h"
FSFloaterAddToContactSet::FSFloaterAddToContactSet(const LLSD& target)
: LLFloater(target)
, mContactSetsCombo(NULL)
: LLFloater(target),
mContactSetsCombo(NULL)
{
if (target.isArray())
{
@ -56,6 +56,14 @@ FSFloaterAddToContactSet::FSFloaterAddToContactSet(const LLSD& target)
mContactSetChangedConnection = LGGContactSets::getInstance()->setContactSetChangeCallback(boost::bind(&FSFloaterAddToContactSet::updateSets, this, _1));
}
FSFloaterAddToContactSet::~FSFloaterAddToContactSet()
{
if (mContactSetChangedConnection.connected())
{
mContactSetChangedConnection.disconnect();
}
}
BOOL FSFloaterAddToContactSet::postBuild()
{
if (mHasMultipleAgents)

View File

@ -43,7 +43,7 @@ public:
BOOL postBuild();
private:
~FSFloaterAddToContactSet(){};
~FSFloaterAddToContactSet();
void onClickAdd();
void onClickCancel();
void onClickAddSet();

View File

@ -63,22 +63,13 @@ BOOL FSFloaterContactSetConfiguration::postBuild()
mRenameButton->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onRenameSet, this));
mSetSwatch = getChild<LLColorSwatchCtrl>("set_swatch");
if (mSetSwatch)
{
mSetSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetColor, this));
}
mSetSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetColor, this));
mGlobalSwatch = getChild<LLColorSwatchCtrl>("global_swatch");
if (mGlobalSwatch)
{
mGlobalSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitDefaultColor, this));
}
mGlobalSwatch->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitDefaultColor, this));
mNotificationCheckBox = getChild<LLCheckBoxCtrl>("show_set_notifications");
if (mNotificationCheckBox)
{
mNotificationCheckBox->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetNotifications, this));
}
mNotificationCheckBox->setCommitCallback(boost::bind(&FSFloaterContactSetConfiguration::onCommitSetNotifications, this));
return TRUE;
}

View File

@ -32,7 +32,6 @@
#include "lfsimfeaturehandler.h"
#include "llagent.h"
//#include "llagentconstants.h"
#include "llagentdata.h"
#include "llavatarnamecache.h"
#include "llbufferstream.h"
@ -212,6 +211,15 @@ FSFloaterObjectExport::~FSFloaterObjectExport()
{
gIdleCallbacks.deleteFunction(FSFloaterObjectExport::onIdle, this);
}
for (const auto& object_id : mInventoryRequests)
{
LLViewerObject* object = gObjectList.findObject(object_id);
if (object)
{
object->removeInventoryListener(this);
}
}
}
BOOL FSFloaterObjectExport::postBuild()
@ -1098,7 +1106,7 @@ void FSFloaterObjectExport::onExportFileSelected(const std::vector<std::string>&
if (!exportSelection())
{
LLNotificationsUtil::add("ExportFailed");
//closeFloater();
closeFloater();
}
}

View File

@ -42,6 +42,7 @@
#include "fsfloaterim.h"
#include "llimview.h"
#include "llfloaterreg.h"
#include "lloutputmonitorctrl.h"
#include "fsparticipantlist.h"
#include "llspeakers.h"
#include "lltextutil.h"

View File

@ -587,17 +587,23 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state)
if (FETCH == state || RETRY == state)
{
std::string grid = utf8str_tolower(grid_entry->grid[GRID_VALUE]);
// FIRE-24068 allow https support - based on patch by unregi resident
std::string uri;
std::string match = "://";
size_t find_scheme = grid.find(match);
if ( std::string::npos != find_scheme)
{
// We only support http so just remove anything the user might have chosen
grid.erase(0,find_scheme+match.length());
grid_entry->grid[GRID_VALUE] = grid;
uri = grid; // assign the full URI
grid.erase(0, find_scheme + match.length()); // trim the protocol
grid_entry->grid[GRID_VALUE] = grid; // keep the name
}
else
{
// no protocol was specified let's assume http
// GRID_VALUE remains unchanged
uri = "http://" + grid;
}
std::string uri = "http://" + grid;
if (std::string::npos != uri.find("lindenlab.com"))
{
@ -762,6 +768,8 @@ void LLGridManager::addGrid(GridEntry* grid_entry, AddState state)
if (existing_grid.has("DEPRECATED"))
{
LL_DEBUGS("GridManager") << "Removing entry marked as deprecated in the fallback list: " << grid << LL_ENDL;
mGridList[grid] = grid_entry->grid;
list_changed = true;
}
else if (grid_entry->grid.has("USER_DELETED"))
{

View File

@ -75,20 +75,14 @@ BOOL FSPanelContactSets::postBuild()
childSetAction("remove_displayname_btn", boost::bind(&FSPanelContactSets::onClickRemoveDisplayName, this));
mContactSetCombo = getChild<LLComboBox>("combo_sets");
if (mContactSetCombo)
{
mContactSetCombo->setCommitCallback(boost::bind(&FSPanelContactSets::refreshSetList, this));
refreshContactSets();
}
mContactSetCombo->setCommitCallback(boost::bind(&FSPanelContactSets::refreshSetList, this));
refreshContactSets();
mAvatarList = getChild<LLAvatarList>("contact_list");
if (mAvatarList)
{
mAvatarList->setCommitCallback(boost::bind(&FSPanelContactSets::onSelectAvatar, this));
mAvatarList->setNoItemsCommentText(getString("empty_list"));
mAvatarList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
generateAvatarList(mContactSetCombo->getValue().asString());
}
mAvatarList->setCommitCallback(boost::bind(&FSPanelContactSets::onSelectAvatar, this));
mAvatarList->setNoItemsCommentText(getString("empty_list"));
mAvatarList->setContextMenu(&LLPanelPeopleMenus::gPeopleContextMenu);
generateAvatarList(mContactSetCombo->getValue().asString());
return TRUE;
}
@ -324,22 +318,24 @@ void FSPanelContactSets::onClickSetPseudonym()
void FSPanelContactSets::onClickRemovePseudonym()
{
LGGContactSets& contact_sets = LGGContactSets::instance();
for (auto const& id : mAvatarSelections)
{
if (LGGContactSets::getInstance()->hasPseudonym(id))
if (contact_sets.hasPseudonym(id))
{
LGGContactSets::getInstance()->clearPseudonym(id);
contact_sets.clearPseudonym(id);
}
}
}
void FSPanelContactSets::onClickRemoveDisplayName()
{
LGGContactSets& contact_sets = LGGContactSets::instance();
for (auto const& id : mAvatarSelections)
{
if (!LGGContactSets::getInstance()->hasDisplayNameRemoved(id))
if (!contact_sets.hasDisplayNameRemoved(id))
{
LGGContactSets::getInstance()->removeDisplayName(id);
contact_sets.removeDisplayName(id);
}
}
}

View File

@ -1110,9 +1110,11 @@ void FSPanelLogin::onSelectServer()
LLGridManager::getInstance()->addGridListChangedCallback(boost::bind(&FSPanelLogin::gridListChanged, this, _1));
LLGridManager::getInstance()->addGrid(sPendingNewGridURI);
}
else
#endif
LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
{
LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
}
/*
* Determine whether or not the value in the start_location_combo makes sense
@ -1385,9 +1387,12 @@ void FSPanelLogin::updateServerCombo()
if (!sPendingNewGridURI.empty())
{
LLSD grid_name = LLGridManager::getInstance()->getGridByAttribute(GRID_LOGIN_URI_VALUE, sPendingNewGridURI, false);
LL_INFOS("AppInit") << "new grid for ["<<sPendingNewGridURI<<"]=["<< (grid_name.isUndefined()?"FAILED TO ADD":grid_name.asString())<< "]"<<LL_ENDL;
server_choice_combo->setSelectedByValue(grid_name, true);
LLGridManager::getInstance()->setGridChoice(grid_name.asString());
LL_INFOS("AppInit") << "new grid for ["<<sPendingNewGridURI<<"]=["<< ((grid_name.isUndefined() || grid_name.asString().length()==0)?"FAILED TO ADD":grid_name.asString())<< "]"<<LL_ENDL;
if(!grid_name.isUndefined() && grid_name.asString().length()!=0)
{
server_choice_combo->setSelectedByValue(grid_name, true);
LLGridManager::getInstance()->setGridChoice(grid_name.asString());
}
}
#endif

View File

@ -66,6 +66,7 @@
#include "llparcel.h"
#include "lltrans.h"
#include "llviewercontrol.h"
#include "llviewermenu.h"
#include "llviewernetwork.h" //LLGridManager
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"

View File

@ -37,6 +37,7 @@
#include "llimview.h"
#include "llnotifications.h"
#include "llnotificationsutil.h"
#include "lloutputmonitorctrl.h"
#include "llspeakers.h"
#include "llviewercontrol.h"
#include "llviewermenu.h"

View File

@ -176,9 +176,17 @@ void FSRadar::updateRadarList()
LLWorld* world = LLWorld::getInstance();
LLMuteList* mutelist = LLMuteList::getInstance();
FSAssetBlacklist* blacklist = FSAssetBlacklist::getInstance();
LGGContactSets* contactsets = LGGContactSets::getInstance();
LLLocalSpeakerMgr* speakermgr = LLLocalSpeakerMgr::getInstance();
LLVoiceClient* voice_client = LLVoiceClient::getInstance();
LLViewerParcelMgr& parcelmgr = LLViewerParcelMgr::instance();
LLUIColorTable& colortable = LLUIColorTable::instance();
LLAvatarTracker& avatartracker = LLAvatarTracker::instance();
FSLSLBridge& bridge = FSLSLBridge::instance();
const F32 chat_range_say = LFSimFeatureHandler::getInstance()->sayRange();
const F32 chat_range_shout = LFSimFeatureHandler::getInstance()->shoutRange();
LFSimFeatureHandler& simfeaturehandler = LFSimFeatureHandler::instance();
const F32 chat_range_say = simfeaturehandler.sayRange();
const F32 chat_range_shout = simfeaturehandler.shoutRange();
static const std::string str_chat_entering = LLTrans::getString("entering_chat_range");
static const std::string str_chat_leaving = LLTrans::getString("leaving_chat_range");
@ -205,7 +213,7 @@ void FSRadar::updateRadarList()
static LLCachedControl<bool> sFSRadarColorNamesByDistance(gSavedSettings, "FSRadarColorNamesByDistance", false);
static LLCachedControl<bool> sFSRadarShowMutedAndDerendered(gSavedSettings, "FSRadarShowMutedAndDerendered");
static LLCachedControl<bool> sFSRadarEnhanceByBridge(gSavedSettings, "FSRadarEnhanceByBridge");
bool sUseLSLBridge = FSLSLBridge::instance().canUseBridge();
bool sUseLSLBridge = bridge.canUseBridge();
F32 drawRadius(sRenderFarClip);
const LLVector3d& posSelf = gAgent.getPositionGlobal();
@ -272,8 +280,8 @@ void FSRadar::updateRadarList()
mEntryList[avid] = new FSRadarEntry(avid);
}
LLLocalSpeakerMgr::getInstance()->update(TRUE);
speakermgr->update(TRUE);
//STEP 2: Transform detected model list data into more flexible multimap data structure;
//TS: Count avatars in chat range and in the same region
U32 inChatRange = 0;
@ -333,7 +341,7 @@ void FSRadar::updateRadarList()
avRegion = reg->getRegionID();
}
bool isInSameRegion = (avRegion == regionSelf);
bool isOnSameParcel = LLViewerParcelMgr::instance().inAgentParcel(avPos);
bool isOnSameParcel = parcelmgr.inAgentParcel(avPos);
S32 seentime = (S32)difftime(now, ent->mFirstSeen);
S32 hours = (S32)(seentime / 3600);
S32 mins = (S32)((seentime - hours * 3600) / 60);
@ -524,7 +532,7 @@ void FSRadar::updateRadarList()
entry["age"] = (avAge > -1 ? llformat("%d", avAge) : "");
if (ent->hasAlertAge())
{
entry_options["age_color"] = LLUIColorTable::instance().getColor("AvatarListItemAgeAlert", LLColor4::red).get().getValue();
entry_options["age_color"] = colortable.getColor("AvatarListItemAgeAlert", LLColor4::red).get().getValue();
if (sRadarAvatarAgeAlert && !ent->hasAgeAlertPerformed())
{
@ -549,21 +557,21 @@ void FSRadar::updateRadarList()
{
if (avRange <= chat_range_say)
{
range_color = LLUIColorTable::instance().getColor("AvatarListItemChatRange", LLColor4::red);
range_color = colortable.getColor("AvatarListItemChatRange", LLColor4::red);
inChatRange++;
}
else if (avRange <= chat_range_shout)
{
range_color = LLUIColorTable::instance().getColor("AvatarListItemShoutRange", LLColor4::white);
range_color = colortable.getColor("AvatarListItemShoutRange", LLColor4::white);
}
else
{
range_color = LLUIColorTable::instance().getColor("AvatarListItemBeyondShoutRange", LLColor4::white);
range_color = colortable.getColor("AvatarListItemBeyondShoutRange", LLColor4::white);
}
}
else
{
range_color = LLUIColorTable::instance().getColor("AvatarListItemBeyondShoutRange", LLColor4::white);
range_color = colortable.getColor("AvatarListItemBeyondShoutRange", LLColor4::white);
}
entry_options["range_color"] = range_color.get().getValue();
@ -579,7 +587,7 @@ void FSRadar::updateRadarList()
// Set friends colors / styles
LLFontGL::StyleFlags nameCellStyle = LLFontGL::NORMAL;
const LLRelationship* relation = LLAvatarTracker::instance().getBuddyInfo(avId);
const LLRelationship* relation = avatartracker.getBuddyInfo(avId);
if (relation && !sFSLegacyRadarFriendColoring && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))
{
nameCellStyle = (LLFontGL::StyleFlags)(nameCellStyle | LLFontGL::BOLD);
@ -590,18 +598,17 @@ void FSRadar::updateRadarList()
}
entry_options["name_style"] = nameCellStyle;
LLColor4 name_color = LLUIColorTable::instance().getColor("AvatarListItemIconDefaultColor", LLColor4::white).get();
name_color = LGGContactSets::getInstance()->colorize(avId, (sFSRadarColorNamesByDistance ? range_color.get() : name_color), LGG_CS_RADAR);
LLColor4 name_color = colortable.getColor("AvatarListItemIconDefaultColor", LLColor4::white).get();
name_color = contactsets->colorize(avId, (sFSRadarColorNamesByDistance ? range_color.get() : name_color), LGG_CS_RADAR);
LGGContactSets::getInstance()->hasFriendColorThatShouldShow(avId, LGG_CS_RADAR, name_color);
contactsets->hasFriendColorThatShouldShow(avId, LGG_CS_RADAR, name_color);
entry_options["name_color"] = name_color.getValue();
// Voice power level indicator
LLVoiceClient* voice_client = LLVoiceClient::getInstance();
if (voice_client->voiceEnabled() && voice_client->isVoiceWorking())
{
LLSpeaker* speaker = LLLocalSpeakerMgr::getInstance()->findSpeaker(avId);
LLSpeaker* speaker = speakermgr->findSpeaker(avId);
if (speaker && speaker->isInVoiceChannel())
{
EVoicePowerLevel power_level = voice_client->getPowerLevel(avId);
@ -656,7 +663,7 @@ void FSRadar::updateRadarList()
if (++updatesPerRequest > FSRADAR_MAX_OFFSET_REQUESTS)
{
msg = msg.substr(0, msg.size() - 1);
FSLSLBridge::instance().viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success);
bridge.viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success);
//LL_INFOS() << " OFFSET REQUEST SEGMENT"<< prefix << msg << LL_ENDL;
msg = "";
updatesPerRequest = 0;
@ -665,7 +672,7 @@ void FSRadar::updateRadarList()
if (updatesPerRequest > 0)
{
msg = msg.substr(0, msg.size() - 1);
FSLSLBridge::instance().viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success);
bridge.viewerToLSL(prefix + msg, FSLSLBridgeRequestRadarPos_Success);
//LL_INFOS() << " OFFSET REQUEST FINAL " << prefix << msg << LL_ENDL;
}

View File

@ -147,10 +147,9 @@ bool RegionCrossExtrapolate::ifsaton(const LLViewerObject& vo) // true if root
return false; // not root, cannot be sat upon
}
for (auto iter = vo.getChildren().begin(); // check for avatar as child of root
iter != vo.getChildren().end(); iter++)
LLViewerObject::const_child_list_t& children = vo.getChildren();
for (const auto child : children)
{
LLViewerObject* child = *iter;
if (child->isAvatar())
{
return true;

View File

@ -154,6 +154,7 @@ Var SKIP_DIALOGS # Set from command line in .onInit. autoinstall GUI and
# Var SKIP_AUTORUN # Skip automatic launch of the viewer after install -- <FS:PP> Commented out: Disable autorun
Var DO_UNINSTALL_V2 # If non-null, path to a previous Viewer 2 installation that will be uninstalled.
Var NO_STARTMENU # <FS:Ansariel> Optional start menu entry
Var FRIENDLY_APP_NAME # <FS:Ansariel> FIRE-30446: Set FriendlyAppName for protocols
# Function definitions should go before file includes, because calls to
# DLLs like LangDLL trigger an implicit file include, so if that call is at
@ -450,6 +451,15 @@ ${Else}
WriteRegDWORD SHELL_CONTEXT "${MSUNINSTALL_KEY}" "EstimatedSize" "0x00061800" # 390 MB
${EndIf}
# <FS:Ansariel> FIRE-30446: Set FriendlyAppName for protocols
${If} ${ISOPENSIM} == "1"
StrCpy $FRIENDLY_APP_NAME "${INSTNAME} $(ForOpenSimSuffix)"
${Else}
StrCpy $FRIENDLY_APP_NAME "${INSTNAME}"
${EndIf}
# </FS:Ansariel>
# from FS:Ansariel
WriteRegStr SHELL_CONTEXT "${MSUNINSTALL_KEY}" "DisplayIcon" '"$INSTDIR\$VIEWER_EXE"'
@ -469,18 +479,33 @@ WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE
# URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
# MAINT-8305: On SLURL click, directly invoke the viewer, not the launcher.
WriteRegExpandStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "(default)" "URL:Second Life"
# <FS:Ansariel> FIRE-30446: Set FriendlyAppName for protocols
WriteRegStr HKEY_CLASSES_ROOT "${URLNAME}\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME"
WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "(default)" "URL:Hypergrid"
WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info" "URL Protocol" ""
WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
# URL param must be last item passed to viewer, it ignores subsequent params to avoid parameter injection attacks.
WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
# <FS:Ansariel> FIRE-30446: Set FriendlyAppName for protocols
WriteRegStr HKEY_CLASSES_ROOT "x-grid-location-info\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME"
# <FS:Ansariel> FIRE-30446: Register x-grid-info hypergrid protocol
WriteRegStr HKEY_CLASSES_ROOT "x-grid-info" "(default)" "URL:Hypergrid"
WriteRegStr HKEY_CLASSES_ROOT "x-grid-info" "URL Protocol" ""
WriteRegStr HKEY_CLASSES_ROOT "x-grid-info\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
WriteRegExpandStr HKEY_CLASSES_ROOT "x-grid-info\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
WriteRegStr HKEY_CLASSES_ROOT "x-grid-info\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME"
# <FS:CR> Register hop:// protocol registry info
WriteRegStr HKEY_CLASSES_ROOT "hop" "(default)" "URL:Second Life"
WriteRegStr HKEY_CLASSES_ROOT "hop" "URL Protocol" ""
WriteRegStr HKEY_CLASSES_ROOT "hop\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
WriteRegExpandStr HKEY_CLASSES_ROOT "hop\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
${If} ${ISOPENSIM} == "1"
WriteRegStr HKEY_CLASSES_ROOT "hop" "(default)" "URL:Hypergrid"
WriteRegStr HKEY_CLASSES_ROOT "hop" "URL Protocol" ""
WriteRegStr HKEY_CLASSES_ROOT "hop\DefaultIcon" "" '"$INSTDIR\$VIEWER_EXE"'
WriteRegExpandStr HKEY_CLASSES_ROOT "hop\shell\open\command" "" '"$INSTDIR\$VIEWER_EXE" -url "%1"'
WriteRegStr HKEY_CLASSES_ROOT "hop\shell\open" "FriendlyAppName" "$FRIENDLY_APP_NAME"
${EndIf}
# </FS:CR>
# <FS:Ansariel> Ask before creating protocol registry entries
@ -732,8 +757,11 @@ Push $2
Delete "$2\AppData\Roaming\Firestorm\plugin_cookies.txt"
Delete "$2\AppData\Roaming\Firestorm\typed_locations.txt"
# Delete files in \Users\<User>\AppData\Local\Firestorm
RMDir /r "$2\AppData\Local\Firestorm" #Delete the Havok cache folder
RMDir /r "$2\AppData\Local\FirestormOS" #Delete the OpenSim cache folder
${If} ${ISOPENSIM} == "0"
RMDir /r "$2\AppData\Local\Firestorm" #Delete the Havok cache folder
${Else}
RMDir /r "$2\AppData\Local\FirestormOS" #Delete the OpenSim cache folder
${EndIf}
CONTINUE:
IntOp $0 $0 + 1
@ -806,12 +834,18 @@ NOFOLDER:
MessageBox MB_YESNO $(DeleteRegistryKeysMB) IDYES DeleteKeys IDNO NoDelete
DeleteKeys:
DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\hop" # <FS:Ansariel> Unregister hop:// protocol registry info
DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-info" # <FS:Ansariel> FIRE-30446: Register x-grid-info hypergrid protocol
DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\x-grid-location-info"
DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\secondlife"
DeleteRegKey HKEY_CLASSES_ROOT "hop" # <FS:Ansariel> Unregister hop:// protocol registry info
DeleteRegKey HKEY_CLASSES_ROOT "x-grid-info" # <FS:Ansariel> FIRE-30446: Register x-grid-info hypergrid protocol
DeleteRegKey HKEY_CLASSES_ROOT "x-grid-location-info"
DeleteRegKey HKEY_CLASSES_ROOT "secondlife"
# <FS:Ansariel> Unregister hop:// protocol registry info
${If} ${ISOPENSIM} == "1"
DeleteRegKey SHELL_CONTEXT "SOFTWARE\Classes\hop"
DeleteRegKey HKEY_CLASSES_ROOT "hop"
${EndIf}
# </FS:Ansariel>
NoDelete:

Some files were not shown because too many files have changed in this diff Show More