From 1e26dbdcd27a1f29fe249cc7e074e5ede284bac8 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 3 Dec 2012 01:46:26 +0100 Subject: Started LLMaterialMgr to handle viewer<->region materials communication * refactored LLFloaterDebugMaterials::requestPutMaterials() to use LLMaterialMgr instead * replaced "Object editing" results list with information about the active selection instead --- indra/newview/llmaterialmgr.h | 53 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 indra/newview/llmaterialmgr.h (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h new file mode 100644 index 0000000000..c4e1c01389 --- /dev/null +++ b/indra/newview/llmaterialmgr.h @@ -0,0 +1,53 @@ +/** + * @file llmaterialmgr.h + * @brief Material manager + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLMATERIALMGR_H +#define LL_LLMATERIALMGR_H + +#include "llmaterial.h" +#include "llsingleton.h" + +class LLMaterialMgr : public LLSingleton +{ + friend LLSingleton; +protected: + LLMaterialMgr(); + virtual ~LLMaterialMgr(); + +public: + void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); + void processPutQueue(); + +protected: + void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); + +protected: + typedef std::map facematerial_map_t; + typedef std::map put_queue_t; + put_queue_t mPutQueue; +}; + +#endif // LL_LLMATERIALMGR_H -- cgit v1.2.3 From 25bffc3d43ec7696c0a9fab43514affbfe006fb9 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 3 Dec 2012 15:20:11 +0100 Subject: Added LLMaterialMgr::get() to retrieve individual materials (with optional callback) --- indra/newview/llmaterialmgr.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index c4e1c01389..d801d40c36 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -28,6 +28,7 @@ #define LL_LLMATERIALMGR_H #include "llmaterial.h" +#include "llmaterialid.h" #include "llsingleton.h" class LLMaterialMgr : public LLSingleton @@ -38,16 +39,33 @@ protected: virtual ~LLMaterialMgr(); public: + typedef boost::signals2::signal get_callback_t; + const LLMaterialPtr get(const LLMaterialID& material_id); + boost::signals2::connection get(const LLMaterialID& material_id, get_callback_t::slot_type cb); void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); + void processGetQueue(); void processPutQueue(); protected: + bool isGetPending(const LLMaterialID& material_id); + + void onGetResponse(bool success, const LLSD& content); void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); protected: + typedef std::set get_queue_t; + get_queue_t mGetQueue; + typedef std::map get_pending_map_t; + get_pending_map_t mGetPending; + typedef std::map get_callback_map_t; + get_callback_map_t mGetCallbacks; + typedef std::map facematerial_map_t; typedef std::map put_queue_t; put_queue_t mPutQueue; + + typedef std::map material_map_t; + material_map_t mMaterials; }; #endif // LL_LLMATERIALMGR_H -- cgit v1.2.3 From 1e194eb412bb10c1733ed76e270e45578ac15e0b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 3 Dec 2012 15:46:49 +0100 Subject: Handle delayed requesting and sending of materials through an idle callback --- indra/newview/llmaterialmgr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index d801d40c36..49d1029522 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -43,13 +43,14 @@ public: const LLMaterialPtr get(const LLMaterialID& material_id); boost::signals2::connection get(const LLMaterialID& material_id, get_callback_t::slot_type cb); void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); - void processGetQueue(); - void processPutQueue(); protected: bool isGetPending(const LLMaterialID& material_id); + static void onIdle(void*); + void processGetQueue(); void onGetResponse(bool success, const LLSD& content); + void processPutQueue(); void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); protected: -- cgit v1.2.3 From 4c68faec400e4c6d75a53528d8064a3448707158 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 5 Dec 2012 19:34:27 +0100 Subject: Added LLMaterialMgr::getAll() to retrieve all materials for the specified region --- indra/newview/llmaterialmgr.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 49d1029522..9e5efd7041 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -39,17 +39,26 @@ protected: virtual ~LLMaterialMgr(); public: + typedef std::map material_map_t; + typedef boost::signals2::signal get_callback_t; const LLMaterialPtr get(const LLMaterialID& material_id); boost::signals2::connection get(const LLMaterialID& material_id, get_callback_t::slot_type cb); + typedef boost::signals2::signal getall_callback_t; + void getAll(const LLUUID& region_id); + boost::signals2::connection getAll(const LLUUID& region_id, getall_callback_t::slot_type cb); void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); protected: bool isGetPending(const LLMaterialID& material_id); + bool isGetAllPending(const LLUUID& region_id); + const LLMaterialPtr setMaterial(const LLMaterialID& material_id, const LLSD& material_data); static void onIdle(void*); void processGetQueue(); void onGetResponse(bool success, const LLSD& content); + void processGetAllQueue(); + void onGetAllResponse(bool success, const LLSD& content, const LLUUID& region_id); void processPutQueue(); void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); @@ -61,11 +70,17 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; + typedef std::set getall_queue_t; + getall_queue_t mGetAllQueue; + typedef std::map getall_pending_map_t; + getall_pending_map_t mGetAllPending; + typedef std::map getall_callback_map_t; + getall_callback_map_t mGetAllCallbacks; + typedef std::map facematerial_map_t; typedef std::map put_queue_t; put_queue_t mPutQueue; - typedef std::map material_map_t; material_map_t mMaterials; }; -- cgit v1.2.3 From 3cd04749128f3daa185bca477552a566bc287a8e Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 12 Dec 2012 20:39:47 +0100 Subject: Refactor material retrieval to always invoke the region's GET material cap first --- indra/newview/llmaterialmgr.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 9e5efd7041..b8722ce90e 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -42,38 +42,41 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; - const LLMaterialPtr get(const LLMaterialID& material_id); - boost::signals2::connection get(const LLMaterialID& material_id, get_callback_t::slot_type cb); + const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); + boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); boost::signals2::connection getAll(const LLUUID& region_id, getall_callback_t::slot_type cb); void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); protected: - bool isGetPending(const LLMaterialID& material_id); + bool isGetPending(const LLUUID& region_id, const LLMaterialID& material_id); bool isGetAllPending(const LLUUID& region_id); - const LLMaterialPtr setMaterial(const LLMaterialID& material_id, const LLSD& material_data); + const LLMaterialPtr setMaterial(const LLUUID& region_id, const LLMaterialID& material_id, const LLSD& material_data); static void onIdle(void*); void processGetQueue(); - void onGetResponse(bool success, const LLSD& content); + void onGetResponse(bool success, const LLSD& content, const LLUUID& region_id); void processGetAllQueue(); void onGetAllResponse(bool success, const LLSD& content, const LLUUID& region_id); void processPutQueue(); void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); protected: - typedef std::set get_queue_t; - get_queue_t mGetQueue; - typedef std::map get_pending_map_t; - get_pending_map_t mGetPending; + typedef std::set material_queue_t; + typedef std::map get_queue_t; + get_queue_t mGetQueue; + typedef std::pair pending_material_t; + typedef std::map get_pending_map_t; + get_pending_map_t mGetPending; typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; typedef std::set getall_queue_t; - getall_queue_t mGetAllQueue; + getall_queue_t mGetAllQueue; + getall_queue_t mGetAllRequested; typedef std::map getall_pending_map_t; - getall_pending_map_t mGetAllPending; + getall_pending_map_t mGetAllPending; typedef std::map getall_callback_map_t; getall_callback_map_t mGetAllCallbacks; -- cgit v1.2.3 From ef301c59832025240a20f9959008a33dc52233f9 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 12 Dec 2012 21:36:36 +0100 Subject: Don't call setTEMaterialID() while processing a PUT response; the region will send its own ObjectUpdate message --- indra/newview/llmaterialmgr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index b8722ce90e..1066f3ef37 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -60,7 +60,7 @@ protected: void processGetAllQueue(); void onGetAllResponse(bool success, const LLSD& content, const LLUUID& region_id); void processPutQueue(); - void onPutResponse(bool success, const LLSD& content, const LLUUID& object_id); + void onPutResponse(bool success, const LLSD& content); protected: typedef std::set material_queue_t; -- cgit v1.2.3 From a18ea9d92923e331c0a3e179e126659e694b1c07 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Wed, 12 Dec 2012 21:47:24 +0100 Subject: Clean up pending requests when regions are removed from LLWorld --- indra/newview/llmaterialmgr.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 1066f3ef37..5a0064ae27 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -31,6 +31,8 @@ #include "llmaterialid.h" #include "llsingleton.h" +class LLViewerRegion; + class LLMaterialMgr : public LLSingleton { friend LLSingleton; @@ -61,6 +63,7 @@ protected: void onGetAllResponse(bool success, const LLSD& content, const LLUUID& region_id); void processPutQueue(); void onPutResponse(bool success, const LLSD& content); + void onRegionRemoved(LLViewerRegion* regionp); protected: typedef std::set material_queue_t; -- cgit v1.2.3 From d4910e15a68368d3cebbda1485da4fb68b45ed62 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 3 Jan 2013 14:14:43 -0500 Subject: changes needed to compile with Linden-standard toolchain --- indra/newview/llmaterialmgr.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 5a0064ae27..0b7217445a 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -35,7 +35,7 @@ class LLViewerRegion; class LLMaterialMgr : public LLSingleton { - friend LLSingleton; + friend class LLSingleton; protected: LLMaterialMgr(); virtual ~LLMaterialMgr(); @@ -69,8 +69,8 @@ protected: typedef std::set material_queue_t; typedef std::map get_queue_t; get_queue_t mGetQueue; - typedef std::pair pending_material_t; - typedef std::map get_pending_map_t; + typedef std::pair pending_material_t; + typedef std::map get_pending_map_t; get_pending_map_t mGetPending; typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; -- cgit v1.2.3 From b4a87776d4207c4268b5c0d546790eeb45db1e75 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 18 Feb 2013 19:37:19 +0100 Subject: Prevent a failed GET from causing an infinite material request loop when there are still pending POST requests for the same region --- indra/newview/llmaterialmgr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 0b7217445a..1672d11d38 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -52,6 +52,7 @@ public: void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); protected: + void clearGetQueues(const LLUUID& region_id); bool isGetPending(const LLUUID& region_id, const LLMaterialID& material_id); bool isGetAllPending(const LLUUID& region_id); const LLMaterialPtr setMaterial(const LLUUID& region_id, const LLMaterialID& material_id, const LLSD& material_data); -- cgit v1.2.3 From fbf8e51c6059791b12f60602b4dda0d72dc2d847 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Mon, 25 Feb 2013 00:16:14 +0100 Subject: Added LLMaterialMgr::remove() to remove material information from a face --- indra/newview/llmaterialmgr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 1672d11d38..6f444309d3 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -50,6 +50,7 @@ public: void getAll(const LLUUID& region_id); boost::signals2::connection getAll(const LLUUID& region_id, getall_callback_t::slot_type cb); void put(const LLUUID& object_id, const U8 te, const LLMaterial& material); + void remove(const LLUUID& object_id, const U8 te); protected: void clearGetQueues(const LLUUID& region_id); -- cgit v1.2.3 From 5ba7be081273d4eb4dac3f66e82b33b44f62580a Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Thu, 28 Feb 2013 23:19:41 +0100 Subject: Mark a material as 'pending' from the very first call to LLMaterialMgr::get() --- indra/newview/llmaterialmgr.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 6f444309d3..39be5cab29 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -54,8 +54,9 @@ public: protected: void clearGetQueues(const LLUUID& region_id); - bool isGetPending(const LLUUID& region_id, const LLMaterialID& material_id); - bool isGetAllPending(const LLUUID& region_id); + bool isGetPending(const LLUUID& region_id, const LLMaterialID& material_id) const; + bool isGetAllPending(const LLUUID& region_id) const; + void markGetPending(const LLUUID& region_id, const LLMaterialID& material_id); const LLMaterialPtr setMaterial(const LLUUID& region_id, const LLMaterialID& material_id, const LLSD& material_data); static void onIdle(void*); -- cgit v1.2.3 From f356d7eb9fd730f5f6f5a29fb0706e20876ad3bd Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Sat, 11 May 2013 19:58:56 -0700 Subject: Fix many issues with selection misapplication and rendering not matching applied materials --- indra/newview/llmaterialmgr.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 39be5cab29..922b16f1cf 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,8 +44,12 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; + typedef boost::signals2::signal get_callback_te_t; + const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); + boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); + typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); boost::signals2::connection getAll(const LLUUID& region_id, getall_callback_t::slot_type cb); @@ -78,6 +82,26 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; + // struct for TE-specific material ID query + struct TEMaterialPair + { + U32 te; + LLMaterialID materialID; + }; + + // needed for std::map compliance only + // + friend inline bool operator<( + const struct LLMaterialMgr::TEMaterialPair& lhs, + const struct LLMaterialMgr::TEMaterialPair& rhs) + { + return (lhs.materialID < rhs.materialID) ? TRUE : + (lhs.te < rhs.te) ? TRUE : FALSE; + } + + typedef std::map get_callback_te_map_t; + get_callback_te_map_t mGetTECallbacks; + typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; getall_queue_t mGetAllRequested; -- cgit v1.2.3 From c2c9380fe135fd8b191ebe3c9a38129af4994ed8 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 12 May 2013 13:02:54 +0200 Subject: Avoid code duplication in LLMaterialMgr --- indra/newview/llmaterialmgr.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 922b16f1cf..a6a7a5d1d7 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,11 +44,9 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; - typedef boost::signals2::signal get_callback_te_t; const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); - boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -82,26 +80,6 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; - // struct for TE-specific material ID query - struct TEMaterialPair - { - U32 te; - LLMaterialID materialID; - }; - - // needed for std::map compliance only - // - friend inline bool operator<( - const struct LLMaterialMgr::TEMaterialPair& lhs, - const struct LLMaterialMgr::TEMaterialPair& rhs) - { - return (lhs.materialID < rhs.materialID) ? TRUE : - (lhs.te < rhs.te) ? TRUE : FALSE; - } - - typedef std::map get_callback_te_map_t; - get_callback_te_map_t mGetTECallbacks; - typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; getall_queue_t mGetAllRequested; -- cgit v1.2.3 From d9e8ee7cfd323872145c23e4032989f9b7770f55 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Mon, 13 May 2013 13:02:53 -0700 Subject: NORSPEC-178 NORSPEC-179 NORSPEC-180 made enable/disable handling more consistent and increased max range on repeats per meter --- indra/newview/llmaterialmgr.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index a6a7a5d1d7..922b16f1cf 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,9 +44,11 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; + typedef boost::signals2::signal get_callback_te_t; const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); + boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -80,6 +82,26 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; + // struct for TE-specific material ID query + struct TEMaterialPair + { + U32 te; + LLMaterialID materialID; + }; + + // needed for std::map compliance only + // + friend inline bool operator<( + const struct LLMaterialMgr::TEMaterialPair& lhs, + const struct LLMaterialMgr::TEMaterialPair& rhs) + { + return (lhs.materialID < rhs.materialID) ? TRUE : + (lhs.te < rhs.te) ? TRUE : FALSE; + } + + typedef std::map get_callback_te_map_t; + get_callback_te_map_t mGetTECallbacks; + typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; getall_queue_t mGetAllRequested; -- cgit v1.2.3 From ad09e2111cd980117ae937b79155ef6c24e4567c Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Tue, 14 May 2013 21:14:46 +0200 Subject: NORSPEC-102 & Co Reloaded --- indra/newview/llmaterialmgr.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 922b16f1cf..a6a7a5d1d7 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,11 +44,9 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; - typedef boost::signals2::signal get_callback_te_t; const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); - boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -82,26 +80,6 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; - // struct for TE-specific material ID query - struct TEMaterialPair - { - U32 te; - LLMaterialID materialID; - }; - - // needed for std::map compliance only - // - friend inline bool operator<( - const struct LLMaterialMgr::TEMaterialPair& lhs, - const struct LLMaterialMgr::TEMaterialPair& rhs) - { - return (lhs.materialID < rhs.materialID) ? TRUE : - (lhs.te < rhs.te) ? TRUE : FALSE; - } - - typedef std::map get_callback_te_map_t; - get_callback_te_map_t mGetTECallbacks; - typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; getall_queue_t mGetAllRequested; -- cgit v1.2.3 From 666896ac4efa0575c82cd58c9fe041f354ccbbfc Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Wed, 15 May 2013 17:00:13 -0700 Subject: NORSPEC-119 put back TE-specific get registration in material manager stomped during 'reloading'. --- indra/newview/llmaterialmgr.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index a6a7a5d1d7..b5ba8ab680 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,9 +44,11 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; + typedef boost::signals2::signal get_callback_te_t; const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); + boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -80,6 +82,26 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; + // struct for TE-specific material ID query + struct TEMaterialPair + { + U32 te; + LLMaterialID materialID; + }; + + // needed for std::map compliance only + // + friend inline bool operator<( + const struct LLMaterialMgr::TEMaterialPair& lhs, + const struct LLMaterialMgr::TEMaterialPair& rhs) + { + return (lhs.materialID < rhs.materialID) ? TRUE : + (lhs.te < rhs.te) ? TRUE : FALSE; + } + + typedef std::map get_callback_te_map_t; + get_callback_te_map_t mGetTECallbacks; + typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; getall_queue_t mGetAllRequested; -- cgit v1.2.3 From 74c1bc29e7dc566c7bb1a654b1dbf632d39dcb17 Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham)" Date: Fri, 17 May 2013 14:02:31 -0700 Subject: NORSPEC-189 restore old mat param update registration --- indra/newview/llmaterialmgr.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index b5ba8ab680..9b3d7a0246 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -44,11 +44,13 @@ public: typedef std::map material_map_t; typedef boost::signals2::signal get_callback_t; - typedef boost::signals2::signal get_callback_te_t; - const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); + +#if USE_TE_SPECIFIC_REGISTRATION + typedef boost::signals2::signal get_callback_te_t; boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); +#endif typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -82,6 +84,7 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; +#if USE_TE_SPECIFIC_REGISTRATION // struct for TE-specific material ID query struct TEMaterialPair { @@ -101,6 +104,7 @@ protected: typedef std::map get_callback_te_map_t; get_callback_te_map_t mGetTECallbacks; +#endif typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; @@ -118,3 +122,4 @@ protected: }; #endif // LL_LLMATERIALMGR_H + -- cgit v1.2.3 From 33f674a0d080c5e74ae2f50029b601b4dcecd4d9 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Thu, 23 May 2013 11:40:45 -0700 Subject: NORSPEC-208 re-enable TE-specific material mgr registration to avoid cross-talk when editing faces --- indra/newview/llmaterialmgr.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 9b3d7a0246..0c030623ba 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -31,6 +31,8 @@ #include "llmaterialid.h" #include "llsingleton.h" +#define USE_TE_SPECIFIC_REGISTRATION 1 + class LLViewerRegion; class LLMaterialMgr : public LLSingleton -- cgit v1.2.3 From 0004f418f4716c1d0fc1277b1ea2a7c7ed6689dd Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 24 May 2013 04:46:18 -0700 Subject: NORSPEC-210 fix issues with the map used to store TE-specific registrations which was only invoking the CB for the last TE on log-in by replacing std::map with boost::unordered_map --- indra/newview/llmaterialmgr.h | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 0c030623ba..8a2a9be255 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -88,23 +88,32 @@ protected: #if USE_TE_SPECIFIC_REGISTRATION // struct for TE-specific material ID query - struct TEMaterialPair + class TEMaterialPair { + public: + U32 te; LLMaterialID materialID; - }; - // needed for std::map compliance only - // + bool operator==(const TEMaterialPair& b) const { return (materialID == b.materialID) && (te == b.te); } + }; + friend inline bool operator<( - const struct LLMaterialMgr::TEMaterialPair& lhs, - const struct LLMaterialMgr::TEMaterialPair& rhs) + const LLMaterialMgr::TEMaterialPair& lhs, + const LLMaterialMgr::TEMaterialPair& rhs) { - return (lhs.materialID < rhs.materialID) ? TRUE : - (lhs.te < rhs.te) ? TRUE : FALSE; + return (lhs.te < rhs.te) ? TRUE : + (lhs.materialID < rhs.materialID); } - typedef std::map get_callback_te_map_t; + struct TEMaterialPairHasher + { + enum { bucket_size = 8 }; + size_t operator()(const TEMaterialPair& key_value) const { return *((size_t*)key_value.materialID.get()); } // cheesy, but effective + bool operator()(const TEMaterialPair& left, const TEMaterialPair& right) const { return left < right; } + }; + + typedef boost::unordered_map get_callback_te_map_t; get_callback_te_map_t mGetTECallbacks; #endif -- cgit v1.2.3 From 66e53759679910e2c3720cda92ba6e917c66d12c Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 24 May 2013 15:07:23 -0700 Subject: NORSPEC-96 NORSPEC-189 another attempt at planar stretch across all 3 channels and make the materials CB use a UUID instead of this pointer for safety --- indra/newview/llmaterialmgr.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'indra/newview/llmaterialmgr.h') diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h index 8a2a9be255..e317a791ad 100644 --- a/indra/newview/llmaterialmgr.h +++ b/indra/newview/llmaterialmgr.h @@ -31,8 +31,6 @@ #include "llmaterialid.h" #include "llsingleton.h" -#define USE_TE_SPECIFIC_REGISTRATION 1 - class LLViewerRegion; class LLMaterialMgr : public LLSingleton @@ -49,10 +47,8 @@ public: const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id); boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb); -#if USE_TE_SPECIFIC_REGISTRATION typedef boost::signals2::signal get_callback_te_t; boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb); -#endif typedef boost::signals2::signal getall_callback_t; void getAll(const LLUUID& region_id); @@ -86,7 +82,6 @@ protected: typedef std::map get_callback_map_t; get_callback_map_t mGetCallbacks; -#if USE_TE_SPECIFIC_REGISTRATION // struct for TE-specific material ID query class TEMaterialPair { @@ -115,7 +110,6 @@ protected: typedef boost::unordered_map get_callback_te_map_t; get_callback_te_map_t mGetTECallbacks; -#endif typedef std::set getall_queue_t; getall_queue_t mGetAllQueue; -- cgit v1.2.3