Merge viewer-neko

master
Ansariel 2018-02-27 18:08:48 +01:00
commit c4e18fbcaa
41 changed files with 437 additions and 4137 deletions

View File

@ -1577,16 +1577,21 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC
}
alpha_data = new U8[width * height];
mAlphaCache[cache_index] = alpha_data;
// <FS:Ansariel> Format GL_ALPHA is invalid for glReadPixels
//glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data);
U8* alpha_buffer = new U8[width * height * 4];
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, alpha_buffer);
for (S32 i = 0; i < width * height; ++i)
// nSight doesn't support use of glReadPixels
if (!LLRender::sNsightDebugSupport)
{
alpha_data[i] = alpha_buffer[i * 4 + 3];
// <FS:Ansariel> Format GL_ALPHA is invalid for glReadPixels
//glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data);
U8* alpha_buffer = new U8[width * height * 4];
glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, alpha_buffer);
for (S32 i = 0; i < width * height; ++i)
{
alpha_data[i] = alpha_buffer[i * 4 + 3];
}
delete[] alpha_buffer;
// </FS:Ansariel>
}
delete[] alpha_buffer;
// </FS:Ansariel>
}
getTexLayerSet()->getAvatarAppearance()->dirtyMesh();

View File

@ -2285,13 +2285,24 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is,
//and trailers are different for the formats.
U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 size )
{
if (size == 0)
{
LL_WARNS() << "No data to unzip." << LL_ENDL;
return NULL;
}
U8* result = NULL;
U32 cur_size = 0;
z_stream strm;
const U32 CHUNK = 0x4000;
U8 *in = new U8[size];
U8 *in = new(std::nothrow) U8[size];
if (in == NULL)
{
LL_WARNS() << "Memory allocation failure." << LL_ENDL;
return NULL;
}
is.read((char*) in, size);
U8 out[CHUNK];
@ -2343,7 +2354,10 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32
U8* new_result = (U8*) realloc(result, cur_size + have);
if (new_result == NULL)
{
LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL;
LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size
<< " bytes; requested " << cur_size + have
<< " bytes; total syze: ." << size << " bytes."
<< LL_ENDL;
inflateEnd(&strm);
if (result)
{

View File

@ -152,13 +152,16 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
//LL_INFOS() << "LLThread::staticRun() Exiting: " << threadp->mName << LL_ENDL;
// We're done with the run function, this thread is done executing now.
//NB: we are using this flag to sync across threads...we really need memory barriers here
threadp->mStatus = STOPPED;
delete threadp->mRecorder;
threadp->mRecorder = NULL;
// We're done with the run function, this thread is done executing now.
//NB: we are using this flag to sync across threads...we really need memory barriers here
// Todo: add LLMutex per thread instead of flag?
// We are using "while (mStatus != STOPPED) {ms_sleep();}" everywhere.
threadp->mStatus = STOPPED;
return NULL;
}

View File

@ -31,6 +31,9 @@
// Freetype stuff
#include <ft2build.h>
#ifdef LL_WINDOWS
#include <freetype2\freetype\ftsystem.h>
#endif
// For some reason, this won't work if it's not wrapped in the ifdef
#ifdef FT_FREETYPE_H
@ -107,8 +110,10 @@ LLFontFreetype::LLFontFreetype()
mAscender(0.f),
mDescender(0.f),
mLineHeight(0.f),
pFontBuffer(NULL),
mBufferSize(0),
#ifdef LL_WINDOWS
pFileStream(NULL),
pFtStream(NULL),
#endif
mIsFallback(FALSE),
mFTFace(NULL),
mRenderGlyphCount(0),
@ -136,9 +141,11 @@ LLFontFreetype::~LLFontFreetype()
std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer());
mCharGlyphInfoMap.clear();
#ifdef LL_WINDOWS
delete pFileStream; // closed by FT_Done_Face
delete pFtStream;
#endif
delete mFontBitmapCachep;
delete pFontBuffer;
disclaimMem(mBufferSize);
// mFallbackFonts cleaned up by LLPointer destructor
// <FS:ND> Delete the kerning cache
@ -149,6 +156,21 @@ LLFontFreetype::~LLFontFreetype()
// </FS:ND>
}
#ifdef LL_WINDOWS
unsigned long ft_read_cb(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count) {
if (count <= 0) return count;
llifstream *file_stream = static_cast<llifstream *>(stream->descriptor.pointer);
file_stream->seekg(offset, std::ios::beg);
file_stream->read((char*)buffer, count);
return file_stream->gcount();
}
void ft_close_cb(FT_Stream stream) {
llifstream *file_stream = static_cast<llifstream *>(stream->descriptor.pointer);
file_stream->close();
}
#endif
BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback)
{
// Don't leak face objects. This is also needed to deal with
@ -163,56 +185,44 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
//
// if (mBufferSize > 0)
// pFileStream = new llifstream(filename, std::ios::binary);
// if (pFileStream->is_open())
// {
// delete pFontBuffer;
// disclaimMem(mBufferSize);
// pFontBuffer = NULL;
// mBufferSize = 0;
// std::streampos beg = pFileStream->tellg();
// pFileStream->seekg(0, std::ios::end);
// std::streampos end = pFileStream->tellg();
// std::size_t file_size = end - beg;
// pFileStream->seekg(0, std::ios::beg);
//
// pFtStream = new LLFT_Stream();
// pFtStream->base = 0;
// pFtStream->pos = 0;
// pFtStream->size = file_size;
// pFtStream->descriptor.pointer = pFileStream;
// pFtStream->read = ft_read_cb;
// pFtStream->close = ft_close_cb;
//
// FT_Open_Args args;
// args.flags = FT_OPEN_STREAM;
// args.stream = (FT_StreamRec*)pFtStream;
//
// error = FT_Open_Face(gFTLibrary,
// &args,
// 0,
// &mFTFace);
// }
//
// S32 file_size = 0;
// LLFILE* file = LLFile::fopen(filename, "rb");
// if (!file)
// else
// {
// delete pFileStream;
// pFileStream = NULL;
// return FALSE;
// }
//
// if (!fseek(file, 0, SEEK_END))
// {
// file_size = ftell(file);
// fseek(file, 0, SEEK_SET);
// }
//
// // Don't delete before FT_Done_Face
// pFontBuffer = new(std::nothrow) U8[file_size];
// if (!pFontBuffer)
// {
// fclose(file);
// return FALSE;
// }
//
// mBufferSize = fread(pFontBuffer, 1, file_size, file);
// fclose(file);
//
// if (mBufferSize != file_size)
// {
// delete pFontBuffer;
// mBufferSize = 0;
// return FALSE;
// }
//
// error = FT_New_Memory_Face( gFTLibrary,
// (FT_Byte*) pFontBuffer,
// mBufferSize,
// 0,
// &mFTFace);
//#else
// error = FT_New_Face( gFTLibrary,
// filename.c_str(),
// 0,
// &mFTFace);
//#endif
FT_Open_Args openArgs;
memset( &openArgs, 0, sizeof( openArgs ) );
openArgs.memory_base = gFontManagerp->loadFont( filename, openArgs.memory_size );
@ -223,15 +233,19 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
openArgs.flags = FT_OPEN_MEMORY;
error = FT_Open_Face( gFTLibrary, &openArgs, 0, &mFTFace );
//#endif
// </FS:ND>
if (error)
{
delete pFontBuffer;
pFontBuffer = NULL;
mBufferSize = 0;
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
// pFileStream->close();
// delete pFileStream;
// delete pFtStream;
// pFileStream = NULL;
// pFtStream = NULL;
//#endif
// </FS:ND>
return FALSE;
}
@ -248,15 +262,19 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v
{
// Clean up freetype libs.
FT_Done_Face(mFTFace);
delete pFontBuffer;
pFontBuffer = NULL;
mBufferSize = 0;
// <FS:ND> FIRE-7570. Only load/mmap fonts once. loadFont will either load a font into memory, or reuse an already loaded font.
//#ifdef LL_WINDOWS
// pFileStream->close();
// delete pFileStream;
// delete pFtStream;
// pFileStream = NULL;
// pFtStream = NULL;
//#endif
// </FS:ND>
mFTFace = NULL;
return FALSE;
}
claimMem(mBufferSize);
F32 y_max, y_min, x_max, x_min;
F32 ems_per_unit = 1.f/ mFTFace->units_per_EM;
F32 pixels_per_unit = pixels_per_em * ems_per_unit;

View File

@ -40,6 +40,8 @@
// We'll forward declare the struct here. JC
struct FT_FaceRec_;
typedef struct FT_FaceRec_* LLFT_Face;
struct FT_StreamRec_;
typedef struct FT_StreamRec_ LLFT_Stream;
// <FS:ND> FIRE-7570. Only load/mmap fonts once.
namespace nd
@ -178,8 +180,11 @@ private:
F32 mLineHeight;
LLFT_Face mFTFace;
U8* pFontBuffer;
S32 mBufferSize;
#ifdef LL_WINDOWS
llifstream *pFileStream;
LLFT_Stream *pFtStream;
#endif
BOOL mIsFallback;
font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars)

