Merge branch 'DRTVWR-582-maint-U' of https://github.com/secondlife/viewer

meow-7.2.2
Ansariel 2023-05-31 10:36:37 +02:00
commit 75b2ac651a
26 changed files with 56 additions and 102 deletions

View File

@ -1361,7 +1361,6 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
dp.packS32(joint->mNumRotKeys, "num_rot_keys");
LLQuaternion::Order order = bvhStringToOrder( joint->mOrder );
S32 outcount = 0;
S32 frame = 0;
for (Key& key : joint->mKeys)
{
@ -1427,7 +1426,6 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
dp.packU16(x, "rot_angle_x");
dp.packU16(y, "rot_angle_y");
dp.packU16(z, "rot_angle_z");
outcount++;
frame++;
}

View File

@ -110,11 +110,9 @@ void LLErrorThread::run()
// <FS:ND/> Do not log as this can lead to deadlocks during startup.
// LL_INFOS() << "thread_error - Waiting for an error" << LL_ENDL;
S32 counter = 0;
while (! (LLApp::isError() || LLApp::isStopped()))
{
ms_sleep(10);
counter++;
}
if (LLApp::isError())
{

View File

@ -125,14 +125,20 @@ bool LLSDSerialize::deserialize(LLSD& sd, std::istream& str, llssize max_bytes)
char hdr_buf[MAX_HDR_LEN + 1] = ""; /* Flawfinder: ignore */
bool fail_if_not_legacy = false;
/*
* Get the first line before anything. Don't read more than max_bytes:
* this get() overload reads no more than (count-1) bytes into the
* specified buffer. In the usual case when max_bytes exceeds
* sizeof(hdr_buf), get() will read no more than sizeof(hdr_buf)-2.
*/
str.get(hdr_buf, llmin(max_bytes+1, sizeof(hdr_buf)-1), '\n');
/*
* Get the first line before anything. Don't read more than max_bytes:
* this get() overload reads no more than (count-1) bytes into the
* specified buffer. In the usual case when max_bytes exceeds
* sizeof(hdr_buf), get() will read no more than sizeof(hdr_buf)-2.
*/
llssize max_hdr_read = MAX_HDR_LEN;
if (max_bytes != LLSDSerialize::SIZE_UNLIMITED)
{
max_hdr_read = llmin(max_bytes + 1, max_hdr_read);
}
str.get(hdr_buf, max_hdr_read, '\n');
auto inbuf = str.gcount();
// https://en.cppreference.com/w/cpp/io/basic_istream/get
// When the get() above sees the specified delimiter '\n', it stops there
// without pulling it from the stream. If it turns out that the stream
@ -2242,9 +2248,9 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is,
LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, const U8* in, S32 size)
{
U8* result = NULL;
U32 cur_size = 0;
llssize cur_size = 0;
z_stream strm;
constexpr U32 CHUNK = 1024 * 512;
static thread_local std::unique_ptr<U8[]> out;
@ -2448,7 +2454,7 @@ U8* unzip_llsdNavMesh( bool& valid, size_t& outsize, std::istream& is, S32 size
return result;
}
char* strip_deprecated_header(char* in, U32& cur_size, U32* header_size)
char* strip_deprecated_header(char* in, llssize& cur_size, llssize* header_size)
{
const char* deprecated_header = "<? LLSD/Binary ?>";
constexpr size_t deprecated_header_size = 17;

View File

@ -873,5 +873,5 @@ LL_COMMON_API std::string zip_llsd(LLSD& data);
LL_COMMON_API U8* unzip_llsdNavMesh( bool& valid, size_t& outsize,std::istream& is, S32 size);
// returns a pointer to the array or past the array if the deprecated header exists
LL_COMMON_API char* strip_deprecated_header(char* in, U32& cur_size, U32* header_size = nullptr);
LL_COMMON_API char* strip_deprecated_header(char* in, llssize& cur_size, llssize* header_size = nullptr);
#endif // LL_LLSDSERIALIZE_H

View File

@ -5744,14 +5744,14 @@ bool LLVolumeFace::cacheOptimize()
new_indices.push_back(tri->mVertex[2]->mIdx);
tri->complete();
U32 breaks = 0;
//U32 breaks = 0;
for (U32 i = 1; i < mNumIndices/3; ++i)
{
cache.updateScores();
tri = cache.mBestTriangle;
if (!tri)
{
breaks++;
//breaks++;
for (U32 j = 0; j < triangle_data.size(); ++j)
{
if (triangle_data[j].mActive)

View File

@ -278,7 +278,6 @@ void LLCircuitData::ackReliablePacket(TPACKETID packet_num)
S32 LLCircuitData::resendUnackedPackets(const F64Seconds now)
{
S32 resent_packets = 0;
LLReliablePacket *packetp;
@ -382,7 +381,6 @@ S32 LLCircuitData::resendUnackedPackets(const F64Seconds now)
// Don't remove it yet, it still gets to try to resend at least once.
++iter;
}
resent_packets++;
}
else
{

View File

@ -2332,9 +2332,7 @@ void LLGLSyncFence::wait()
if (mSync)
{
while (glClientWaitSync(mSync, 0, FENCE_WAIT_TIME_NANOSECONDS) == GL_TIMEOUT_EXPIRED)
{ //track the number of times we've waited here
static S32 waits = 0;
waits++;
{
}
}
#endif

View File

@ -1008,11 +1008,8 @@ void LLButton::draw()
break;
}
S32 y_offset = 2 + (getRect().getHeight() - 20)/2;
if (pressed && mDisplayPressedState)
{
y_offset--;
x++;
}

View File

@ -508,9 +508,6 @@ void LLMenuItemGL::draw( void )
// let disabled items be highlighted, just don't draw them as such
if( getEnabled() && getHighlight() && !mBriefItem)
{
int debug_count = 0;
if (dynamic_cast<LLMenuItemCallGL*>(this))
debug_count++;
gGL.color4fv( mHighlightBackground.get().mV );
gl_rect_2d( 0, getRect().getHeight(), getRect().getWidth(), 0 );

View File

@ -876,7 +876,6 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
return 0;
}
U32 item = 0;
U32 validitems = 0;
S32 version;
@ -910,8 +909,6 @@ U32 LLControlGroup::loadFromFileLegacy(const std::string& filename, BOOL require
}
// Got an item. Load it up.
item++;
// If not declared, assume it's a string
if (!declared)
{

View File

@ -4464,7 +4464,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
// take controls
msg->getU32("Data", "Controls", controls, block_index );
msg->getBOOL("Data", "PassToAgent", passon, block_index );
U32 total_count = 0;
for (i = 0; i < TOTAL_CONTROLS; i++)
{
if (controls & ( 1 << i))
@ -4477,7 +4476,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
{
gAgent.mControlsTakenCount[i]++;
}
total_count++;
}
}
}

View File

@ -24,6 +24,7 @@
*/
#include "llviewerprecompiledheaders.h"
#include "llfloatercamera.h"
#include "llfloatercamerapresets.h"
#include "llfloaterreg.h"
#include "llnotificationsutil.h"
@ -40,7 +41,8 @@ LLFloaterCameraPresets::~LLFloaterCameraPresets()
BOOL LLFloaterCameraPresets::postBuild()
{
mPresetList = getChild<LLFlatListView>("preset_list");
mPresetList->setCommitCallback(boost::bind(&LLFloaterCameraPresets::onSelectionChange, this));
mPresetList->setCommitOnSelectionChange(true);
LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCameraPresets::populateList, this));
return TRUE;
@ -58,6 +60,7 @@ void LLFloaterCameraPresets::populateList()
std::list<std::string> preset_names;
presetsMgr->loadPresetNamesFromDir(PRESETS_CAMERA, preset_names, DEFAULT_BOTTOM);
std::string active_preset = gSavedSettings.getString("PresetCameraActive");
for (std::list<std::string>::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it)
{
@ -66,6 +69,19 @@ void LLFloaterCameraPresets::populateList()
LLCameraPresetFlatItem* item = new LLCameraPresetFlatItem(name, is_default);
item->postBuild();
mPresetList->addItem(item);
if(name == active_preset)
{
mPresetList->selectItem(item);
}
}
}
void LLFloaterCameraPresets::onSelectionChange()
{
LLCameraPresetFlatItem* selected_preset = dynamic_cast<LLCameraPresetFlatItem*>(mPresetList->getSelectedItem());
if(selected_preset)
{
LLFloaterCamera::switchToPreset(selected_preset->getPresetName());
}
}

View File

@ -38,6 +38,7 @@ class LLFloaterCameraPresets : public LLFloater
virtual void onOpen(const LLSD& key);
void populateList();
void onSelectionChange();
private:
LLFloaterCameraPresets(const LLSD& key);
@ -58,6 +59,8 @@ public:
virtual void onMouseEnter(S32 x, S32 y, MASK mask);
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
std::string getPresetName() { return mPresetName; }
private:
void onDeleteBtnClick();
void onResetBtnClick();

View File

@ -1968,10 +1968,10 @@ EMeshProcessingResult LLMeshRepoThread::headerReceived(const LLVolumeParams& mes
const LLUUID mesh_id = mesh_params.getSculptID();
LLSD header;
U32 header_size = 0;
llssize header_size = 0;
if (data_size > 0)
{
U32 dsize = data_size;
llssize dsize = data_size;
char* result_ptr = strip_deprecated_header((char*)data, dsize, &header_size);
data_size = dsize;

View File

@ -3681,9 +3681,6 @@ void LLModelPreview::clearBuffers()
void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
{
U32 mesh_count = 0;
LLModelLoader::model_list* model = NULL;
if (lod < 0 || lod > 4)
@ -3818,8 +3815,6 @@ void LLModelPreview::genBuffers(S32 lod, bool include_skin_weights)
vb->flush();
mVertexBuffer[lod][mdl].push_back(vb);
++mesh_count;
}
}
}

View File

@ -632,7 +632,6 @@ void LLPanelNearByMedia::refreshList()
LLViewerMedia::impl_list impls = media_inst->getPriorityList();
LLViewerMedia::impl_list::iterator priority_iter;
U32 enabled_count = 0;
U32 disabled_count = 0;
// iterate over the impl list, creating rows as necessary.
@ -675,13 +674,10 @@ void LLPanelNearByMedia::refreshList()
{
disabled_count++;
}
else {
enabled_count++;
}
}
}
mDisableAllCtrl->setEnabled((gSavedSettings.getBOOL("AudioStreamingMusic") ||
gSavedSettings.getBOOL("AudioStreamingMedia")) &&
gSavedSettings.getBOOL("AudioStreamingMedia")) &&
(media_inst->isAnyMediaShowing() ||
media_inst->isParcelMediaPlaying() ||
media_inst->isParcelAudioPlaying()));

