diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/lldrawable.cpp | 57 | ||||
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llglsandbox.cpp | 53 | ||||
-rw-r--r-- | indra/newview/llimview.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llselectmgr.cpp | 16 | ||||
-rw-r--r-- | indra/newview/lltoolselect.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 695 | ||||
-rw-r--r-- | indra/newview/llviewermenu.h | 53 | ||||
-rw-r--r-- | indra/newview/llviewermenufile.cpp | 4 | ||||
-rwxr-xr-x | indra/newview/llviewerregion.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 89 | ||||
-rw-r--r-- | indra/newview/llvoavatar.cpp | 89 | ||||
-rw-r--r-- | indra/newview/llvoavatar.h | 12 | ||||
-rw-r--r-- | indra/newview/llvoicevisualizer.cpp | 3 | ||||
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llwearablelist.cpp | 17 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 7 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_sound.xml | 82 |
19 files changed, 513 insertions, 720 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9380b0d6f7..82eb98b06b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13422,6 +13422,17 @@ <key>Value</key> <integer>4</integer> </map> + <key>VoiceVisualizerEnabled</key> + <map> + <key>Comment</key> + <string>Display voice dot indicator above an avatar</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> <key>WarningsAsChat</key> <map> <key>Comment</key> diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index ae48db24bc..70ae4ee13f 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1067,16 +1067,16 @@ F32 LLDrawable::getVisibilityRadius() const { return 0.f; } - else if (isLight()) + + if (isLight()) { - const LLVOVolume *vov = getVOVolume(); - if (vov) + if (const LLVOVolume* vov = getVOVolume()) { return llmax(getRadius(), vov->getLightRadius()); - } else { - // LL_WARNS() ? } + // LL_WARNS() ? } + return getRadius(); } @@ -1089,16 +1089,14 @@ bool LLDrawable::isVisible() const { if (LLViewerOctreeEntryData::isVisible()) { - return true; + return true; } + LLViewerOctreeGroup* group = mEntry->getGroup(); + if (group && group->isVisible()) { - LLViewerOctreeGroup* group = mEntry->getGroup(); - if (group && group->isVisible()) - { - LLViewerOctreeEntryData::setVisible(); - return true; - } + LLViewerOctreeEntryData::setVisible(); + return true; } return false; @@ -1107,27 +1105,30 @@ bool LLDrawable::isVisible() const //virtual bool LLDrawable::isRecentlyVisible() const { - //currently visible or visible in the previous frame. - bool vis = LLViewerOctreeEntryData::isRecentlyVisible(); + // Currently visible or visible in the previous frame. + if (LLViewerOctreeEntryData::isRecentlyVisible()) + { + return true; + } - if(!vis) + const U32 MIN_VIS_FRAME_RANGE = 2 ; // Two frames: the current one and the last one. + if (sCurVisible - getVisible() < MIN_VIS_FRAME_RANGE) { - const U32 MIN_VIS_FRAME_RANGE = 2 ; //two frames:the current one and the last one. - vis = (sCurVisible - getVisible() < MIN_VIS_FRAME_RANGE); + return true; } - return vis ; + return false; } void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) - { +{ LLSpatialGroup* cur_groupp = (LLSpatialGroup*)getGroup(); //precondition: mGroupp MUST be null or DEAD or mGroupp MUST NOT contain this //llassert(!cur_groupp || cur_groupp->isDead() || !cur_groupp->hasElement(this)); //precondition: groupp MUST be null or groupp MUST contain this - llassert(!groupp || (LLSpatialGroup*)groupp->hasElement(this)); + llassert(!groupp || groupp->hasElement(this)); if (cur_groupp != groupp && getVOVolume()) { @@ -1136,8 +1137,7 @@ void LLDrawable::setGroup(LLViewerOctreeGroup *groupp) //contained by its drawable's spatial group for (S32 i = 0; i < getNumFaces(); ++i) { - LLFace* facep = getFace(i); - if (facep) + if (LLFace* facep = getFace(i)) { facep->clearVertexBuffer(); } @@ -1166,7 +1166,7 @@ LLSpatialPartition* LLDrawable::getSpatialPartition() !getVOVolume() || isStatic()) { - retval = gPipeline.getSpatialPartition((LLViewerObject*)mVObjp); + retval = gPipeline.getSpatialPartition(mVObjp); } else if (isRoot()) { @@ -1274,13 +1274,12 @@ LLSpatialBridge::LLSpatialBridge(LLDrawable* root, bool render_by_group, U32 dat LLSpatialBridge::~LLSpatialBridge() { - if(mEntry) + if (mEntry) { - LLSpatialGroup* group = getSpatialGroup(); - if (group) - { - group->getSpatialPartition()->remove(this, group); - } + if (LLSpatialGroup* group = getSpatialGroup()) + { + group->getSpatialPartition()->remove(this, group); + } } //delete octree here so listeners will still be able to access bridge specific state diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index 00e7dae657..fe0916bf15 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -450,7 +450,8 @@ void LLFloaterIMSessionTab::enableDisableCallBtn() else { // We allow to start call from this state only - if (mSession->mVoiceChannel->getState() == LLVoiceChannel::STATE_NO_CHANNEL_INFO && + if (mSession->mVoiceChannel && + !mSession->mVoiceChannel->callStarted() && LLVoiceClient::instanceExists()) { LLVoiceClient* client = LLVoiceClient::getInstance(); @@ -494,10 +495,7 @@ void LLFloaterIMSessionTab::onCallButtonClicked() } else { - LLVoiceChannel::EState channel_state = mSession && mSession->mVoiceChannel ? - mSession->mVoiceChannel->getState() : LLVoiceChannel::STATE_NO_CHANNEL_INFO; - // We allow to start call from this state only - if (channel_state == LLVoiceChannel::STATE_NO_CHANNEL_INFO) + if (mSession->mVoiceChannel && !mSession->mVoiceChannel->callStarted()) { gIMMgr->startCall(mSessionID); } diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 930a8c28d9..0248f5710f 100644 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -1121,57 +1121,6 @@ F32 gpu_benchmark() LLGLSLShader::unbind(); - F32 time_passed = 0; // seconds - - { //run CPU timer benchmark - glFinish(); - gBenchmarkProgram.bind(); - for (S32 c = -1; c < samples && time_passed < time_limit; ++c) - { - LLTimer timer; - timer.start(); - - for (U32 i = 0; i < count; ++i) - { - dest[i].bindTarget(); - texHolder.bind(i); - buff->setBuffer(); - buff->drawArrays(LLRender::TRIANGLES, 0, 3); - dest[i].flush(); - } - - //wait for current batch of copies to finish - glFinish(); - - F32 time = timer.getElapsedTimeF32(); - time_passed += time; - - if (c >= 0) // <-- ignore the first sample as it tends to be artificially slow - { - //store result in gigabytes per second - F32 gb = (F32)((F64)(res * res * 8 * count)) / (1000000000); - F32 gbps = gb / time; - results.push_back(gbps); - } - } - gBenchmarkProgram.unbind(); - } - - std::sort(results.begin(), results.end()); - - F32 gbps = results[results.size()/2]; - - LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to CPU timers, " << (F32)results.size() << " tests took " << time_passed << " seconds" << LL_ENDL; - -#if LL_DARWIN - if (gbps > 512.f) - { - LL_WARNS("Benchmark") << "Memory bandwidth is improbably high and likely incorrect; discarding result." << LL_ENDL; - //OSX is probably lying, discard result - return -1.f; - } -#endif - // run GPU timer benchmark { ShaderProfileHelper initProfile; @@ -1196,7 +1145,7 @@ F32 gpu_benchmark() F64 samples_drawn = (F64)gBenchmarkProgram.mSamplesDrawn; F64 gpixels_drawn = samples_drawn / 1000000000.0; F32 samples_sec = (F32)(gpixels_drawn/seconds); - gbps = samples_sec*4; // 4 bytes per sample + F32 gbps = samples_sec*4; // 4 bytes per sample LL_INFOS("Benchmark") << "Memory bandwidth is " << llformat("%.3f", gbps) << " GB/sec according to ARB_timer_query, total time " << seconds << " seconds" << LL_ENDL; diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 136b59f3a6..06cf9919b6 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -390,11 +390,11 @@ void notify_of_message(const LLSD& msg, bool is_dnd_msg) } else { - LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg)); + } + } } } -} - } if (store_dnd_message) { // If in DND mode, allow notification to be stored so upon DND exit @@ -4178,11 +4178,16 @@ public: } if (input["body"]["info"].has("voice_channel_info")) { + // new voice channel info incoming, update and re-activate call + // if currently in a call. LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id); if (session) { - session->initVoiceChannel(input["body"]["info"]["voice_channel_info"]); - session->mVoiceChannel->activate(); + if (session->mVoiceChannel && session->mVoiceChannel->callStarted()) + { + session->initVoiceChannel(input["body"]["info"]["voice_channel_info"]); + session->mVoiceChannel->activate(); + } } } } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 342048252f..51da051340 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -103,20 +103,12 @@ LLViewerObject* getSelectedParentObject(LLViewerObject *object) ; // Consts // -const F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f; -const S32 MAX_SILS_PER_FRAME = 50; -const S32 MAX_OBJECTS_PER_PACKET = 254; +constexpr F32 SILHOUETTE_UPDATE_THRESHOLD_SQUARED = 0.02f; +constexpr S32 MAX_SILS_PER_FRAME = 50; +constexpr S32 MAX_OBJECTS_PER_PACKET = 254; // For linked sets -const S32 MAX_CHILDREN_PER_TASK = 255; +constexpr S32 MAX_CHILDREN_PER_TASK = 255; -// -// Globals -// - -//bool gDebugSelectMgr = false; - -//bool gHideSelectedObjects = false; -//bool gAllowSelectAvatar = false; bool LLSelectMgr::sRectSelectInclusive = true; bool LLSelectMgr::sRenderHiddenSelections = true; diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index cc04f9e3fc..5ccda7d4eb 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -48,11 +48,8 @@ #include "llvoavatarself.h" #include "llworld.h" -// Globals -//extern bool gAllowSelectAvatar; - -const F32 SELECTION_ROTATION_TRESHOLD = 0.1f; -const F32 SELECTION_SITTING_ROTATION_TRESHOLD = 3.2f; //radian +constexpr F32 SELECTION_ROTATION_TRESHOLD = 0.1f; +constexpr F32 SELECTION_SITTING_ROTATION_TRESHOLD = 3.2f; //radian LLToolSelect::LLToolSelect( LLToolComposite* composite ) : LLTool( std::string("Select"), composite ), diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index d8c4e03d93..df60130c9f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -154,27 +154,18 @@ typedef LLPointer<LLViewerObject> LLViewerObjectPtr; static boost::unordered_map<std::string, LLStringExplicit> sDefaultItemLabels; -bool enable_land_build(void*); -bool enable_object_build(void*); +LLVOAvatar* find_avatar_from_object(LLViewerObject* object); +LLVOAvatar* find_avatar_from_object(const LLUUID& object_id); -LLVOAvatar* find_avatar_from_object( LLViewerObject* object ); -LLVOAvatar* find_avatar_from_object( const LLUUID& object_id ); - -void handle_test_load_url(void*); +void handle_test_load_url(); // // Evil hackish imported globals -//extern bool gHideSelectedObjects; -//extern bool gAllowSelectAvatar; -//extern bool gDebugAvatarRotation; extern bool gDebugClicks; extern bool gDebugWindowProc; extern bool gShaderProfileFrame; -//extern bool gDebugTextEditorTips; -//extern bool gDebugSelectMgr; - // // Globals // @@ -214,24 +205,22 @@ LLContextMenu* gDetachBodyPartPieMenus[9]; // Local prototypes // File Menu -void handle_compress_image(void*); -void handle_compress_file_test(void*); +void handle_compress_image(); +void handle_compress_file_test(); // Edit menu -void handle_dump_group_info(void *); -void handle_dump_capabilities_info(void *); +void handle_dump_group_info(); +void handle_dump_capabilities_info(); // Advanced->Consoles menu -void handle_region_dump_settings(void*); -void handle_region_dump_temp_asset_data(void*); -void handle_region_clear_temp_asset_data(void*); +void handle_region_dump_settings(); +void handle_region_dump_temp_asset_data(); +void handle_region_clear_temp_asset_data(); // Object pie menu bool sitting_on_selection(); -void near_sit_object(); -//void label_sit_or_stand(std::string& label, void*); // buy and take alias into the same UI positions, so these // declarations handle this mess. bool is_selection_buy_not_take(); @@ -246,107 +235,99 @@ void handle_buy_object(LLSaleInfo sale_info); void handle_buy_contents(LLSaleInfo sale_info); // Land pie menu -void near_sit_down_point(bool success, void *); - -// Avatar pie menu +void near_sit_down_point(bool success, void*); // Debug menu - - -void velocity_interpolate( void* ); -void handle_visual_leak_detector_toggle(void*); -void handle_rebake_textures(void*); -bool check_admin_override(void*); -void handle_admin_override_toggle(void*); +void handle_visual_leak_detector_toggle(); +void handle_rebake_textures(); +bool check_admin_override(); +void handle_admin_override_toggle(); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER -void handle_toggle_hacked_godmode(void*); -bool check_toggle_hacked_godmode(void*); -bool enable_toggle_hacked_godmode(void*); +void handle_toggle_hacked_godmode(); +bool check_toggle_hacked_godmode(); +bool enable_toggle_hacked_godmode(); #endif -void toggle_show_xui_names(void *); -bool check_show_xui_names(void *); +void toggle_show_xui_names(); +bool check_show_xui_names(); // Debug UI -void handle_buy_currency_test(void*); +void handle_buy_currency_test(); -void handle_god_mode(void*); +void handle_god_mode(); // God menu -void handle_leave_god_mode(void*); +void handle_leave_god_mode(); void handle_reset_view(); -void handle_duplicate_in_place(void*); - -void handle_object_owner_self(void*); -void handle_object_owner_permissive(void*); -void handle_object_lock(void*); -void handle_object_asset_ids(void*); -void force_take_copy(void*); - -void handle_force_parcel_owner_to_me(void*); -void handle_force_parcel_to_content(void*); -void handle_claim_public_land(void*); - -void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new avatar geometry -void reload_vertex_shader(void *); -void handle_disconnect_viewer(void *); - -void force_error_breakpoint(void *); -void force_error_llerror(void *); -void force_error_llerror_msg(void*); -void force_error_bad_memory_access(void *); -void force_error_infinite_loop(void *); -void force_error_software_exception(void *); -void force_error_os_exception(void*); -void force_error_driver_crash(void *); -void force_error_coroutine_crash(void *); -void force_error_thread_crash(void *); - -void handle_force_delete(void*); -void print_object_info(void*); -void print_agent_nvpairs(void*); -void toggle_debug_menus(void*); +void handle_object_owner_self(); +void handle_object_owner_permissive(); +void handle_object_lock(); +void handle_object_asset_ids(); +void force_take_copy(); + +void handle_force_parcel_owner_to_me(); +void handle_force_parcel_to_content(); +void handle_claim_public_land(); + +void handle_god_request_avatar_geometry(); // Hack for easy testing of new avatar geometry +void reload_vertex_shader(); +void handle_disconnect_viewer(); + +void force_error_breakpoint(); +void force_error_llerror(); +void force_error_llerror_msg(); +void force_error_bad_memory_access(); +void force_error_infinite_loop(); +void force_error_software_exception(); +void force_error_os_exception(); +void force_error_driver_crash(); +void force_error_coroutine_crash(); +void force_error_thread_crash(); + +void handle_force_delete(); +void print_object_info(); +void print_agent_nvpairs(); void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExtStat ext_status); -void dump_select_mgr(void*); +void dump_select_mgr(); -void dump_inventory(void*); -void toggle_visibility(void*); -bool get_visibility(void*); +void dump_inventory(); +void toggle_visibility(LLView* viewp); +bool get_visibility(LLView* viewp); // Avatar Pie menu void request_friendship(const LLUUID& agent_id); // Tools menu -void handle_selected_texture_info(void*); +void handle_selected_texture_info(); void handle_selected_material_info(); -void handle_dump_followcam(void*); -void handle_viewer_enable_message_log(void*); -void handle_viewer_disable_message_log(void*); +void handle_dump_followcam(); +void handle_viewer_enable_message_log(); +void handle_viewer_disable_message_log(); -bool enable_buy_land(void*); +bool enable_buy_land(); // Help menu -void handle_test_male(void *); -void handle_test_female(void *); -void handle_dump_attachments(void *); -void handle_dump_avatar_local_textures(void*); -void handle_debug_avatar_textures(void*); -void handle_grab_baked_texture(void*); -bool enable_grab_baked_texture(void*); -void handle_dump_region_object_cache(void*); -void handle_reset_interest_lists(void *); +void handle_test_male(); +void handle_test_female(); +void handle_dump_attachments(); +void handle_dump_avatar_local_textures(); +void handle_debug_avatar_textures(); +void handle_grab_baked_texture(EBakedTextureIndex baked_tex_index); +bool enable_grab_baked_texture(EBakedTextureIndex baked_tex_index); +void handle_dump_region_object_cache(); +void handle_reset_interest_lists(); -bool enable_save_into_task_inventory(void*); +bool enable_save_into_task_inventory(); bool enable_detach(const LLSD& = LLSD()); -void menu_toggle_attached_lights(void* user_data); -void menu_toggle_attached_particles(void* user_data); +void menu_toggle_attached_lights(); +void menu_toggle_attached_particles(); class LLMenuParcelObserver : public LLParcelObserver { @@ -383,12 +364,12 @@ void LLMenuParcelObserver::changed() if (!mLandBuyPassHandle.isDead()) { LLParcel *parcel = LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(); - static_cast<LLMenuItemCallGL*>(mLandBuyPassHandle.get())->setEnabled(LLPanelLandGeneral::enableBuyPass(NULL) && !(parcel->getOwnerID() == gAgent.getID())); + static_cast<LLMenuItemCallGL*>(mLandBuyPassHandle.get())->setEnabled(LLPanelLandGeneral::enableBuyPass(nullptr) && parcel->getOwnerID() != gAgentID); } if (!mLandBuyHandle.isDead()) { - bool buyable = enable_buy_land(NULL); + bool buyable = enable_buy_land(); static_cast<LLMenuItemCallGL*>(mLandBuyHandle.get())->setEnabled(buyable); } } @@ -444,7 +425,7 @@ void LLSLMMenuUpdater::setMerchantMenu() if (marketplacelistings_id.isNull()) { U32 mkt_status = LLMarketplaceData::instance().getSLMStatus(); - bool is_merchant = (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT) || (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT); + bool is_merchant = mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT || mkt_status == MarketplaceStatusCodes::MARKET_PLACE_MIGRATED_MERCHANT; if (is_merchant) { gInventory.ensureCategoryForTypeExists(LLFolderType::FT_MARKETPLACE_LISTINGS); @@ -476,12 +457,14 @@ void LLSLMMenuUpdater::checkMerchantStatus(bool force) void set_merchant_SLM_menu() { - if(gSLMMenuUpdater) gSLMMenuUpdater->setMerchantMenu(); + if (gSLMMenuUpdater) + gSLMMenuUpdater->setMerchantMenu(); } void check_merchant_status(bool force) { - if(gSLMMenuUpdater) gSLMMenuUpdater->checkMerchantStatus(force); + if (gSLMMenuUpdater) + gSLMMenuUpdater->checkMerchantStatus(force); } void init_menus() @@ -623,11 +606,11 @@ class LLAdvancedToggleConsole : public view_listener_t std::string console_type = userdata.asString(); if ("texture" == console_type) { - toggle_visibility( (void*)gTextureView ); + toggle_visibility(gTextureView); } else if ("debug" == console_type) { - toggle_visibility( (void*)static_cast<LLUICtrl*>(gDebugView->mDebugConsolep)); + toggle_visibility(gDebugView->mDebugConsolep); } else if ("fast timers" == console_type) { @@ -635,11 +618,11 @@ class LLAdvancedToggleConsole : public view_listener_t } else if ("scene view" == console_type) { - toggle_visibility( (void*)gSceneView); + toggle_visibility(gSceneView); } else if ("scene monitor" == console_type) { - toggle_visibility( (void*)gSceneMonitorView); + toggle_visibility(gSceneMonitorView); } return true; @@ -653,11 +636,11 @@ class LLAdvancedCheckConsole : public view_listener_t bool new_value = false; if ("texture" == console_type) { - new_value = get_visibility( (void*)gTextureView ); + new_value = get_visibility(gTextureView); } else if ("debug" == console_type) { - new_value = get_visibility( (void*)((LLView*)gDebugView->mDebugConsolep) ); + new_value = get_visibility(gDebugView->mDebugConsolep); } else if ("fast timers" == console_type) { @@ -665,11 +648,11 @@ class LLAdvancedCheckConsole : public view_listener_t } else if ("scene view" == console_type) { - new_value = get_visibility( (void*) gSceneView); + new_value = get_visibility(gSceneView); } else if ("scene monitor" == console_type) { - new_value = get_visibility( (void*) gSceneMonitorView); + new_value = get_visibility(gSceneMonitorView); } return new_value; @@ -690,15 +673,15 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t std::string info_type = userdata.asString(); if ("region" == info_type) { - handle_region_dump_settings(NULL); + handle_region_dump_settings(); } else if ("group" == info_type) { - handle_dump_group_info(NULL); + handle_dump_group_info(); } else if ("capabilities" == info_type) { - handle_dump_capabilities_info(NULL); + handle_dump_capabilities_info(); } return true; } @@ -771,7 +754,7 @@ class LLAdvancedClearGroupCache : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLGroupMgr::debugClearAllGroups(NULL); + LLGroupMgr::debugClearAllGroups(nullptr); return true; } }; @@ -782,7 +765,7 @@ class LLAdvancedClearGroupCache : public view_listener_t ///////////////// // RENDER TYPE // ///////////////// -U32 render_type_from_string(std::string render_type) +U32 render_type_from_string(std::string_view render_type) { if ("simple" == render_type) { @@ -901,7 +884,7 @@ class LLAdvancedCheckRenderType : public view_listener_t ///////////// // FEATURE // ///////////// -U32 feature_from_string(std::string feature) +U32 feature_from_string(std::string_view feature) { if ("ui" == feature) { @@ -1042,7 +1025,7 @@ class LLAdvancedSetDisplayTextureDensity : public view_listener_t ////////////////// // INFO DISPLAY // ////////////////// -U64 info_display_from_string(std::string info_display) +U64 info_display_from_string(std::string_view info_display) { if ("verify" == info_display) { @@ -1271,7 +1254,7 @@ class LLAdvancedSelectedTextureInfo : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_selected_texture_info(NULL); + handle_selected_texture_info(); return true; } }; @@ -1307,7 +1290,7 @@ class LLAdvancedDumpScriptedCamera : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_dump_followcam(NULL); + handle_dump_followcam(); return true; } }; @@ -1323,7 +1306,7 @@ class LLAdvancedDumpRegionObjectCache : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_dump_region_object_cache(NULL); + handle_dump_region_object_cache(); return true; } }; @@ -1382,7 +1365,7 @@ class LLAdvancedResetInterestLists : public view_listener_t { bool handleEvent(const LLSD &userdata) { // Reset all region interest lists - handle_reset_interest_lists(NULL); + handle_reset_interest_lists(); return true; } }; @@ -1451,7 +1434,7 @@ class LLAdvancedBuyCurrencyTest : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_buy_currency_test(NULL); + handle_buy_currency_test(); return true; } }; @@ -1466,7 +1449,7 @@ class LLAdvancedDumpSelectMgr : public view_listener_t { bool handleEvent(const LLSD& userdata) { - dump_select_mgr(NULL); + dump_select_mgr(); return true; } }; @@ -1482,7 +1465,7 @@ class LLAdvancedDumpInventory : public view_listener_t { bool handleEvent(const LLSD& userdata) { - dump_inventory(NULL); + dump_inventory(); return true; } }; @@ -1498,7 +1481,7 @@ class LLAdvancedPrintSelectedObjectInfo : public view_listener_t { bool handleEvent(const LLSD& userdata) { - print_object_info(NULL); + print_object_info(); return true; } }; @@ -1514,7 +1497,7 @@ class LLAdvancedPrintAgentInfo : public view_listener_t { bool handleEvent(const LLSD& userdata) { - print_agent_nvpairs(NULL); + print_agent_nvpairs(); return true; } }; @@ -1627,7 +1610,7 @@ class LLAdvancedToggleXUINameTooltips : public view_listener_t { bool handleEvent(const LLSD& userdata) { - toggle_show_xui_names(NULL); + toggle_show_xui_names(); return true; } }; @@ -1636,7 +1619,7 @@ class LLAdvancedCheckXUINameTooltips : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = check_show_xui_names(NULL); + bool new_value = check_show_xui_names(); return new_value; } }; @@ -1737,7 +1720,7 @@ class LLAdvancedToggleXUINames : public view_listener_t { bool handleEvent(const LLSD& userdata) { - toggle_show_xui_names(NULL); + toggle_show_xui_names(); return true; } }; @@ -1746,7 +1729,7 @@ class LLAdvancedCheckXUINames : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = check_show_xui_names(NULL); + bool new_value = check_show_xui_names(); return new_value; } }; @@ -1764,27 +1747,27 @@ class LLAdvancedGrabBakedTexture : public view_listener_t std::string texture_type = userdata.asString(); if ("iris" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_EYES ); + handle_grab_baked_texture(BAKED_EYES); } else if ("head" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_HEAD ); + handle_grab_baked_texture(BAKED_HEAD); } else if ("upper" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_UPPER ); + handle_grab_baked_texture(BAKED_UPPER); } else if ("lower" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_LOWER ); + handle_grab_baked_texture(BAKED_LOWER); } else if ("skirt" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_SKIRT ); + handle_grab_baked_texture(BAKED_SKIRT); } else if ("hair" == texture_type) { - handle_grab_baked_texture( (void*)BAKED_HAIR ); + handle_grab_baked_texture(BAKED_HAIR); } return true; @@ -1800,27 +1783,27 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t if ("iris" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_EYES ); + new_value = enable_grab_baked_texture(BAKED_EYES); } else if ("head" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_HEAD ); + new_value = enable_grab_baked_texture(BAKED_HEAD); } else if ("upper" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_UPPER ); + new_value = enable_grab_baked_texture(BAKED_UPPER); } else if ("lower" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_LOWER ); + new_value = enable_grab_baked_texture(BAKED_LOWER); } else if ("skirt" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_SKIRT ); + new_value = enable_grab_baked_texture(BAKED_SKIRT); } else if ("hair" == texture_type) { - new_value = enable_grab_baked_texture( (void*)BAKED_HAIR ); + new_value = enable_grab_baked_texture(BAKED_HAIR); } return new_value; @@ -1905,7 +1888,7 @@ class LLAdvancedToggleCharacterGeometry : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_god_request_avatar_geometry(NULL); + handle_god_request_avatar_geometry(); return true; } }; @@ -1919,7 +1902,7 @@ class LLAdvancedTestMale : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_test_male(NULL); + handle_test_male(); return true; } }; @@ -1929,7 +1912,7 @@ class LLAdvancedTestFemale : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_test_female(NULL); + handle_test_female(); return true; } }; @@ -1938,7 +1921,7 @@ class LLAdvancedForceParamsToDefault : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLAgent::clearVisualParams(NULL); + LLAgent::clearVisualParams(nullptr); return true; } }; @@ -2001,7 +1984,7 @@ class LLAdvancedReloadVertexShader : public view_listener_t { bool handleEvent(const LLSD& userdata) { - reload_vertex_shader(NULL); + reload_vertex_shader(); return true; } }; @@ -2165,7 +2148,7 @@ class LLAdvancedDumpAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_dump_attachments(NULL); + handle_dump_attachments(); return true; } }; @@ -2181,7 +2164,7 @@ class LLAdvancedRebakeTextures : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_rebake_textures(NULL); + handle_rebake_textures(); return true; } }; @@ -2199,7 +2182,7 @@ class LLAdvancedDebugAvatarTextures : public view_listener_t { if (gAgent.isGodlike()) { - handle_debug_avatar_textures(NULL); + handle_debug_avatar_textures(); } return true; } @@ -2215,7 +2198,7 @@ class LLAdvancedDumpAvatarLocalTextures : public view_listener_t bool handleEvent(const LLSD& userdata) { #ifndef LL_RELEASE_FOR_DOWNLOAD - handle_dump_avatar_local_textures(NULL); + handle_dump_avatar_local_textures(); #endif return true; } @@ -2232,7 +2215,7 @@ class LLAdvancedEnableMessageLog : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_viewer_enable_message_log(NULL); + handle_viewer_enable_message_log(); return true; } }; @@ -2241,7 +2224,7 @@ class LLAdvancedDisableMessageLog : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_viewer_disable_message_log(NULL); + handle_viewer_disable_message_log(); return true; } }; @@ -2432,7 +2415,7 @@ class LLAdvancedCompressImage : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_compress_image(NULL); + handle_compress_image(); return true; } }; @@ -2447,7 +2430,7 @@ class LLAdvancedCompressFileTest : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_compress_file_test(NULL); + handle_compress_file_test(); return true; } }; @@ -2488,7 +2471,7 @@ class LLAdvancedToggleViewAdminOptions : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_admin_override_toggle(NULL); + handle_admin_override_toggle(); return true; } }; @@ -2497,7 +2480,7 @@ class LLAdvancedToggleVisualLeakDetector : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_visual_leak_detector_toggle(NULL); + handle_visual_leak_detector_toggle(); return true; } }; @@ -2506,7 +2489,7 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = check_admin_override(NULL) || gAgent.isGodlike(); + bool new_value = check_admin_override() || gAgent.isGodlike(); return new_value; } }; @@ -2520,7 +2503,7 @@ class LLAdvancedRequestAdminStatus : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_god_mode(NULL); + handle_god_mode(); return true; } }; @@ -2529,7 +2512,7 @@ class LLAdvancedLeaveAdminStatus : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_leave_god_mode(NULL); + handle_leave_god_mode(); return true; } }; @@ -2542,7 +2525,7 @@ class LLAdvancedForceErrorBreakpoint : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_breakpoint(NULL); + force_error_breakpoint(); return true; } }; @@ -2551,7 +2534,7 @@ class LLAdvancedForceErrorLlerror : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_llerror(NULL); + force_error_llerror(); return true; } }; @@ -2560,7 +2543,7 @@ class LLAdvancedForceErrorLlerrorMsg: public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_llerror_msg(NULL); + force_error_llerror_msg(); return true; } }; @@ -2569,7 +2552,7 @@ class LLAdvancedForceErrorBadMemoryAccess : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_bad_memory_access(NULL); + force_error_bad_memory_access(); return true; } }; @@ -2584,7 +2567,7 @@ class LLAdvancedForceErrorBadMemoryAccessCoro : public view_listener_t // Wait for one mainloop() iteration, letting the enclosing // handleEvent() method return. llcoro::suspend(); - force_error_bad_memory_access(NULL); + force_error_bad_memory_access(); }); return true; } @@ -2594,7 +2577,7 @@ class LLAdvancedForceErrorInfiniteLoop : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_infinite_loop(NULL); + force_error_infinite_loop(); return true; } }; @@ -2603,7 +2586,7 @@ class LLAdvancedForceErrorSoftwareException : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_software_exception(NULL); + force_error_software_exception(); return true; } }; @@ -2612,7 +2595,7 @@ class LLAdvancedForceOSException: public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_os_exception(NULL); + force_error_os_exception(); return true; } }; @@ -2627,7 +2610,7 @@ class LLAdvancedForceErrorSoftwareExceptionCoro : public view_listener_t // Wait for one mainloop() iteration, letting the enclosing // handleEvent() method return. llcoro::suspend(); - force_error_software_exception(NULL); + force_error_software_exception(); }); return true; } @@ -2637,7 +2620,7 @@ class LLAdvancedForceErrorDriverCrash : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_driver_crash(NULL); + force_error_driver_crash(); return true; } }; @@ -2646,7 +2629,7 @@ class LLAdvancedForceErrorCoroutineCrash : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_coroutine_crash(NULL); + force_error_coroutine_crash(); return true; } }; @@ -2655,7 +2638,7 @@ class LLAdvancedForceErrorThreadCrash : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_error_thread_crash(NULL); + force_error_thread_crash(); return true; } }; @@ -2664,7 +2647,7 @@ class LLAdvancedForceErrorDisconnectViewer : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_disconnect_viewer(NULL); + handle_disconnect_viewer(); return true; } }; @@ -2676,7 +2659,7 @@ class LLAdvancedHandleToggleHackedGodmode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_toggle_hacked_godmode(NULL); + handle_toggle_hacked_godmode(); return true; } }; @@ -2685,7 +2668,7 @@ class LLAdvancedCheckToggleHackedGodmode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - check_toggle_hacked_godmode(NULL); + check_toggle_hacked_godmode(); return true; } }; @@ -2694,7 +2677,7 @@ class LLAdvancedEnableToggleHackedGodmode : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = enable_toggle_hacked_godmode(NULL); + bool new_value = enable_toggle_hacked_godmode(); return new_value; } }; @@ -2739,7 +2722,7 @@ class LLAdminForceTakeCopy : public view_listener_t { bool handleEvent(const LLSD& userdata) { - force_take_copy(NULL); + force_take_copy(); return true; } }; @@ -2748,7 +2731,7 @@ class LLAdminHandleObjectOwnerSelf : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_object_owner_self(NULL); + handle_object_owner_self(); return true; } }; @@ -2756,7 +2739,7 @@ class LLAdminHandleObjectOwnerPermissive : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_object_owner_permissive(NULL); + handle_object_owner_permissive(); return true; } }; @@ -2765,7 +2748,7 @@ class LLAdminHandleForceDelete : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_force_delete(NULL); + handle_force_delete(); return true; } }; @@ -2774,7 +2757,7 @@ class LLAdminHandleObjectLock : public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_object_lock(NULL); + handle_object_lock(); return true; } }; @@ -2783,7 +2766,7 @@ class LLAdminHandleObjectAssetIDs: public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_object_asset_ids(NULL); + handle_object_asset_ids(); return true; } }; @@ -2793,7 +2776,7 @@ class LLAdminHandleForceParcelOwnerToMe: public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_force_parcel_owner_to_me(NULL); + handle_force_parcel_owner_to_me(); return true; } }; @@ -2801,7 +2784,7 @@ class LLAdminHandleForceParcelToContent: public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_force_parcel_to_content(NULL); + handle_force_parcel_to_content(); return true; } }; @@ -2809,7 +2792,7 @@ class LLAdminHandleClaimPublicLand: public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_claim_public_land(NULL); + handle_claim_public_land(); return true; } }; @@ -2819,7 +2802,7 @@ class LLAdminHandleRegionDumpTempAssetData: public view_listener_t { bool handleEvent(const LLSD& userdata) { - handle_region_dump_temp_asset_data(NULL); + handle_region_dump_temp_asset_data(); return true; } }; @@ -2829,7 +2812,7 @@ class LLAdminOnSaveState: public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLPanelRegionTools::onSaveState(NULL); + LLPanelRegionTools::onSaveState(nullptr); return true; } }; @@ -3315,41 +3298,11 @@ class LLLandEnableBuyPass : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = LLPanelLandGeneral::enableBuyPass(NULL); + bool new_value = LLPanelLandGeneral::enableBuyPass(nullptr); return new_value; } }; -// BUG: Should really check if CLICK POINT is in a parcel where you can build. -bool enable_land_build(void*) -{ - if (gAgent.isGodlike()) return true; - if (gAgent.inPrelude()) return false; - - bool can_build = false; - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (agent_parcel) - { - can_build = agent_parcel->getAllowModify(); - } - return can_build; -} - -// BUG: Should really check if OBJECT is in a parcel where you can build. -bool enable_object_build(void*) -{ - if (gAgent.isGodlike()) return true; - if (gAgent.inPrelude()) return false; - - bool can_build = false; - LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (agent_parcel) - { - can_build = agent_parcel->getAllowModify(); - } - return can_build; -} - bool enable_object_edit() { if (!isAgentAvatarValid()) return false; @@ -3380,12 +3333,6 @@ bool enable_mute_particle() return pick.mParticleOwnerID != LLUUID::null && pick.mParticleOwnerID != gAgent.getID(); } -// mutually exclusive - show either edit option or build in menu -bool enable_object_build() -{ - return !enable_object_edit(); -} - bool enable_object_select_in_pathfinding_linksets() { return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLSelectMgr::getInstance()->selectGetEditableLinksets(); @@ -3484,9 +3431,8 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t } }; -bool enable_has_attachments(void*) +bool enable_has_attachments() { - return false; } @@ -4092,7 +4038,7 @@ void handle_buy_contents(LLSaleInfo sale_info) LLFloaterBuyContents::show(sale_info); } -void handle_region_dump_temp_asset_data(void*) +void handle_region_dump_temp_asset_data() { LL_INFOS() << "Dumping temporary asset data to simulator logs" << LL_ENDL; std::vector<std::string> strings; @@ -4100,7 +4046,7 @@ void handle_region_dump_temp_asset_data(void*) send_generic_message("dumptempassetdata", strings, invoice); } -void handle_region_clear_temp_asset_data(void*) +void handle_region_clear_temp_asset_data() { LL_INFOS() << "Clearing temporary asset data" << LL_ENDL; std::vector<std::string> strings; @@ -4108,7 +4054,7 @@ void handle_region_clear_temp_asset_data(void*) send_generic_message("cleartempassetdata", strings, invoice); } -void handle_region_dump_settings(void*) +void handle_region_dump_settings() { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -4124,12 +4070,12 @@ void handle_region_dump_settings(void*) } } -void handle_dump_group_info(void *) +void handle_dump_group_info() { gAgent.dumpGroupInfo(); } -void handle_dump_capabilities_info(void *) +void handle_dump_capabilities_info() { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -4138,7 +4084,7 @@ void handle_dump_capabilities_info(void *) } } -void handle_dump_region_object_cache(void*) +void handle_dump_region_object_cache() { LLViewerRegion* regionp = gAgent.getRegion(); if (regionp) @@ -4147,7 +4093,7 @@ void handle_dump_region_object_cache(void*) } } -void handle_reset_interest_lists(void *) +void handle_reset_interest_lists() { // Check all regions and reset their interest list for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -4290,12 +4236,12 @@ class LLTogglePanelPeopleTab : public view_listener_t } }; -bool check_admin_override(void*) +bool check_admin_override() { return gAgent.getAdminOverride(); } -void handle_admin_override_toggle(void*) +void handle_admin_override_toggle() { gAgent.setAdminOverride(!gAgent.getAdminOverride()); @@ -4303,7 +4249,7 @@ void handle_admin_override_toggle(void*) show_debug_menus(); } -void handle_visual_leak_detector_toggle(void*) +void handle_visual_leak_detector_toggle() { static bool vld_enabled = false; @@ -4332,12 +4278,12 @@ void handle_visual_leak_detector_toggle(void*) }; } -void handle_god_mode(void*) +void handle_god_mode() { gAgent.requestEnterGodMode(); } -void handle_leave_god_mode(void*) +void handle_leave_god_mode() { gAgent.requestLeaveGodMode(); } @@ -4384,18 +4330,18 @@ void set_god_level(U8 god_level) } #ifdef TOGGLE_HACKED_GODLIKE_VIEWER -void handle_toggle_hacked_godmode(void*) +void handle_toggle_hacked_godmode() { gHackGodmode = !gHackGodmode; set_god_level(gHackGodmode ? GOD_MAINTENANCE : GOD_NOT); } -bool check_toggle_hacked_godmode(void*) +bool check_toggle_hacked_godmode() { return gHackGodmode; } -bool enable_toggle_hacked_godmode(void*) +bool enable_toggle_hacked_godmode() { return !LLGridManager::getInstance()->isInProductionGrid(); } @@ -4419,41 +4365,6 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**) } } -/* -class LLHaveCallingcard : public LLInventoryCollectFunctor -{ -public: - LLHaveCallingcard(const LLUUID& agent_id); - virtual ~LLHaveCallingcard() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item); - bool isThere() const { return mIsThere;} -protected: - LLUUID mID; - bool mIsThere; -}; - -LLHaveCallingcard::LLHaveCallingcard(const LLUUID& agent_id) : - mID(agent_id), - mIsThere(false) -{ -} - -bool LLHaveCallingcard::operator()(LLInventoryCategory* cat, - LLInventoryItem* item) -{ - if(item) - { - if((item->getType() == LLAssetType::AT_CALLINGCARD) - && (item->getCreatorUUID() == mID)) - { - mIsThere = true; - } - } - return false; -} -*/ - bool is_agent_mappable(const LLUUID& agent_id) { const LLRelationship* buddy_info = NULL; @@ -4554,7 +4465,7 @@ bool is_object_sittable() } // only works on pie menu -void handle_object_sit(LLViewerObject *object, const LLVector3 &offset) +void handle_object_sit(LLViewerObject* object, const LLVector3& offset) { // get object selection offset @@ -4603,7 +4514,7 @@ void handle_object_sit(const LLUUID& object_id) handle_object_sit(obj, offset); } -void near_sit_down_point(bool success, void *) +void near_sit_down_point(bool success, void*) { if (success) { @@ -4653,7 +4564,7 @@ class LLLandCanSit : public view_listener_t // // Major mode switching // -void reset_view_final( bool proceed ); +void reset_view_final(bool proceed); void handle_reset_view() { @@ -4663,7 +4574,7 @@ void handle_reset_view() LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "my_outfits")); } gAgentCamera.setFocusOnAvatar(true, false, false); - reset_view_final( true ); + reset_view_final(true); LLFloaterCamera::resetCameraMode(); } @@ -4677,7 +4588,7 @@ class LLViewResetView : public view_listener_t }; // Note: extra parameters allow this function to be called from dialog. -void reset_view_final( bool proceed ) +void reset_view_final(bool proceed) { if( !proceed ) { @@ -4765,54 +4676,7 @@ class LLViewToggleUI : public view_listener_t } }; -void handle_duplicate_in_place(void*) -{ - LL_INFOS() << "handle_duplicate_in_place" << LL_ENDL; - - LLVector3 offset(0.f, 0.f, 0.f); - LLSelectMgr::getInstance()->selectDuplicate(offset, true); -} - - - -/* - * No longer able to support viewer side manipulations in this way - * -void god_force_inv_owner_permissive(LLViewerObject* object, - LLInventoryObject::object_list_t* inventory, - S32 serial_num, - void*) -{ - typedef std::vector<LLPointer<LLViewerInventoryItem> > item_array_t; - item_array_t items; - - LLInventoryObject::object_list_t::const_iterator inv_it = inventory->begin(); - LLInventoryObject::object_list_t::const_iterator inv_end = inventory->end(); - for ( ; inv_it != inv_end; ++inv_it) - { - if(((*inv_it)->getType() != LLAssetType::AT_CATEGORY)) - { - LLInventoryObject* obj = *inv_it; - LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem((LLViewerInventoryItem*)obj); - LLPermissions perm(new_item->getPermissions()); - perm.setMaskBase(PERM_ALL); - perm.setMaskOwner(PERM_ALL); - new_item->setPermissions(perm); - items.push_back(new_item); - } - } - item_array_t::iterator end = items.end(); - item_array_t::iterator it; - for(it = items.begin(); it != end; ++it) - { - // since we have the inventory item in the callback, it should not - // invalidate iteration through the selection manager. - object->updateInventory((*it), TASK_INVENTORY_ITEM_KEY, false); - } -} -*/ - -void handle_object_owner_permissive(void*) +void handle_object_owner_permissive() { // only send this if they're a god. if(gAgent.isGodlike()) @@ -4823,7 +4687,7 @@ void handle_object_owner_permissive(void*) } } -void handle_object_owner_self(void*) +void handle_object_owner_self() { // only send this if they're a god. if(gAgent.isGodlike()) @@ -4833,12 +4697,12 @@ void handle_object_owner_self(void*) } // Shortcut to set owner permissions to not editable. -void handle_object_lock(void*) +void handle_object_lock() { LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, false, PERM_MODIFY); } -void handle_object_asset_ids(void*) +void handle_object_asset_ids() { // only send this if they're a god. if (gAgent.isGodlike()) @@ -4847,17 +4711,17 @@ void handle_object_asset_ids(void*) } } -void handle_force_parcel_owner_to_me(void*) +void handle_force_parcel_owner_to_me() { LLViewerParcelMgr::getInstance()->sendParcelGodForceOwner( gAgent.getID() ); } -void handle_force_parcel_to_content(void*) +void handle_force_parcel_to_content() { LLViewerParcelMgr::getInstance()->sendParcelGodForceToContent(); } -void handle_claim_public_land(void*) +void handle_claim_public_land() { if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion()) { @@ -4899,7 +4763,7 @@ void handle_claim_public_land(void*) // HACK for easily testing new avatar geometry -void handle_god_request_avatar_geometry(void *) +void handle_god_request_avatar_geometry() { if (gAgent.isGodlike()) { @@ -5169,7 +5033,7 @@ void handle_link_objects() class LLObjectReturn : public view_listener_t { public: - LLObjectReturn() : mFirstRegion(NULL) {} + LLObjectReturn() : mFirstRegion() {} private: bool handleEvent(const LLSD& userdata) @@ -5239,7 +5103,7 @@ class LLObjectEnableReturn : public view_listener_t } }; -void force_take_copy(void*) +void force_take_copy() { if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; const LLUUID category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT); @@ -5347,7 +5211,7 @@ void handle_take(bool take_separate) } }); - if(locked_but_takeable_object || + if (locked_but_takeable_object || !you_own_everything) { if(locked_but_takeable_object && you_own_everything) @@ -5930,7 +5794,7 @@ class LLToolsSelectNextPartFace : public view_listener_t { if (gFocusMgr.childHasKeyboardFocus(gFloaterTools)) { - gFocusMgr.setKeyboardFocus(NULL); // force edit toolbox to commit any changes + gFocusMgr.setKeyboardFocus(nullptr); // force edit toolbox to commit any changes } if (fwd || prev) { @@ -6003,7 +5867,7 @@ class LLEditCut : public view_listener_t { bool handleEvent(const LLSD& userdata) { - if( LLEditMenuHandler::gEditMenuHandler ) + if (LLEditMenuHandler::gEditMenuHandler) { LLEditMenuHandler::gEditMenuHandler->cut(); } @@ -6024,7 +5888,7 @@ class LLEditCopy : public view_listener_t { bool handleEvent(const LLSD& userdata) { - if( LLEditMenuHandler::gEditMenuHandler ) + if (LLEditMenuHandler::gEditMenuHandler) { LLEditMenuHandler::gEditMenuHandler->copy(); } @@ -6045,7 +5909,7 @@ class LLEditPaste : public view_listener_t { bool handleEvent(const LLSD& userdata) { - if( LLEditMenuHandler::gEditMenuHandler ) + if (LLEditMenuHandler::gEditMenuHandler) { LLEditMenuHandler::gEditMenuHandler->paste(); } @@ -6068,7 +5932,7 @@ class LLEditDelete : public view_listener_t { // If a text field can do a deletion, it gets precedence over deleting // an object in the world. - if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) + if (LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) { LLEditMenuHandler::gEditMenuHandler->doDelete(); } @@ -6179,7 +6043,7 @@ bool enable_object_delete() class LLObjectsReturnPackage { public: - LLObjectsReturnPackage() : mObjectSelection(), mReturnableObjects(), mError(), mFirstRegion(NULL) {}; + LLObjectsReturnPackage() : mObjectSelection(), mReturnableObjects(), mError(), mFirstRegion(nullptr) {}; ~LLObjectsReturnPackage() { mObjectSelection.clear(); @@ -6236,7 +6100,7 @@ void handle_object_delete() return; } -void handle_force_delete(void*) +void handle_force_delete() { LLSelectMgr::getInstance()->selectForceDelete(); } @@ -6348,12 +6212,12 @@ class LLEditRedo : public view_listener_t -void print_object_info(void*) +void print_object_info() { LLSelectMgr::getInstance()->selectionDump(); } -void print_agent_nvpairs(void*) +void print_agent_nvpairs() { LLViewerObject *objectp; @@ -6402,53 +6266,13 @@ void show_debug_menus() } } -void toggle_debug_menus(void*) +void toggle_debug_menus() { bool visible = ! gSavedSettings.getBOOL("UseDebugMenus"); gSavedSettings.setBOOL("UseDebugMenus", visible); show_debug_menus(); } - -// LLUUID gExporterRequestID; -// std::string gExportDirectory; - -// LLUploadDialog *gExportDialog = NULL; - -// void handle_export_selected( void * ) -// { -// LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); -// if (selection->isEmpty()) -// { -// return; -// } -// LL_INFOS() << "Exporting selected objects:" << LL_ENDL; - -// gExporterRequestID.generate(); -// gExportDirectory = ""; - -// LLMessageSystem* msg = gMessageSystem; -// msg->newMessageFast(_PREHASH_ObjectExportSelected); -// msg->nextBlockFast(_PREHASH_AgentData); -// msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); -// msg->addUUIDFast(_PREHASH_RequestID, gExporterRequestID); -// msg->addS16Fast(_PREHASH_VolumeDetail, 4); - -// for (LLObjectSelection::root_iterator iter = selection->root_begin(); -// iter != selection->root_end(); iter++) -// { -// LLSelectNode* node = *iter; -// LLViewerObject* object = node->getObject(); -// msg->nextBlockFast(_PREHASH_ObjectData); -// msg->addUUIDFast(_PREHASH_ObjectID, object->getID()); -// LL_INFOS() << "Object: " << object->getID() << LL_ENDL; -// } -// msg->sendReliable(gAgent.getRegion()->getHost()); - -// gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); -// } -// - class LLCommunicateNearbyChat : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6626,7 +6450,7 @@ void handle_look_at_selection(const LLSD& param) } } -void handle_zoom_to_object(LLUUID object_id) +void handle_zoom_to_object(const LLUUID& object_id) { const F32 PADDING_FACTOR = 2.f; @@ -6937,28 +6761,28 @@ bool enable_object_sit(LLUICtrl* ctrl) return !sitting_on_sel && is_object_sittable(); } -void dump_select_mgr(void*) +void dump_select_mgr() { LLSelectMgr::getInstance()->dump(); } -void dump_inventory(void*) +void dump_inventory() { gInventory.dumpInventory(); } -void handle_dump_followcam(void*) +void handle_dump_followcam() { LLFollowCamMgr::getInstance()->dump(); } -void handle_viewer_enable_message_log(void*) +void handle_viewer_enable_message_log() { gMessageSystem->startLogging(); } -void handle_viewer_disable_message_log(void*) +void handle_viewer_disable_message_log() { gMessageSystem->stopLogging(); } @@ -7325,7 +7149,7 @@ class LLWorldEnableBuyLand : public view_listener_t } }; -bool enable_buy_land(void*) +bool enable_buy_land() { return LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false); @@ -7411,7 +7235,7 @@ void LLObjectAttachToAvatar::onNearAttachObject(bool success, void *user_data) } LLSelectMgr::getInstance()->sendAttach(cb_data->getSelection(), attachment_id, cb_data->mReplace); } - LLObjectAttachToAvatar::setObjectSelection(NULL); + LLObjectAttachToAvatar::setObjectSelection(nullptr); delete cb_data; } @@ -7990,7 +7814,7 @@ class LLToolsSelectedScriptAction : public view_listener_t } }; -void handle_selected_texture_info(void*) +void handle_selected_texture_info() { for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin(); iter != LLSelectMgr::getInstance()->getSelection()->valid_end(); iter++) @@ -8078,21 +7902,22 @@ void handle_selected_material_info() } } -void handle_test_male(void*) +void handle_test_male() { LLAppearanceMgr::instance().wearOutfitByName("Male Shape & Outfit"); //gGestureList.requestResetFromServer( true ); } -void handle_test_female(void*) +void handle_test_female() { LLAppearanceMgr::instance().wearOutfitByName("Female Shape & Outfit"); //gGestureList.requestResetFromServer( false ); } -void handle_dump_attachments(void*) +void handle_dump_attachments() { - if(!isAgentAvatarValid()) return; + if (!isAgentAvatarValid()) + return; for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin(); iter != gAgentAvatarp->mAttachmentPoints.end(); ) @@ -8294,12 +8119,12 @@ class LLToggleShaderControl : public view_listener_t } }; -void menu_toggle_attached_lights(void* user_data) +void menu_toggle_attached_lights() { LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); } -void menu_toggle_attached_particles(void* user_data) +void menu_toggle_attached_particles() { LLPipeline::sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); } @@ -8317,11 +8142,11 @@ class LLAdvancedHandleAttachedLightParticles: public view_listener_t // update internal flags if (control_name == "RenderAttachedLights") { - menu_toggle_attached_lights(NULL); + menu_toggle_attached_lights(); } else if (control_name == "RenderAttachedParticles") { - menu_toggle_attached_particles(NULL); + menu_toggle_attached_particles(); } return true; } @@ -8436,7 +8261,7 @@ bool LLHasAsset::operator()(LLInventoryCategory* cat, } -bool enable_save_into_task_inventory(void*) +bool enable_save_into_task_inventory() { LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); if(node && (node->mValid) && (!node->mFromTaskID.isNull())) @@ -8455,7 +8280,7 @@ class LLToolsEnableSaveToObjectInventory : public view_listener_t { bool handleEvent(const LLSD& userdata) { - bool new_value = enable_save_into_task_inventory(NULL); + bool new_value = enable_save_into_task_inventory(); return new_value; } }; @@ -8518,12 +8343,12 @@ class LLWorldEnableTeleportHome : public view_listener_t } }; -bool enable_god_full(void*) +bool enable_god_full() { return gAgent.getGodLevel() >= GOD_FULL; } -bool enable_god_liaison(void*) +bool enable_god_liaison() { return gAgent.getGodLevel() >= GOD_LIAISON; } @@ -8533,18 +8358,18 @@ bool is_god_customer_service() return gAgent.getGodLevel() >= GOD_CUSTOMER_SERVICE; } -bool enable_god_basic(void*) +bool enable_god_basic() { return gAgent.getGodLevel() > GOD_NOT; } -void toggle_show_xui_names(void *) +void toggle_show_xui_names() { gSavedSettings.setBOOL("DebugShowXUINames", !gSavedSettings.getBOOL("DebugShowXUINames")); } -bool check_show_xui_names(void *) +bool check_show_xui_names() { return gSavedSettings.getBOOL("DebugShowXUINames"); } @@ -8650,12 +8475,12 @@ class LLToolsEditLinkedParts : public view_listener_t } }; -void reload_vertex_shader(void *) +void reload_vertex_shader() { //THIS WOULD BE AN AWESOME PLACE TO RELOAD SHADERS... just a thought - DaveP } -void handle_dump_avatar_local_textures(void*) +void handle_dump_avatar_local_textures() { gAgentAvatarp->dumpLocalTextures(); } @@ -8665,7 +8490,7 @@ void handle_dump_timers() LLTrace::BlockTimer::dumpCurTimes(); } -void handle_debug_avatar_textures(void*) +void handle_debug_avatar_textures() { LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); if (objectp) @@ -8674,10 +8499,10 @@ void handle_debug_avatar_textures(void*) } } -void handle_grab_baked_texture(void* data) +void handle_grab_baked_texture(EBakedTextureIndex baked_tex_index) { - EBakedTextureIndex baked_tex_index = (EBakedTextureIndex)((intptr_t)data); - if (!isAgentAvatarValid()) return; + if (!isAgentAvatarValid()) + return; const LLUUID& asset_id = gAgentAvatarp->grabBakedTexture(baked_tex_index); LL_INFOS("texture") << "Adding baked texture " << asset_id << " to inventory." << LL_ENDL; @@ -8740,19 +8565,18 @@ void handle_grab_baked_texture(void* data) } } -bool enable_grab_baked_texture(void* data) +bool enable_grab_baked_texture(EBakedTextureIndex baked_tex_index) { - EBakedTextureIndex index = (EBakedTextureIndex)((intptr_t)data); if (isAgentAvatarValid()) { - return gAgentAvatarp->canGrabBakedTexture(index); + return gAgentAvatarp->canGrabBakedTexture(baked_tex_index); } return false; } // Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing. // Returns NULL on failure. -LLVOAvatar* find_avatar_from_object( LLViewerObject* object ) +LLVOAvatar* find_avatar_from_object(LLViewerObject* object) { if (object) { @@ -8776,63 +8600,63 @@ LLVOAvatar* find_avatar_from_object( LLViewerObject* object ) // Returns a pointer to the avatar give the UUID of the avatar OR of an attachment the avatar is wearing. // Returns NULL on failure. -LLVOAvatar* find_avatar_from_object( const LLUUID& object_id ) +LLVOAvatar* find_avatar_from_object(const LLUUID& object_id) { return find_avatar_from_object( gObjectList.findObject(object_id) ); } -void handle_disconnect_viewer(void *) +void handle_disconnect_viewer() { LLAppViewer::instance()->forceDisconnect(LLTrans::getString("TestingDisconnect")); } -void force_error_breakpoint(void *) +void force_error_breakpoint() { LLAppViewer::instance()->forceErrorBreakpoint(); } -void force_error_llerror(void *) +void force_error_llerror() { LLAppViewer::instance()->forceErrorLLError(); } -void force_error_llerror_msg(void*) +void force_error_llerror_msg() { LLAppViewer::instance()->forceErrorLLErrorMsg(); } -void force_error_bad_memory_access(void *) +void force_error_bad_memory_access() { LLAppViewer::instance()->forceErrorBadMemoryAccess(); } -void force_error_infinite_loop(void *) +void force_error_infinite_loop() { LLAppViewer::instance()->forceErrorInfiniteLoop(); } -void force_error_software_exception(void *) +void force_error_software_exception() { LLAppViewer::instance()->forceErrorSoftwareException(); } -void force_error_os_exception(void*) +void force_error_os_exception() { LLAppViewer::instance()->forceErrorOSSpecificException(); } -void force_error_driver_crash(void *) +void force_error_driver_crash() { LLAppViewer::instance()->forceErrorDriverCrash(); } -void force_error_coroutine_crash(void *) +void force_error_coroutine_crash() { LLAppViewer::instance()->forceErrorCoroutineCrash(); } -void force_error_thread_crash(void *) +void force_error_thread_crash() { LLAppViewer::instance()->forceErrorThreadCrash(); } @@ -8857,7 +8681,7 @@ class LLToolsUseSelectionForGrid : public view_listener_t } }; -void handle_test_load_url(void*) +void handle_test_load_url() { LLWeb::loadURL(""); LLWeb::loadURL("hacker://www.google.com/"); @@ -8965,7 +8789,7 @@ void handle_report_bug(const LLSD& param) LLWeb::loadURLExternal(url); } -void handle_buy_currency_test(void*) +void handle_buy_currency_test() { std::string url = "http://sarahd-sl-13041.webdev.lindenlab.com/app/lindex/index.php?agent_id=[AGENT_ID]&secure_session_id=[SESSION_ID]&lang=[LANGUAGE]"; @@ -8982,7 +8806,7 @@ void handle_buy_currency_test(void*) } // SUNSHINE CLEANUP - is only the request update at the end needed now? -void handle_rebake_textures(void*) +void handle_rebake_textures() { if (!isAgentAvatarValid()) return; @@ -8995,15 +8819,13 @@ void handle_rebake_textures(void*) } } -void toggle_visibility(void* user_data) +void toggle_visibility(LLView* viewp) { - LLView* viewp = (LLView*)user_data; viewp->setVisible(!viewp->getVisible()); } -bool get_visibility(void* user_data) +bool get_visibility(LLView* viewp) { - LLView* viewp = (LLView*)user_data; return viewp->getVisible(); } @@ -10221,7 +10043,6 @@ void initialize_menus() enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); enable.add("EnableEdit", boost::bind(&enable_object_edit)); enable.add("EnableMuteParticle", boost::bind(&enable_mute_particle)); - enable.add("VisibleBuild", boost::bind(&enable_object_build)); commit.add("Pathfinding.Linksets.Select", boost::bind(&LLFloaterPathfindingLinksets::openLinksetsWithSelectedObjects)); enable.add("EnableSelectInPathfindingLinksets", boost::bind(&enable_object_select_in_pathfinding_linksets)); enable.add("VisibleSelectInPathfindingLinksets", boost::bind(&visible_object_select_in_pathfinding_linksets)); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index 8c5e0705d0..68c3dbc126 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -44,54 +44,21 @@ void init_menus(); void cleanup_menus(); void show_debug_menus(); // checks for if menus should be shown first. -void toggle_debug_menus(void*); -void show_context_menu( S32 x, S32 y, MASK mask ); -void show_build_mode_context_menu(S32 x, S32 y, MASK mask); +void toggle_debug_menus(); void show_navbar_context_menu(LLView* ctrl, S32 x, S32 y); void show_topinfobar_context_menu(LLView* ctrl, S32 x, S32 y); void handle_reset_view(); -void handle_cut(void*); -void handle_copy(void*); -void handle_paste(void*); -void handle_delete(void*); -void handle_redo(void*); -void handle_undo(void*); -void handle_select_all(void*); -void handle_deselect(void*); -void handle_delete_object(); -void handle_duplicate(void*); -void handle_duplicate_in_place(void*); -bool enable_not_have_card(void *userdata); void process_grant_godlike_powers(LLMessageSystem* msg, void**); -bool enable_cut(void*); -bool enable_copy(void*); -bool enable_paste(void*); -bool enable_select_all(void*); -bool enable_deselect(void*); -bool enable_undo(void*); -bool enable_redo(void*); - bool is_agent_mappable(const LLUUID& agent_id); -void confirm_replace_attachment(S32 option, void* user_data); -void handle_detach_from_avatar(const LLSD& user_data); -void attach_label(std::string& label, const LLSD&); -void detach_label(std::string& label, const LLSD&); -void handle_detach(void*); -bool enable_god_full(void* user_data); -bool enable_god_liaison(void* user_data); -bool enable_god_basic(void* user_data); +bool enable_god_full(); +bool enable_god_liaison(); +bool enable_god_basic(); void check_merchant_status(bool force = false); -void exchange_callingcard(const LLUUID& dest_id); - -void handle_gestures(void*); -void handle_sit_down(void*); -void handle_object_build(void*); void handle_object_touch(); bool enable_object_edit_gltf_material(); -bool enable_object_save_gltf_material(); bool enable_object_open(); void handle_object_open(); @@ -106,12 +73,11 @@ void handle_buy(); void handle_take(bool take_separate = false); void handle_take_copy(); void handle_look_at_selection(const LLSD& param); -void handle_zoom_to_object(LLUUID object_id); +void handle_zoom_to_object(const LLUUID& object_id); void handle_object_return(); void handle_object_delete(); void handle_object_edit(); void handle_object_edit_gltf_material(); -void handle_object_save_gltf_material(); void handle_attachment_edit(const LLUUID& inv_item_id); void handle_attachment_touch(const LLUUID& inv_item_id); @@ -144,13 +110,10 @@ bool enable_pay_object(); bool enable_buy_object(); bool handle_go_to(); -// Export to XML or Collada -void handle_export_selected( void * ); - // Convert strings to internal types -U32 render_type_from_string(std::string render_type); -U32 feature_from_string(std::string feature); -U64 info_display_from_string(std::string info_display); +U32 render_type_from_string(std::string_view render_type); +U32 feature_from_string(std::string_view feature); +U64 info_display_from_string(std::string_view info_display); class LLViewerMenuHolderGL : public LLMenuHolderGL { diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 83f8e96f9a..ce66dbc03f 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -990,7 +990,7 @@ class LLFileQuit : public view_listener_t }; -void handle_compress_image(void*) +void handle_compress_image() { LLFilePicker& picker = LLFilePicker::instance(); if (picker.getMultipleOpenFiles(LLFilePicker::FFLOAD_IMAGE)) @@ -1040,7 +1040,7 @@ size_t get_file_size(std::string &filename) return file_length; } -void handle_compress_file_test(void*) +void handle_compress_file_test() { LLFilePicker& picker = LLFilePicker::instance(); if (picker.getOpenFile()) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 71add76dd2..d59dfb88a8 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -2489,7 +2489,16 @@ void LLViewerRegion::setSimulatorFeatures(const LLSD& sim_features) if (features.has("GLTFEnabled")) { bool enabled = features["GLTFEnabled"]; - gSavedSettings.setBOOL("GLTFEnabled", enabled); + + // call setShaders the first time GLTFEnabled is received as true (causes GLTF specific shaders to be loaded) + if (enabled != gSavedSettings.getBOOL("GLTFEnabled")) + { + gSavedSettings.setBOOL("GLTFEnabled", enabled); + if (enabled) + { + LLViewerShaderMgr::instance()->setShaders(); + } + } } else { diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a446be8b58..58b541b19b 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -439,13 +439,20 @@ void LLViewerShaderMgr::finalizeShaderList() mShaderList.push_back(&gDeferredDiffuseProgram); mShaderList.push_back(&gDeferredBumpProgram); mShaderList.push_back(&gDeferredPBROpaqueProgram); - mShaderList.push_back(&gGLTFPBRMetallicRoughnessProgram); + + if (gSavedSettings.getBOOL("GLTFEnabled")) + { + mShaderList.push_back(&gGLTFPBRMetallicRoughnessProgram); + } + mShaderList.push_back(&gDeferredAvatarProgram); mShaderList.push_back(&gDeferredTerrainProgram); + for (U32 paint_type = 0; paint_type < TERRAIN_PAINT_TYPE_COUNT; ++paint_type) { mShaderList.push_back(&gDeferredPBRTerrainProgram[paint_type]); } + mShaderList.push_back(&gDeferredDiffuseAlphaMaskProgram); mShaderList.push_back(&gDeferredNonIndexedDiffuseAlphaMaskProgram); mShaderList.push_back(&gDeferredTreeProgram); @@ -1340,26 +1347,29 @@ bool LLViewerShaderMgr::loadShadersDeferred() llassert(success); } - if (success) + if (gSavedSettings.getBOOL("GLTFEnabled")) { - gGLTFPBRMetallicRoughnessProgram.mName = "GLTF PBR Metallic Roughness Shader"; - gGLTFPBRMetallicRoughnessProgram.mFeatures.hasSrgb = true; + if (success) + { + gGLTFPBRMetallicRoughnessProgram.mName = "GLTF PBR Metallic Roughness Shader"; + gGLTFPBRMetallicRoughnessProgram.mFeatures.hasSrgb = true; - gGLTFPBRMetallicRoughnessProgram.mShaderFiles.clear(); - gGLTFPBRMetallicRoughnessProgram.mShaderFiles.push_back(make_pair("gltf/pbrmetallicroughnessV.glsl", GL_VERTEX_SHADER)); - gGLTFPBRMetallicRoughnessProgram.mShaderFiles.push_back(make_pair("gltf/pbrmetallicroughnessF.glsl", GL_FRAGMENT_SHADER)); - gGLTFPBRMetallicRoughnessProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; - gGLTFPBRMetallicRoughnessProgram.clearPermutations(); + gGLTFPBRMetallicRoughnessProgram.mShaderFiles.clear(); + gGLTFPBRMetallicRoughnessProgram.mShaderFiles.push_back(make_pair("gltf/pbrmetallicroughnessV.glsl", GL_VERTEX_SHADER)); + gGLTFPBRMetallicRoughnessProgram.mShaderFiles.push_back(make_pair("gltf/pbrmetallicroughnessF.glsl", GL_FRAGMENT_SHADER)); + gGLTFPBRMetallicRoughnessProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; + gGLTFPBRMetallicRoughnessProgram.clearPermutations(); - success = make_gltf_variants(gGLTFPBRMetallicRoughnessProgram, use_sun_shadow); + success = make_gltf_variants(gGLTFPBRMetallicRoughnessProgram, use_sun_shadow); - //llassert(success); - if (!success) - { - LL_WARNS() << "Failed to create GLTF PBR Metallic Roughness Shader, disabling!" << LL_ENDL; - gSavedSettings.setBOOL("RenderCanUseGLTFPBROpaqueShaders", false); - // continue as if this shader never happened - success = true; + //llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create GLTF PBR Metallic Roughness Shader, disabling!" << LL_ENDL; + gSavedSettings.setBOOL("RenderCanUseGLTFPBROpaqueShaders", false); + // continue as if this shader never happened + success = true; + } } } @@ -3140,29 +3150,32 @@ bool LLViewerShaderMgr::loadShadersInterface() success = gCopyDepthProgram.createShader(); } - if (success) + if (gSavedSettings.getBOOL("LocalTerrainPaintEnabled")) { - LLGLSLShader* shader = &gPBRTerrainBakeProgram; - U32 bit_depth = gSavedSettings.getU32("TerrainPaintBitDepth"); - // LLTerrainPaintMap currently uses an RGB8 texture internally - bit_depth = llclamp(bit_depth, 1, 8); - shader->mName = llformat("Terrain Bake Shader RGB%o", bit_depth); - shader->mFeatures.isPBRTerrain = true; - - shader->mShaderFiles.clear(); - shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeV.glsl", GL_VERTEX_SHADER)); - shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeF.glsl", GL_FRAGMENT_SHADER)); - shader->mShaderLevel = mShaderLevel[SHADER_INTERFACE]; - const U32 value_range = (1 << bit_depth) - 1; - shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); - success = success && shader->createShader(); - //llassert(success); - if (!success) + if (success) { - LL_WARNS() << "Failed to create shader '" << shader->mName << "', disabling!" << LL_ENDL; - gSavedSettings.setBOOL("RenderCanUseTerrainBakeShaders", false); - // continue as if this shader never happened - success = true; + LLGLSLShader* shader = &gPBRTerrainBakeProgram; + U32 bit_depth = gSavedSettings.getU32("TerrainPaintBitDepth"); + // LLTerrainPaintMap currently uses an RGB8 texture internally + bit_depth = llclamp(bit_depth, 1, 8); + shader->mName = llformat("Terrain Bake Shader RGB%o", bit_depth); + shader->mFeatures.isPBRTerrain = true; + + shader->mShaderFiles.clear(); + shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeV.glsl", GL_VERTEX_SHADER)); + shader->mShaderFiles.push_back(make_pair("interface/pbrTerrainBakeF.glsl", GL_FRAGMENT_SHADER)); + shader->mShaderLevel = mShaderLevel[SHADER_INTERFACE]; + const U32 value_range = (1 << bit_depth) - 1; + shader->addPermutation("TERRAIN_PAINT_PRECISION", llformat("%d", value_range)); + success = success && shader->createShader(); + //llassert(success); + if (!success) + { + LL_WARNS() << "Failed to create shader '" << shader->mName << "', disabling!" << LL_ENDL; + gSavedSettings.setBOOL("RenderCanUseTerrainBakeShaders", false); + // continue as if this shader never happened + success = true; + } } } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 26cb2a573a..5329b354d3 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -1554,7 +1554,8 @@ void LLVOAvatar::calculateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) size.setSub(newMax,newMin); size.mul(0.5f); - mPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); + F32 pixel_area = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); + setCorrectedPixelArea(pixel_area); } void render_sphere_and_line(const LLVector3& begin_pos, const LLVector3& end_pos, F32 sphere_scale, const LLVector3& occ_color, const LLVector3& visible_color) @@ -4935,27 +4936,22 @@ void LLVOAvatar::updateVisibility() { visible = true; } - else - { - visible = false; - } - if(isSelf()) + if (isSelf()) { if (!gAgentWearables.areWearablesLoaded()) { visible = false; } } - else if( !mFirstAppearanceMessageReceived ) + else if (!mFirstAppearanceMessageReceived) { visible = false; } if (sDebugInvisible) { - LLNameValue* firstname = getNVPair("FirstName"); - if (firstname) + if (LLNameValue* firstname = getNVPair("FirstName")) { LL_DEBUGS("Avatar") << avString() << " updating visibility" << LL_ENDL; } @@ -5044,11 +5040,14 @@ void LLVOAvatar::updateVisibility() } } - if ( visible != mVisible ) + if (visible != mVisible) { LL_DEBUGS("AvatarRender") << "visible was " << mVisible << " now " << visible << LL_ENDL; } + mVisible = visible; + + mVisibilityPreference = visible ? getPixelArea() : 0; } // private @@ -7110,6 +7109,18 @@ void LLVOAvatar::updateVisualParams() dirtyMesh(); updateHeadOffset(); } + +void LLVOAvatar::setCorrectedPixelArea(F32 area) +{ + // We always want to look good to ourselves + if (isSelf()) + { + area = llmax(area, F32(getTexImageSize() / 16)); + } + + setPixelArea(area); +} + //----------------------------------------------------------------------------- // isActive() //----------------------------------------------------------------------------- @@ -7137,7 +7148,7 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent) size.mul(0.5f); mImpostorPixelArea = LLPipeline::calcPixelArea(center, size, *LLViewerCamera::getInstance()); - mPixelArea = mImpostorPixelArea; + setCorrectedPixelArea(mImpostorPixelArea); F32 range = mDrawable->mDistanceWRTCamera; @@ -7150,12 +7161,6 @@ void LLVOAvatar::setPixelAreaAndAngle(LLAgent &agent) F32 radius = size.getLength3().getF32(); mAppAngle = (F32) atan2( radius, range) * RAD_TO_DEG; } - - // We always want to look good to ourselves - if( isSelf() ) - { - mPixelArea = llmax( mPixelArea, F32(getTexImageSize() / 16) ); - } } //----------------------------------------------------------------------------- @@ -9787,7 +9792,7 @@ void LLVOAvatar::applyParsedAppearanceMessage(LLAppearanceMessageContents& conte setCompositeUpdatesEnabled( true ); // If all of the avatars are completely baked, release the global image caches to conserve memory. - LLVOAvatar::cullAvatarsByPixelArea(); + cullAvatarsByPixelArea(); if (isSelf()) { @@ -10419,12 +10424,10 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara void LLVOAvatar::setVisibilityRank(U32 rank) { - if (mDrawable.isNull() || mDrawable->isDead()) + if (mDrawable.notNull() && !mDrawable->isDead()) { - // do nothing - return; + mVisibilityRank = rank; } - mVisibilityRank = rank; } // Assumes LLVOAvatar::sInstances has already been sorted. @@ -10455,32 +10458,34 @@ void LLVOAvatar::cullAvatarsByPixelArea() { LLCharacter::sInstances.sort([](LLCharacter* lhs, LLCharacter* rhs) { - return lhs->getPixelArea() > rhs->getPixelArea(); + return ((LLVOAvatar*)lhs)->mVisibilityPreference > ((LLVOAvatar*)rhs)->mVisibilityPreference; }); // Update the avatars that have changed status + U32 rank = 2; // Rank 1 is reserved for self. + for (LLCharacter* character : LLCharacter::sInstances) { - U32 rank = 2; //1 is reserved for self. - for (LLCharacter* character : LLCharacter::sInstances) - { - LLVOAvatar* inst = (LLVOAvatar*)character; - bool culled = !inst->isSelf() && !inst->isFullyBaked(); + LLVOAvatar* inst = (LLVOAvatar*)character; + bool culled = !inst->isSelf() && !inst->isFullyBaked(); - if (inst->mCulled != culled) - { - inst->mCulled = culled; - LL_DEBUGS() << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << LL_ENDL; - inst->updateMeshTextures(); - } + if (inst->mCulled != culled) + { + inst->mCulled = culled; + LL_DEBUGS() << "avatar " << inst->getID() << (culled ? " start culled" : " start not culled" ) << LL_ENDL; + inst->updateMeshTextures(); + } - if (inst->isSelf()) - { - inst->setVisibilityRank(1); - } - else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible()) - { - inst->setVisibilityRank(rank++); - } + if (inst->isSelf()) + { + inst->setVisibilityRank(1); + } + else if (inst->mDrawable.notNull() && inst->mDrawable->isVisible()) + { + inst->setVisibilityRank(rank++); + } + else + { + inst->setVisibilityRank(sMaxNonImpostors * 5); } } diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index aa6aee0de5..2efb232704 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -127,17 +127,18 @@ public: /*virtual*/ void updateGL(); /*virtual*/ LLVOAvatar* asAvatar(); - virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, + virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, void **user_data, U32 block_num, const EObjectUpdateType update_type, LLDataPacker *dp); - virtual void idleUpdate(LLAgent &agent, const F64 &time); + virtual void idleUpdate(LLAgent &agent, const F64 &time); /*virtual*/ bool updateLOD(); - bool updateJointLODs(); - void updateLODRiggedAttachments( void ); + bool updateJointLODs(); + void updateLODRiggedAttachments(void); + void setCorrectedPixelArea(F32 area); /*virtual*/ bool isActive() const; // Whether this object needs to do an idleUpdate. - S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids); + S32Bytes totalTextureMemForUUIDS(std::set<LLUUID>& ids); bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const; bool allLocalTexturesCompletelyDownloaded() const; bool allBakedTexturesCompletelyDownloaded() const; @@ -620,6 +621,7 @@ public: protected: void updateVisibility(); private: + F32 mVisibilityPreference; U32 mVisibilityRank; bool mVisible; diff --git a/indra/newview/llvoicevisualizer.cpp b/indra/newview/llvoicevisualizer.cpp index 9412136272..7691ac54f3 100644 --- a/indra/newview/llvoicevisualizer.cpp +++ b/indra/newview/llvoicevisualizer.cpp @@ -337,7 +337,8 @@ void LLVoiceVisualizer::lipSyncOohAah( F32& ooh, F32& aah ) //--------------------------------------------------- void LLVoiceVisualizer::render() { - if ( ! mVoiceEnabled ) + static LLCachedControl<bool> show_visualizer(gSavedSettings, "VoiceVisualizerEnabled", false); + if (!mVoiceEnabled || !show_visualizer) { return; } diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 4528b57061..7de8cf9cb1 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2983,7 +2983,9 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b // we got a 'power' update. if (participant_obj.contains("p") && participant_obj["p"].is_number()) { - participant->mLevel = (F32)participant_obj["p"].as_int64(); + // server sends up power as an integer which is level * 128 to save + // character count. + participant->mLevel = (F32)participant_obj["p"].as_int64()/128.0f; } if (participant_obj.contains("v") && participant_obj["v"].is_bool()) diff --git a/indra/newview/llwearablelist.cpp b/indra/newview/llwearablelist.cpp index 76348d4ea1..2d59712142 100644 --- a/indra/newview/llwearablelist.cpp +++ b/indra/newview/llwearablelist.cpp @@ -36,6 +36,7 @@ #include "llnotificationsutil.h" #include "llinventorymodel.h" #include "lltrans.h" +#include "llappviewer.h" // Callback struct struct LLWearableArrivedData @@ -97,6 +98,22 @@ void LLWearableList::getAsset(const LLAssetID& assetID, const std::string& weara // static void LLWearableList::processGetAssetReply( const char* filename, const LLAssetID& uuid, void* userdata, S32 status, LLExtStat ext_status ) { + if (!LLCoros::on_main_coro()) + { + // if triggered from a coroutine, dispatch to main thread before accessing app state + std::string filename_in = filename; + LLUUID uuid_in = uuid; + + LLAppViewer::instance()->postToMainCoro([=]() + { + processGetAssetReply(filename_in.c_str(), uuid_in, userdata, status, ext_status); + }); + + return; + } + + LL_PROFILE_ZONE_SCOPED_CATEGORY_AVATAR; + bool isNewWearable = false; LLWearableArrivedData* data = (LLWearableArrivedData*) userdata; LLViewerWearable* wearable = NULL; // NULL indicates failure diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 7b8739c7df..f37257feb0 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -228,7 +228,6 @@ const F32 DEFERRED_LIGHT_FALLOFF = 0.5f; const U32 DEFERRED_VB_MASK = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TEXCOORD1; extern S32 gBoxFrame; -//extern bool gHideSelectedObjects; extern bool gDisplaySwapBuffers; extern bool gDebugGL; extern bool gCubeSnapshot; @@ -2110,9 +2109,9 @@ F32 LLPipeline::calcPixelArea(const LLVector4a& center, const LLVector4a& size, } //get area of circle around node - F32 app_angle = atanf(size.getLength3().getF32()/dist); - F32 radius = app_angle*LLDrawable::sCurPixelAngle; - return radius*radius * F_PI; + F32 app_angle = atanf(size.getLength3().getF32() / dist); + F32 radius = app_angle * LLDrawable::sCurPixelAngle; + return radius * radius * F_PI; } void LLPipeline::grabReferences(LLCullResult& result) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index eb38f8bff3..d909a56733 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -407,6 +407,44 @@ value="2"/> </combo_box> <text + layout="topleft" + height="15" + left="260" + top_pad="-18" + width="100" + name="noise_suppression_label"> + Noise Suppression + </text> + <combo_box + control_name="VoiceNoiseSuppressionLevel" + layout="topleft" + height="23" + left_pad="10" + top_pad="-20" + name="noise_suppression_combo" + width="80"> + <item + label="Off" + name="noise_suppression_none" + value="0"/> + <item + label="Low" + name="noise_suppression_low" + value="1"/> + <item + label="Moderate" + name="noise_suppression_moderate" + value="2"/> + <item + label="High" + name="noise_suppression_high" + value="3"/> + <item + label="Max" + name="noise_suppression_max" + value="4"/> + </combo_box> + <text type="string" length="1" follows="left|top" @@ -497,44 +535,16 @@ label="Play sounds from gestures" top_pad="5" left="20"/> - <text - layout="topleft" + <check_box + control_name="VoiceVisualizerEnabled" height="15" + tool_tip="Check to show voice dot indicator above avatars" + label="Show voice dot above avatars" + layout="topleft" + name="voice_dot_visualizer" left="260" - top_pad="-12" - width="100" - name="noise_suppression_label"> - Noise Suppression - </text> - <combo_box - control_name="VoiceNoiseSuppressionLevel" - layout="topleft" - height="23" - left_pad="10" - top_pad="-18" - name="noise_suppression_combo" - width="80"> - <item - label="Off" - name="noise_suppression_none" - value="0"/> - <item - label="Low" - name="noise_suppression_low" - value="1"/> - <item - label="Moderate" - name="noise_suppression_moderate" - value="2"/> - <item - label="High" - name="noise_suppression_high" - value="3"/> - <item - label="Max" - name="noise_suppression_max" - value="4"/> - </combo_box> + top_pad="-15" + width="200"/> <button control_name="ShowDeviceSettings" follows="left|top" |