View File

@ -1359,8 +1359,19 @@ void LLGLManager::initExtensions()
if (mHasVertexShader)
{
LL_INFOS() << "initExtensions() VertexShader-related procs..." << LL_ENDL;
// nSight doesn't support use of ARB funcs that have been normalized in the API
if (!LLRender::sNsightDebugSupport)
{
glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocationARB");
glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocationARB");
}
else
{
glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocation");
glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocation");
}
glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttribARB");
glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dARB");
glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dvARB");

View File

@ -49,6 +49,7 @@ U32 LLRender::sUICalls = 0;
U32 LLRender::sUIVerts = 0;
U32 LLTexUnit::sWhiteTexture = 0;
bool LLRender::sGLCoreProfile = false;
bool LLRender::sNsightDebugSupport = false;
static const U32 LL_NUM_TEXTURE_LAYERS = 32;
static const U32 LL_NUM_LIGHT_UNITS = 8;

View File

@ -443,7 +443,8 @@ public:
static U32 sUICalls;
static U32 sUIVerts;
static bool sGLCoreProfile;
static bool sNsightDebugSupport;
private:
friend class LLLightState;

View File

@ -1719,12 +1719,12 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char)
BOOL LLLineEditor::canDoDelete() const
{
return ( !mReadOnly && mText.length() > 0 && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) );
return ( !mReadOnly && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) );
}
void LLLineEditor::doDelete()
{
if (canDoDelete())
if (canDoDelete() && mText.length() > 0)
{
// Prepare for possible rollback
LLLineEditorRollback rollback( this );

View File

@ -2196,6 +2196,10 @@ BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask)
LLScrollListCell* cellp = item->getColumn(column_index);
cellp->setValue(item_value);
cellp->onCommit();
if (mLastSelected == NULL)
{
break;
}
}
}
//FIXME: find a better way to signal cell changes

View File

@ -285,7 +285,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name,
LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL;
}
mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt");
mCAFile = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "ca-bundle.crt" );
}
U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string &mask)