View File

@ -105,8 +105,6 @@ void LLSceneView::draw()
F32 total_physics[] = { 0.f, 0.f };
U32 object_count = 0;
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
@ -121,8 +119,7 @@ void LLSceneView::draw()
U32 idx = object->isAttachment() ? 1 : 0;
LLVolume* volume = object->getVolume();
object_count++;
F32 radius = object->getScale().magVec();
size[idx].push_back(radius);

View File

@ -5451,8 +5451,8 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
LLViewerRegion* last_region;
LLViewerRegion* current_region;
S32 objects_sent = 0;
S32 packets_sent = 0;
// S32 objects_sent = 0;
// S32 packets_sent = 0;
S32 objects_in_this_packet = 0;
bool link_operation = message_name == "ObjectLink";
@ -5584,7 +5584,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
(*pack_body)(node, user_data);
// do any related logging
(*log_func)(node, user_data);
++objects_sent;
// ++objects_sent;
++objects_in_this_packet;
// and on to the next object
@ -5602,7 +5602,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
{
// otherwise send current message and start new one
gMessageSystem->sendReliable( last_region->getHost());
packets_sent++;
// packets_sent++;
objects_in_this_packet = 0;
gMessageSystem->newMessage(message_name.c_str());
@ -5619,7 +5619,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
{
// add root instance into new message
(*pack_body)(linkset_root, user_data);
++objects_sent;
// ++objects_sent;
++objects_in_this_packet;
}
}
@ -5633,7 +5633,7 @@ void LLSelectMgr::sendListToRegions(LLObjectSelectionHandle selected_handle,
if (gMessageSystem->getCurrentSendTotal() > 0)
{
gMessageSystem->sendReliable( current_region->getHost());
packets_sent++;
// packets_sent++;
}
else
{

View File

@ -312,7 +312,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(const LLUUID &asset_id, S32 statu
std::stringstream llsdstream(buffer);
LLSD llsdsettings;
if (LLSDSerialize::deserialize(llsdsettings, llsdstream, -1))
if (LLSDSerialize::deserialize(llsdsettings, llsdstream, LLSDSerialize::SIZE_UNLIMITED))
{
settings = createFromLLSD(llsdsettings);
}
@ -379,7 +379,7 @@ LLSettingsBase::ptr_t LLSettingsVOBase::importFile(const std::string &filename)
return LLSettingsBase::ptr_t();
}
if (!LLSDSerialize::deserialize(settings, file, -1))
if (!LLSDSerialize::deserialize(settings, file, LLSDSerialize::SIZE_UNLIMITED))
{
LL_WARNS("SETTINGS") << "Unable to deserialize settings from '" << filename << "'" << LL_ENDL;
return LLSettingsBase::ptr_t();

View File

@ -79,7 +79,6 @@ void LLSprite::updateFace(LLFace &face)
// First, figure out how many vertices/indices we need.
U32 num_vertices, num_indices;
U32 vertex_count = 0;
// Get the total number of vertices and indices
if (mFollow)
@ -203,25 +202,21 @@ void LLSprite::updateFace(LLFace &face)
*verticesp = mC;
tex_coordsp++;
verticesp++;
vertex_count++;
*tex_coordsp = LLVector2(0.f, 1.f);
*verticesp = mB;
tex_coordsp++;
verticesp++;
vertex_count++;
*tex_coordsp = LLVector2(1.f, 1.f);
*verticesp = mA;
tex_coordsp++;
verticesp++;
vertex_count++;
*tex_coordsp = LLVector2(1.f, 0.0f);
*verticesp = mD;
tex_coordsp++;
verticesp++;
vertex_count++;
// Generate indices, since they're easy.
// Just a series of quads.

View File

@ -4213,7 +4213,7 @@ LLSD transform_cert_args(LLPointer<LLCertificate> cert)
// are actually arrays, and we want to format them as comma separated
// strings, so special case those.
LLSDSerialize::toXML(cert_info[iter->first], std::cout);
if((iter->first== std::string(CERT_KEY_USAGE)) |
if((iter->first == std::string(CERT_KEY_USAGE)) ||
(iter->first == std::string(CERT_EXTENDED_KEY_USAGE)))
{
value = "";

View File

@ -981,8 +981,8 @@ void LLTextureView::draw()
if (imagep->getID() == LLAppViewer::getTextureFetch()->mDebugID)
{
static S32 debug_count = 0;
++debug_count; // for breakpoints
// static S32 debug_count = 0;
// ++debug_count; // for breakpoints
}
F32 pri;

View File

@ -520,7 +520,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
for (i = 0; i < num_objects; i++)
{
BOOL justCreated = FALSE;
S32 msg_size = 0;
bool update_cache = false; //update object cache if it is a full-update or terse update
if (compressed)
@ -577,7 +576,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
else if (update_type != OUT_FULL) // !compressed, !OUT_FULL ==> OUT_FULL_CACHED only?
{
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
msg_size += sizeof(U32);
getUUIDFromLocal(fullid,
local_id,
@ -598,8 +596,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
update_cache = true;
mesgsys->getUUIDFast(_PREHASH_ObjectData, _PREHASH_FullID, fullid, i);
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
msg_size += sizeof(LLUUID);
msg_size += sizeof(U32);
LL_DEBUGS("ObjectUpdate") << "Full Update, obj " << local_id << ", global ID " << fullid << " from " << mesgsys->getSender() << LL_ENDL;
}
objectp = findObject(fullid);
@ -674,7 +670,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
}
mesgsys->getU8Fast(_PREHASH_ObjectData, _PREHASH_PCode, pcode, i);
msg_size += sizeof(U8);
}
#ifdef IGNORE_DEAD
@ -794,14 +789,12 @@ void LLViewerObjectList::processCachedObjectUpdate(LLMessageSystem *mesgsys,
for (S32 i = 0; i < num_objects; i++)
{
S32 msg_size = 0;
U32 id;
U32 crc;
U32 flags;
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, id, i);
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_CRC, crc, i);
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_UpdateFlags, flags, i);
msg_size += sizeof(U32) * 2;
LL_DEBUGS("ObjectUpdate") << "got probe for id " << id << " crc " << crc << LL_ENDL;
dumpStack("ObjectUpdateStack");
@ -856,7 +849,6 @@ void LLViewerObjectList::setAllObjectDefaultTextures(U32 nChannel, bool fShowDef
void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
{
S32 i;
S32 num_objects = 0;
LLViewerObject *objectp;
S32 num_updates, max_value;
@ -913,8 +905,6 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
objectp = mObjects[i];
if (!objectp->isDead())
{
num_objects++;
// Update distance & gpw
objectp->setPixelAreaAndAngle(agent); // Also sets the approx. pixel area
objectp->updateTextures(); // Update the image levels of textures for this object.

View File

@ -408,7 +408,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
LLStrider<U16> &indicesp,
U32 &index_offset)
{
S32 vertex_count = 0;
S32 i, x, y;
S32 num_vertices;
@ -443,7 +442,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
// North patch
@ -456,7 +454,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
@ -493,7 +490,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
// Iterate through the north patch's points
@ -507,7 +503,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
@ -551,7 +546,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
// Iterate through the north patch's points
@ -565,7 +559,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
normalsp++;
texCoords0p++;
texCoords1p++;
vertex_count++;
}
for (i = 0; i < length; i++)

View File

@ -6649,7 +6649,6 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
LLSpatialGroup::buffer_map_t buffer_map;
LLViewerTexture* last_tex = NULL;
S32 buffer_index = 0;
S32 texture_index_channels = 1;
@ -6662,11 +6661,6 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
{
texture_index_channels = gDeferredAlphaProgram.mFeatures.mIndexedTextureChannels;
}
if (distance_sort)
{
buffer_index = -1;
}
static LLCachedControl<U32> max_texture_index(gSavedSettings, "RenderMaxTextureIndex", 16);
texture_index_channels = llmin(texture_index_channels, (S32) max_texture_index);
@ -6690,14 +6684,9 @@ U32 LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, LLFace
// tex = NULL;
// }
if (last_tex == tex)
{
buffer_index++;
}
else
if (last_tex != tex)
{
last_tex = tex;
buffer_index = 0;
}
bool bake_sunlight = LLPipeline::sBakeSunlight && facep->getDrawable()->isStatic();

View File

@ -4838,13 +4838,6 @@
function="Advanced.WebContentTest"
parameter="HOME_PAGE"/>
</menu_item_call>
<menu_item_call
label="FB Connect Test"
name="FB Connect Test">
<menu_item_call.on_click
function="Advanced.WebContentTest"
parameter="https://cryptic-ridge-1632.herokuapp.com/"/>
</menu_item_call>
<menu_item_call
label="Dump SelectMgr"
name="Dump SelectMgr">