View File

@ -52,13 +52,14 @@ S32 LLLFSThread::updateClass(U32 ms_elapsed)
//static
void LLLFSThread::cleanupClass()
{
llassert(sLocal != NULL);
sLocal->setQuitting();
while (sLocal->getPending())
{
sLocal->update(0);
}
delete sLocal;
sLocal = 0;
sLocal = NULL;
}
//----------------------------------------------------------------------------
@ -75,6 +76,7 @@ LLLFSThread::LLLFSThread(bool threaded) :
LLLFSThread::~LLLFSThread()
{
// mLocalAPRFilePoolp cleanup in LLThread
// ~LLQueuedThread() will be called here
}

View File

@ -1555,7 +1555,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
(LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL;
done = true;
if (LLRender::sGLCoreProfile)
// force sNoFixedFunction iff we're trying to use nsight debugging which does not support many legacy API uses
// nSight doesn't support use of legacy API funcs in the fixed function pipe
if (LLRender::sGLCoreProfile || LLRender::sNsightDebugSupport)
{
LLGLSLShader::sNoFixedFunction = true;
}

View File

@ -1977,7 +1977,6 @@ set(viewer_APPSETTINGS_FILES
app_settings/viewerart.xml
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
${AUTOBUILD_INSTALL_DIR}/ca-bundle.crt
packages-info.txt
)

View File

@ -11081,6 +11081,19 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>RenderNsightDebugSupport</key>
<map>
<key>Comment</key>
<string>
Disable features which prevent nVidia nSight from being usable with SL. Requires restart.
</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>RenderLocalLights</key>
<map>
<key>Comment</key>

File diff suppressed because it is too large Load Diff

View File

@ -4688,8 +4688,7 @@ void LLAgent::teleportRequest(const U64& region_handle, const LLVector3& pos_loc
// [/RLVa:KB]
{
LLViewerRegion* regionp = getRegion();
bool is_local = (region_handle == regionp->getHandle());
if(regionp && teleportCore(is_local))
if (regionp && teleportCore(region_handle == regionp->getHandle()))
{
LL_INFOS("") << "TeleportLocationRequest: '" << region_handle << "':"
<< pos_local << LL_ENDL;

View File

@ -648,6 +648,7 @@ static void settings_to_globals()
LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile");
LLRender::sNsightDebugSupport = gSavedSettings.getBOOL("RenderNsightDebugSupport");
// <FS:Ansariel> Vertex Array Objects are required in OpenGL core profile
//LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO");
LLVertexBuffer::sUseVAO = LLRender::sGLCoreProfile ? TRUE : gSavedSettings.getBOOL("RenderUseVAO");
@ -1848,7 +1849,11 @@ bool LLAppViewer::doFrame()
}
// <FS:Ansariel> Cut down wait on logout; Need to terminate voice here because we need gServicePump!
LLVoiceClient::getInstance()->terminate();
if (LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->terminate();
}
// </FS:Ansariel>
delete gServicePump;
@ -1908,7 +1913,10 @@ bool LLAppViewer::cleanup()
#endif
//dump scene loading monitor results
LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
if (LLSceneMonitor::instanceExists())
{
LLSceneMonitor::instance().dumpToFile(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "scene_monitor_results.csv"));
}
// There used to be an 'if (LLFastTimerView::sAnalyzePerformance)' block
// here, completely redundant with the one that occurs later in this same
@ -1951,8 +1959,12 @@ bool LLAppViewer::cleanup()
LLPluginProcessParent::shutdown();
// <FS:Ansariel> Cut down wait on logout; Need to terminate voice earlier because we need gServicePump!
//LLVoiceClient::getInstance()->terminate();
//if (LLVoiceClient::instanceExists())
//{
// LLVoiceClient::getInstance()->terminate();
//}
// </FS:Ansariel>
disconnectViewer();
LL_INFOS() << "Viewer disconnected" << LL_ENDL;
@ -2051,7 +2063,10 @@ bool LLAppViewer::cleanup()
// Note: this is where gLocalSpeakerMgr and gActiveSpeakerMgr used to be deleted.
LLWorldMap::getInstance()->reset(); // release any images
if (LLWorldMap::instanceExists())
{
LLWorldMap::getInstance()->reset(); // release any images
}
LLCalc::cleanUp();
@ -2268,10 +2283,16 @@ bool LLAppViewer::cleanup()
LLURLHistory::saveFile("url_history.xml");
// save mute list. gMuteList used to also be deleted here too.
LLMuteList::getInstance()->cache(gAgent.getID());
if (gAgent.isInitialized() && LLMuteList::instanceExists())
{
LLMuteList::getInstance()->cache(gAgent.getID());
}
//save call log list
LLConversationLog::instance().cache();
if (LLConversationLog::instanceExists())
{
LLConversationLog::instance().cache();
}
if (mPurgeOnExit)
{

View File

@ -491,18 +491,22 @@ void LLFastTimerView::onClose(bool app_quitting)
void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch)
{
//read result back into raw image
glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData());
// disable use of glReadPixels which messes up nVidia nSight graphics debugging
if (!LLRender::sNsightDebugSupport)
{
//read result back into raw image
glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData());
//write results to disk
LLPointer<LLImagePNG> result = new LLImagePNG();
result->encode(scratch, 0.f);
//write results to disk
LLPointer<LLImagePNG> result = new LLImagePNG();
result->encode(scratch, 0.f);
std::string ext = result->getExtension();
std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str());
std::string ext = result->getExtension();
std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str());
std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename);
result->save(out_file);
std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename);
result->save(out_file);
}
}
//static
@ -960,8 +964,7 @@ void LLFastTimerView::doAnalysisDefault(std::string baseline, std::string target
base[label]["Samples"].asInteger());
}
// This currently crashes, possibly due to a race condition in shutdown:
// exportCharts(baseline, target);
exportCharts(baseline, target);
os.flush();
os.close();

View File

@ -43,7 +43,7 @@ LLFloaterHoverHeight::LLFloaterHoverHeight(const LLSD& key) : LLFloater(key)
{
}
void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data)
void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data, bool update_offset)
{
F32 value = gSavedPerAccountSettings.getF32("AvatarHoverOffsetZ");
@ -52,7 +52,7 @@ void LLFloaterHoverHeight::syncFromPreferenceSetting(void *user_data)
sldrCtrl->setValue(value,FALSE);
// <FS:Ansariel> Legacy baking avatar z-offset
//if (isAgentAvatarValid())
//if (isAgentAvatarValid() && update_offset)
//{
// LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
// LL_INFOS("Avatar") << "setting hover from preference setting " << offset[2] << LL_ENDL;
@ -77,7 +77,7 @@ BOOL LLFloaterHoverHeight::postBuild()
// Update slider on future pref changes.
if (gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ"))
{
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this));
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&syncFromPreferenceSetting, this, false));
}
else
{
@ -140,12 +140,6 @@ void LLFloaterHoverHeight::onFinalCommit()
// <FS:Ansariel> Legacy baking avatar z-offset
LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
gSavedPerAccountSettings.setF32("AvatarHoverOffsetZ",value);
// <FS:Ansariel> Legacy baking avatar z-offset
//LLVector3 offset(0.0, 0.0, llclamp(value,MIN_HOVER_Z,MAX_HOVER_Z));
LL_INFOS("Avatar") << "setting hover from slider final commit " << offset[2] << LL_ENDL;
// <FS:Ansariel> Legacy baking avatar z-offset
//gAgentAvatarp->setHoverOffset(offset, true); // will send update this time.
}
void LLFloaterHoverHeight::onRegionChanged()

View File

@ -39,7 +39,7 @@ public:
void onFinalCommit();
static void syncFromPreferenceSetting(void *user_data);
static void syncFromPreferenceSetting(void *user_data, bool update_offset = true);
void onRegionChanged();
void onSimulatorFeaturesReceived(const LLUUID &region_id);

View File

@ -250,7 +250,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
&& have_extended_data)
{
columns[column_num]["column"] = "memory";
columns[column_num]["value"] = llformat("%0.0f", (script_memory / 1000.f));
columns[column_num]["value"] = llformat("%0.0f", (script_memory / 1024.f));
columns[column_num++]["font"] = "SANSSERIF";
columns[column_num]["column"] = "URLs";

View File

@ -216,7 +216,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const
// we're showing all folders, overriding filter
if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS)
{
return true;
return !gInventory.isCategoryHidden(folder_id);
}
// when applying a filter, matching folders get their contents downloaded first

View File

@ -362,6 +362,21 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const
return category;
}
bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const
{
const LLViewerInventoryCategory* category = getCategory(id);
if (category)
{
LLFolderType::EType cat_type = category->getPreferredType();
// <FS:Ansariel> Show inbox folder depending on FSShowInboxFolder setting
//return (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX);
static LLCachedControl<bool> fsShowInboxFolder(gSavedSettings, "FSShowInboxFolder");
return ((cat_type == LLFolderType::FT_INBOX && !fsShowInboxFolder) || cat_type == LLFolderType::FT_OUTBOX);
// </FS:Ansariel>
}
return false;
}
S32 LLInventoryModel::getItemCount() const
{
return mItemMap.size();

View File

@ -341,7 +341,8 @@ public:
// Copy content of all folders of type "type" into folder "id" and delete/purge the empty folders
// Note : This method has been designed for FT_OUTBOX (aka Merchant Outbox) but can be used for other categories
void consolidateForType(const LLUUID& id, LLFolderType::EType type);
bool isCategoryHidden(const LLUUID& id) const;
// <FS:TT> ReplaceWornItemsOnly
void wearItemsOnAvatar(LLInventoryCategory* category);

View File

@ -1449,6 +1449,8 @@ void LLInventoryPanel::fileUploadLocation(const LLSD& userdata)
void LLInventoryPanel::purgeSelectedItems()
{
if (!mFolderRoot.get()) return;
const std::set<LLFolderViewItem*> inventory_selected = mFolderRoot.get()->getSelectionList();
if (inventory_selected.empty()) return;
LLSD args;
@ -1469,6 +1471,8 @@ void LLInventoryPanel::purgeSelectedItems()
void LLInventoryPanel::callbackPurgeSelectedItems(const LLSD& notification, const LLSD& response)
{
if (!mFolderRoot.get()) return;
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{

View File

@ -851,6 +851,12 @@ LLMeshRepoThread::~LLMeshRepoThread()
mHttpRequestSet.clear();
mHttpHeaders.reset();
while (!mDecompositionQ.empty())
{
delete mDecompositionQ.front();
mDecompositionQ.pop_front();
}
delete mHttpRequest;
mHttpRequest = NULL;
delete mMutex;
@ -1701,7 +1707,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod)
if (!zero)
{ //attempt to parse
if (lodReceived(mesh_params, lod, buffer, size))
if (lodReceived(mesh_params, lod, buffer, size) == MESH_OK)
{
delete[] buffer;
return true;
@ -1824,11 +1830,11 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat
return true;
}
bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size)
EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size)
{
if (data == NULL || data_size == 0)
{
return false;
return MESH_NO_DATA;
}
LLPointer<LLVolume> volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod));
@ -1841,7 +1847,7 @@ bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U
catch (std::bad_alloc)
{
// out of memory, we won't be able to process this mesh
return false;
return MESH_OUT_OF_MEMORY;
}
if (volume->unpackVolumeFaces(stream, data_size))
@ -1853,11 +1859,11 @@ bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U
LLMutexLock lock(mMutex);
mLoadedQ.push(mesh);
}
return true;
return MESH_OK;
}
}
return false;
return MESH_UNKNOWN;
}
bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size)
@ -2031,6 +2037,9 @@ LLMeshUploadThread::~LLMeshUploadThread()
{
delete mHttpRequest;
mHttpRequest = NULL;
delete mMutex;
mMutex = NULL;
}
LLMeshUploadThread::DecompRequest::DecompRequest(LLModel* mdl, LLModel* base_model, LLMeshUploadThread* thread)
@ -3045,6 +3054,11 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo
body->read(body_offset, (char *) data, data_size - body_offset);
LLMeshRepository::sBytesReceived += data_size;
}
else
{
LL_WARNS(LOG_MESH) << "Failed to allocate " << data_size - body_offset << " memory for mesh response" << LL_ENDL;
processFailure(LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_BAD_ALLOC));
}
}
processData(body, body_offset, data, data_size - body_offset);
@ -3223,27 +3237,43 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body
U8 * data, S32 data_size)
{
if ((!MESH_LOD_PROCESS_FAILED)
&& ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong
&& gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size))
&& ((data != NULL) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong
{
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;
if (file.getSize() >= offset+size)
EMeshProcessingResult result = gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size);
if (result == MESH_OK)
{
file.seek(offset);
file.write(data, size);
LLMeshRepository::sCacheBytesWritten += size;
++LLMeshRepository::sCacheWrites;
// good fetch from sim, write to VFS for caching
LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE);
S32 offset = mOffset;
S32 size = mRequestedBytes;
if (file.getSize() >= offset+size)
{
file.seek(offset);
file.write(data, size);
LLMeshRepository::sCacheBytesWritten += size;
++LLMeshRepository::sCacheWrites;
}
}
else
{
LL_WARNS(LOG_MESH) << "Error during mesh LOD processing. ID: " << mMeshParams.getSculptID()
<< ", Reason: " << result
<< " LOD: " << mLOD
<< " Data size: " << data_size
<< " Not retrying."
<< LL_ENDL;
LLMutexLock lock(gMeshRepo.mThread->mMutex);
gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, mLOD));
}
}
else
{
LL_WARNS(LOG_MESH) << "Error during mesh LOD processing. ID: " << mMeshParams.getSculptID()
<< ", Unknown reason. Not retrying."
<< " LOD: " << mLOD
<< " Data size: " << data_size
<< LL_ENDL;
LLMutexLock lock(gMeshRepo.mThread->mMutex);
gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, mLOD));
@ -3396,6 +3426,7 @@ void LLMeshPhysicsShapeHandler::processData(LLCore::BufferArray * /* body */, S3
LLMeshRepository::LLMeshRepository()
: mMeshMutex(NULL),
mDecompThread(NULL),
mMeshThreadCount(0),
mLegacyGetMeshVersion(0), // <FS:Ansariel> [UDP Assets]
mThread(NULL)
@ -3426,6 +3457,8 @@ void LLMeshRepository::init()
void LLMeshRepository::shutdown()
{
LL_INFOS(LOG_MESH) << "Shutting down mesh repository." << LL_ENDL;
llassert(mThread != NULL);
llassert(mThread->mSignal != NULL);
metrics_teleport_started_signal.disconnect();

View File

@ -53,6 +53,15 @@ class LLCondition;
class LLVFS;
class LLMeshRepository;
typedef enum e_mesh_processing_result_enum
{
MESH_OK = 0,
MESH_NO_DATA = 1,
MESH_OUT_OF_MEMORY,
MESH_HTTP_REQUEST_FAILED,
MESH_UNKNOWN
} EMeshProcessingResult;
class LLMeshUploadData
{
public:
@ -306,7 +315,7 @@ public:
bool fetchMeshHeader(const LLVolumeParams& mesh_params);
bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod);
bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size);
bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size);
EMeshProcessingResult lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size);
bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
bool decompositionReceived(const LLUUID& mesh_id, U8* data, S32 data_size);
bool physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 data_size);

View File

@ -1770,7 +1770,7 @@ void LLPanelEditWearable::initPreviousAlphaTextures()
initPreviousAlphaTextureEntry(TEX_UPPER_ALPHA);
initPreviousAlphaTextureEntry(TEX_HEAD_ALPHA);
initPreviousAlphaTextureEntry(TEX_EYES_ALPHA);
initPreviousAlphaTextureEntry(TEX_LOWER_ALPHA);
initPreviousAlphaTextureEntry(TEX_HAIR_ALPHA);
}
void LLPanelEditWearable::initPreviousAlphaTextureEntry(LLAvatarAppearanceDefines::ETextureIndex te)

View File

@ -2177,9 +2177,14 @@ void LLPanelObject::sendRotation(BOOL btn_down)
rotation = rotation * ~mRootObject->getRotationRegion();
// ## Zi: Building spin controls for attachments
}
// To include avatars into movements and rotation
// If false, all children are selected anyway - move avatar
// If true, not all children are selected - save positions
bool individual_selection = gSavedSettings.getBOOL("EditLinkedParts");
std::vector<LLVector3>& child_positions = mObject->mUnselectedChildrenPositions ;
std::vector<LLQuaternion> child_rotations;
if (mObject->isRootEdit())
if (mObject->isRootEdit() && individual_selection)
{
mObject->saveUnselectedChildrenRotation(child_rotations) ;
mObject->saveUnselectedChildrenPosition(child_positions) ;
@ -2189,8 +2194,8 @@ void LLPanelObject::sendRotation(BOOL btn_down)
LLManip::rebuild(mObject) ;
// for individually selected roots, we need to counterrotate all the children
if (mObject->isRootEdit())
{
if (mObject->isRootEdit() && individual_selection)
{
mObject->resetChildrenRotationAndPosition(child_rotations, child_positions) ;
}

View File

@ -1284,7 +1284,7 @@ void LLSecAPIBasicHandler::init()
// grab the application ca-bundle.crt file that contains the well-known certs shipped
// with the product
std::string ca_file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt");
std::string ca_file_path = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "ca-bundle.crt" );
LL_INFOS("SECAPI") << "Loading application certificate store from " << ca_file_path << LL_ENDL;
LLPointer<LLBasicCertificateStore> app_ca_store = new LLBasicCertificateStore(ca_file_path);

View File

@ -1295,7 +1295,6 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target,
if (gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
{
is_in_trash = true;
remove_from_inventory = TRUE;
}
LLUUID source_id = from_task_inventory ? mSourceID : LLUUID::null;
@ -1869,7 +1868,6 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand(
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
{
accept = ACCEPT_YES_SINGLE;
remove_inventory = TRUE;
}
if(drop)

View File

@ -195,6 +195,27 @@ static bool handleDebugAvatarJointsChanged(const LLSD& newvalue)
return true;
}
static bool handleAvatarHoverOffsetChanged(const LLSD& newvalue)
{
if (isAgentAvatarValid())
{
// <FS:Ansariel> [Legacy bake]
//gAgentAvatarp->setHoverIfRegionEnabled();
if (gAgent.getRegion()->avatarHoverHeightEnabled())
{
LLVector3 avOffset(0.0f, 0.0f, llclamp<F32>(newvalue.asReal(), MIN_HOVER_Z, MAX_HOVER_Z));
gAgentAvatarp->setHoverOffset(avOffset, true);
}
else if (!gAgentAvatarp->isUsingServerBakes())
{
gAgentAvatarp->computeBodySize();
}
// </FS:Ansariel> [Legacy bake]
}
return true;
}
// <FS:Ansariel> Expose handleSetShaderChanged()
//static bool handleSetShaderChanged(const LLSD& newvalue)
bool handleSetShaderChanged(const LLSD& newvalue)
@ -602,25 +623,6 @@ bool handleVelocityInterpolate(const LLSD& newvalue)
return true;
}
// <FS:Zi> Moved Avatar Z offset from RLVa to here
bool handleAvatarZOffsetChanged(const LLSD& sdValue)
{
if (isAgentAvatarValid())
{
if (gAgent.getRegion()->avatarHoverHeightEnabled())
{
LLVector3 avOffset(0.0f, 0.0f, llclamp<F32>(sdValue.asReal(), MIN_HOVER_Z, MAX_HOVER_Z));
gAgentAvatarp->setHoverOffset(avOffset, true);
}
else if (!gAgentAvatarp->isUsingServerBakes())
{
gAgentAvatarp->computeBodySize();
}
}
return true;
}
// </FS:Zi> Moved Avatar Z offset from RLVa to here
bool handleForceShowGrid(const LLSD& newvalue)
{
// <FS:Ansariel> [FS Login Panel]
@ -1100,12 +1102,12 @@ void settings_setup_listeners()
gSavedSettings.getControl("SpellCheck")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
gSavedSettings.getControl("SpellCheckDictionary")->getSignal()->connect(boost::bind(&handleSpellCheckChanged));
gSavedSettings.getControl("LoginLocation")->getSignal()->connect(boost::bind(&handleLoginLocationChanged));
gSavedSettings.getControl("DebugAvatarJoints")->getCommitSignal()->connect(boost::bind(&handleDebugAvatarJointsChanged, _2));
gSavedSettings.getControl("DebugAvatarJoints")->getCommitSignal()->connect(boost::bind(&handleDebugAvatarJointsChanged, _2));
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getCommitSignal()->connect(boost::bind(&handleAvatarHoverOffsetChanged, _2));
// [RLVa:KB] - Checked: 2015-12-27 (RLVa-1.5.0)
gSavedSettings.getControl("RestrainedLove")->getSignal()->connect(boost::bind(&RlvSettings::onChangedSettingMain, _2));
// [/RLVa:KB]
gSavedPerAccountSettings.getControl("AvatarHoverOffsetZ")->getSignal()->connect(boost::bind(&handleAvatarZOffsetChanged, _2)); // <FS:Zi> Moved Avatar Z offset from RLVa to here
// <FS:Zi> Is done inside XUI now, using visibility_control
// gSavedSettings.getControl("ShowNavbarFavoritesPanel")->getSignal()->connect(boost::bind(&toggle_show_favorites_panel, _2));
// </FS:Zi>

View File

@ -2074,7 +2074,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
// the correct way to deal with certs it to load ours from ca-bundle.crt and append them to the ones
// Qt/WebKit loads from your system location.
std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "ca-bundle.crt" );
std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "ca-bundle.crt" );
media_source->addCertificateFilePath( ca_path );
media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort"));

View File

@ -40,6 +40,25 @@
#include "llworld.h"
#include "pipeline.h"
static LLVOAvatar* find_avatar(const LLUUID& id)
{
LLViewerObject *obj = gObjectList.findObject(id);
while (obj && obj->isAttachment())
{
obj = (LLViewerObject *)obj->getParent();
}
if (obj && obj->isAvatar())
{
return (LLVOAvatar*)obj;
}
else
{
return NULL;
}
}
LLViewerPartSource::LLViewerPartSource(const U32 type) :
mType(type),
mOwnerUUID(LLUUID::null),
@ -113,6 +132,15 @@ void LLViewerPartSourceScript::update(const F32 dt)
if( mIsSuspended )
return;
if (mOwnerAvatarp.isNull() && mOwnerUUID != LLUUID::null)
{
mOwnerAvatarp = find_avatar(mOwnerUUID);
}
if (mOwnerAvatarp.notNull() && LLVOAvatar::AV_DO_NOT_RENDER == mOwnerAvatarp->getVisualMuteSettings())
{
return;
}
F32 old_update_time = mLastUpdateTime;
mLastUpdateTime += dt;

View File

@ -42,6 +42,7 @@
class LLViewerTexture;
class LLViewerObject;
class LLViewerPart;
class LLVOAvatar;
class LLViewerPartSource : public LLRefCount
{
@ -85,6 +86,7 @@ protected:
F32 mLastUpdateTime;
F32 mLastPartTime;
LLUUID mOwnerUUID;
LLPointer<LLVOAvatar> mOwnerAvatarp;
LLPointer<LLViewerTexture> mImagep;
// Particle information
U32 mPartFlags; // Flags for the particle

View File

@ -646,7 +646,7 @@ public:
if (last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize) > 0)
{
addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", last_frame_recording.getMin(LLPipeline::sStatBatchSize), last_frame_recording.getMax(LLPipeline::sStatBatchSize), last_frame_recording.getMean(LLPipeline::sStatBatchSize)));
addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", (U32)last_frame_recording.getMin(LLPipeline::sStatBatchSize), (U32)last_frame_recording.getMax(LLPipeline::sStatBatchSize), (U32)last_frame_recording.getMean(LLPipeline::sStatBatchSize)));
}
ypos += y_inc;
@ -773,11 +773,11 @@ public:
ypos += y_inc;
}
//<FS:AO improve use of controls with radiogroups>
//if (gSavedSettings.getBOOL("DebugShowColor"))
//if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport)
//static LLCachedControl<bool> debugShowColor(gSavedSettings, "DebugShowColor");
static LLCachedControl<S32> debugShowColor(gSavedSettings, "DebugShowColor");
//</FS:AO>
if (debugShowColor)
if (debugShowColor && !LLRender::sNsightDebugSupport)
{
U8 color[4];
LLCoordGL coord = gViewerWindow->getCurrentMouse();
@ -6016,71 +6016,74 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
{
LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot");
}
if (type == LLSnapshotModel::SNAPSHOT_TYPE_COLOR)
// disable use of glReadPixels when doing nVidia nSight graphics debugging
if (!LLRender::sNsightDebugSupport)
{
glReadPixels(
if (type == LLSnapshotModel::SNAPSHOT_TYPE_COLOR)
{
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_RGB, GL_UNSIGNED_BYTE,
raw->getData() + output_buffer_offset
);
}
// <FS:Ansariel> FIRE-15667: 24bit depth maps
else if (type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH24)
{
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GLfloat)); // need to store floating point values
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
}
// <FS:Ansariel> FIRE-15667: 24bit depth maps
else if (type == LLSnapshotModel::SNAPSHOT_TYPE_DEPTH24)
{
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U32 RGB24 = F32_to_U32(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
//A max value of 16777215 for RGB24 evaluates to black when it shold be white. The clamp assures that the divisions do not somehow become >=256.
U8 depth_byteR = (U8)(llclamp(llfloor(RGB24 / 65536.f), 0, 255));
U8 depth_byteG = (U8)(llclamp(llfloor((RGB24 - depth_byteR * 65536) / 256.f), 0, 255));
U8 depth_byteB = (U8)(llclamp((RGB24 - depth_byteR * 65536 - depth_byteG * 256), 0u, 255u));
// write converted scanline out to result image
*(raw->getData() + output_buffer_offset + (i * raw->getComponents())) = depth_byteR;
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + 1) = depth_byteG;
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + 2) = depth_byteB;
for (S32 j = 3; j < raw->getComponents(); j++)
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GLfloat)); // need to store floating point values
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byteR;
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U32 RGB24 = F32_to_U32(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
//A max value of 16777215 for RGB24 evaluates to black when it shold be white. The clamp assures that the divisions do not somehow become >=256.
U8 depth_byteR = (U8)(llclamp(llfloor(RGB24 / 65536.f), 0, 255));
U8 depth_byteG = (U8)(llclamp(llfloor((RGB24 - depth_byteR * 65536) / 256.f), 0, 255));
U8 depth_byteB = (U8)(llclamp((RGB24 - depth_byteR * 65536 - depth_byteG * 256), 0u, 255u));
// write converted scanline out to result image
*(raw->getData() + output_buffer_offset + (i * raw->getComponents())) = depth_byteR;
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + 1) = depth_byteG;
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + 2) = depth_byteB;
for (S32 j = 3; j < raw->getComponents(); j++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byteR;
}
}
}
}
// </FS:Ansariel>
else // LLSnapshotModel::SNAPSHOT_TYPE_DEPTH
{
// <FS> Fix buffer creation using the wrong type
//LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GLfloat)); // need to store floating point values
// </FS>
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
// </FS:Ansariel>
else // LLSnapshotModel::SNAPSHOT_TYPE_DEPTH
{
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
// write converted scanline out to result image
for (S32 j = 0; j < raw->getComponents(); j++)
// <FS> Fix buffer creation using the wrong type
//LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values
LLPointer<LLImageRaw> depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GLfloat)); // need to store floating point values
// </FS>
glReadPixels(
subimage_x_offset, out_y + subimage_y_offset,
read_width, 1,
GL_DEPTH_COMPONENT, GL_FLOAT,
depth_line_buffer->getData()// current output pixel is beginning of buffer...
);
for (S32 i = 0; i < (S32)read_width; i++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32)));
F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2));
U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar());
// write converted scanline out to result image
for (S32 j = 0; j < raw->getComponents(); j++)
{
*(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte;
}
}
}
}

View File

@ -8176,11 +8176,13 @@ void LLVOAvatar::updateMeshTextures()
debugColorizeSubMeshes(i,LLColor4::blue);
}
}
static LLUUID default_alpha_uuid = LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID"));
bool hair_alpha_exists = (getImage(TEX_HAIR_ALPHA, 0) && getImage(TEX_HAIR_ALPHA, 0)->getID() != default_alpha_uuid);
// set texture and color of hair manually if we are not using a baked image.
// This can happen while loading hair for yourself, or for clients that did not
// bake a hair texture. Still needed for yourself after 1.22 is depricated.
if (!is_layer_baked[BAKED_HAIR] || isEditingAppearance())
if (!is_layer_baked[BAKED_HAIR] || (isEditingAppearance() && !hair_alpha_exists))
{
const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1);
LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 );

View File

@ -702,16 +702,6 @@ This parcel is 512 m² of land.
right="400">
You have L$ 2,100.
</text>
<check_box
follows="bottom|left"
height="20"
label="Remove [AMOUNT] m² of contribution from group."
layout="topleft"
left_delta="3"
name="remove_contribution"
top_delta="14"
visible="false"
width="275" />
<button
follows="bottom|left"
height="20"
@ -721,6 +711,15 @@ This parcel is 512 m² of land.
name="buy_btn"
top="454"
width="100" />
<check_box
follows="bottom|left"
height="20"
label="Remove [AMOUNT] m² of contribution from group."
layout="topleft"
left_pad="3"
name="remove_contribution"
visible="false"
width="275" />
<button
follows="bottom|right"
height="20"

View File

@ -174,8 +174,7 @@ Your account is not accessible until
If you feel this is an error, please contact support@secondlife.com.</string>
<string name="LoginFailedPendingLogoutFault">Request for logout responded with a fault from simulator.</string>
<string name="LoginFailedPendingLogout">The system is logging you out right now.
Your Account will not be available until
[TIME] Pacific Time.</string>
Please wait a minute before you try logging in again.</string>
<string name="LoginFailedUnableToCreateSession">Unable to create valid session.</string>
<string name="LoginFailedUnableToConnectToSimulator">Unable to connect to a simulator.</string>
<string name="LoginFailedRestrictedHours">Your account can only access Second Life

View File

@ -70,12 +70,9 @@ class ViewerManifest(LLManifest,FSViewerManifest):
self.path(src="../../etc/message.xml", dst="app_settings/message.xml")
# <FS:LO> Copy dictionaries to a place where the viewer can find them if ran from visual studio
with self.prefix(src="app_settings"):
# ... and the included spell checking dictionaries
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
with self.prefix(src=pkgdir,dst=""):
self.path("dictionaries")
self.path("ca-bundle.crt")
pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
with self.prefix(src=pkgdir, dst="app_settings"):
self.path("dictionaries")
# </FS:LO>
if self.is_packaging_viewer():
@ -105,7 +102,6 @@ class ViewerManifest(LLManifest,FSViewerManifest):
# pkgdir = os.path.join(self.args['build'], os.pardir, 'packages')
# with self.prefix(src=pkgdir,dst=""):
# self.path("dictionaries")
# self.path("ca-bundle.crt")
# </FS:LO>
# include the entire beams directory
@ -685,7 +681,8 @@ class WindowsManifest(ViewerManifest):
self.path(src="licenses-win32.txt", dst="licenses.txt")
self.path("featuretable.txt")
self.path("ca-bundle.crt")
with self.prefix(src=pkgdir,dst=""):
self.path("ca-bundle.crt")
self.path("VivoxAUP.txt")
# Media plugins - CEF
@ -1171,7 +1168,9 @@ class DarwinManifest(ViewerManifest):
# self.path("licenses-mac.txt", dst="licenses.txt")
# self.path("featuretable_mac.txt")
# self.path("SecondLife.nib")
# self.path("ca-bundle.crt")
# with self.prefix(src=pkgdir,dst=""):
# self.path("ca-bundle.crt")
# self.path("SecondLife.nib")
@ -1418,7 +1417,9 @@ class DarwinManifest(ViewerManifest):
self.path("licenses-mac.txt", dst="licenses.txt")
self.path("featuretable_mac.txt")
self.path("VivoxAUP.txt")
self.path("ca-bundle.crt")
with self.prefix(src=pkgdir,dst=""):
self.path("ca-bundle.crt")
icon_path = self.icon_path()
with self.prefix(src=icon_path, dst="") :
@ -2033,7 +2034,9 @@ class LinuxManifest(ViewerManifest):
print "Skipping llcommon.so (assuming llcommon was linked statically)"
self.path("featuretable_linux.txt")
self.path("ca-bundle.crt")
with self.prefix(src=pkgdir,dst=""):
self.path("ca-bundle.crt")
if self.is_packaging_viewer():
with self.prefix("../packages/lib/release", dst="lib"):