diff options
| -rw-r--r-- | indra/newview/llgltfmateriallist.cpp | 171 | ||||
| -rw-r--r-- | indra/newview/llgltfmateriallist.h | 4 | ||||
| -rw-r--r-- | indra/newview/llstartup.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llviewerobject.cpp | 5 | ||||
| -rwxr-xr-x | indra/newview/llviewerregion.cpp | 11 | ||||
| -rw-r--r-- | indra/newview/llviewerregion.h | 2 | 
6 files changed, 2 insertions, 194 deletions
| diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 8919229c78..92c58a2dbc 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -139,69 +139,18 @@ static bool is_valid_update(const LLSD& data)  }  #endif -class LLGLTFMaterialOverrideDispatchHandler : public LLDispatchHandler +class LLGLTFMaterialOverrideDispatchHandler  {      LOG_CLASS(LLGLTFMaterialOverrideDispatchHandler);  public:      LLGLTFMaterialOverrideDispatchHandler() = default; -    ~LLGLTFMaterialOverrideDispatchHandler() override = default; +    ~LLGLTFMaterialOverrideDispatchHandler() = default;      void addCallback(void(*callback)(const LLUUID& object_id, S32 side))      {          mSelectionCallbacks.push_back(callback);      } -    bool operator()(const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, const sparam_t& strings) override -    { -        LL_PROFILE_ZONE_SCOPED; -        // receive override data from simulator via LargeGenericMessage -        // message should have: -        //  object_id - UUID of LLViewerObject -        //  sides - array of S32 indices of texture entries -        //  gltf_json - array of corresponding Strings of GLTF json for override data - -        LLSD message; -        bool success = true; -#if 0 //deprecated -        for(const std::string& llsdRaw : strings) -        { -            std::istringstream llsdData(llsdRaw); -            if (!LLSDSerialize::deserialize(message, llsdData, llsdRaw.length())) -            { -                LL_WARNS() << "LLGLTFMaterialOverrideDispatchHandler: Attempted to read parameter data into LLSD but failed:" << llsdRaw << LL_ENDL; -                success = false; -                continue; -            } - -            LLGLTFOverrideCacheEntry object_override; -            if (!object_override.fromLLSD(message)) -            { -                // malformed message, nothing we can do to handle it -                LL_DEBUGS("GLTF") << "Message without id:" << message << LL_ENDL; -                success = false; -                continue; -            } - -            // Cache the data -            { -                LLViewerRegion * region = LLWorld::instance().getRegionFromHandle(object_override.mRegionHandle); - -                if (region) -                { -                    region->cacheFullUpdateGLTFOverride(object_override); -                } -                else -                { -                    LL_WARNS("GLTF") << "could not access region for material overrides message cache, region_handle: " << LL_ENDL; -                } -            } -            applyData(object_override); -        } - -#endif -        return success; -    } -      void doSelectionCallbacks(const LLUUID& object_id, S32 side)      {          for (auto& callback : mSelectionCallbacks) @@ -210,112 +159,6 @@ public:          }      } -    void applyData(const LLGLTFOverrideCacheEntry &object_override) -    { -        // Parse the data - -#if 0 // DEPRECATED -        LL::WorkQueue::ptr_t main_queue = LL::WorkQueue::getInstance("mainloop"); -        LL::WorkQueue::ptr_t general_queue = LL::WorkQueue::getInstance("General"); - -        struct ReturnData -        { -        public: -            LLGLTFMaterial mMaterial; -            S32 mSide; -            bool mSuccess; -        }; - -        if (!object_override.mSides.empty()) -        { -            // fromJson() is performance heavy offload to a thread. -            main_queue->postTo( -                general_queue, -                [sides=object_override.mSides]() // Work done on general queue -            { -                std::vector<ReturnData> results; - -                results.reserve(sides.size()); -                // parse json -                std::unordered_map<S32, LLSD>::const_iterator iter = sides.begin(); -                std::unordered_map<S32, LLSD>::const_iterator end = sides.end(); -                while (iter != end) -                { -                    ReturnData result; - -                    result.mMaterial.applyOverrideLLSD(iter->second); -                     -                    result.mSuccess = true; -                    result.mSide = iter->first; - -                    results.push_back(result); -                    iter++; -                } -                return results; -            }, -            [object_id=object_override.mObjectId, this](std::vector<ReturnData> results) // Callback to main thread -            { -                LLViewerObject * obj = gObjectList.findObject(object_id); - -                if (results.size() > 0 ) -                { -                    std::unordered_set<S32> side_set; - -                    for (auto const & result : results) -                    { -                        S32 side = result.mSide; -                        if (result.mSuccess) -                        { -                            // copy to heap here because LLTextureEntry is going to take ownership with an LLPointer -                            LLGLTFMaterial * material = new LLGLTFMaterial(result.mMaterial); - -                            // flag this side to not be nulled out later -                            side_set.insert(side); - -                            if (obj) -                            { -                                obj->setTEGLTFMaterialOverride(side, material); -                            } -                        } - -                        // unblock material editor -                        if (obj && obj->getTE(side) && obj->getTE(side)->isSelected()) -                        { -                            doSelectionCallbacks(object_id, side); -                        } -                    } - -                    if (obj && side_set.size() != obj->getNumTEs()) -                    { // object exists and at least one texture entry needs to have its override data nulled out -                        for (int i = 0; i < obj->getNumTEs(); ++i) -                        { -                            if (side_set.find(i) == side_set.end()) -                            { -                                obj->setTEGLTFMaterialOverride(i, nullptr); -                                if (obj->getTE(i) && obj->getTE(i)->isSelected()) -                                { -                                    doSelectionCallbacks(object_id, i); -                                } -                            } -                        } -                    } -                } -                else if (obj) -                { // override list was empty or an error occurred, null out all overrides for this object -                    for (int i = 0; i < obj->getNumTEs(); ++i) -                    { -                        obj->setTEGLTFMaterialOverride(i, nullptr); -                        if (obj->getTE(i) && obj->getTE(i)->isSelected()) -                        { -                            doSelectionCallbacks(obj->getID(), i); -                        } -                    } -                } -            }); -        } -#endif -    } -  private:      std::vector<void(*)(const LLUUID& object_id, S32 side)> mSelectionCallbacks; @@ -822,12 +665,6 @@ void LLGLTFMaterialList::flushMaterials()  }  // static -void LLGLTFMaterialList::registerCallbacks() -{ -    gGenericDispatcher.addHandler("GLTFMaterialOverride", &handle_gltf_override_message); -} - -// static  void LLGLTFMaterialList::modifyMaterialCoro(std::string cap_url, LLSD overrides, void(*done_callback)(bool) )  {      LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); @@ -864,7 +701,3 @@ void LLGLTFMaterialList::modifyMaterialCoro(std::string cap_url, LLSD overrides,      }  } -void LLGLTFMaterialList::loadCacheOverrides(const LLGLTFOverrideCacheEntry& override) -{ -    handle_gltf_override_message.applyData(override); -} diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h index 7317214019..f1c4ce20f9 100644 --- a/indra/newview/llgltfmateriallist.h +++ b/indra/newview/llgltfmateriallist.h @@ -52,8 +52,6 @@ public:      void flushMaterials(); -    static void registerCallbacks(); -      // Queue an modification of a material that we want to send to the simulator.  Call "flushUpdates" to flush pending updates.      //  id - ID of object to modify      //  side - TexureEntry index to modify, or -1 for all sides @@ -99,8 +97,6 @@ public:      // any override data that arrived before the object was ready to receive it      void applyQueuedOverrides(LLViewerObject* obj); -    static void loadCacheOverrides(const LLGLTFOverrideCacheEntry& override); -      // Apply an override update with the given data      void applyOverrideMessage(LLMessageSystem* msg, const std::string& data); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d0b76848f7..8681bf6e2a 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1511,9 +1511,6 @@ bool idle_startup()  		gXferManager->registerCallbacks(gMessageSystem);  		display_startup(); -		LLGLTFMaterialList::registerCallbacks(); -		display_startup(); -  		LLStartUp::initNameCache();  		display_startup(); diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index d4346ee2d9..a741f57753 100644 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -5041,11 +5041,6 @@ void LLViewerObject::updateTEMaterialTextures(U8 te)                      LLViewerObject* obj = gObjectList.findObject(id);                      if (obj)                      { -                        LLViewerRegion* region = obj->getRegion(); -                        if(region) -                        { -                            region->loadCacheMiscExtras(obj->getLocalID()); -                        }                          obj->markForUpdate();                      }                  }); diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 452dcdd8fd..60862ae5bd 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1879,8 +1879,6 @@ LLViewerObject* LLViewerRegion::addNewObject(LLVOCacheEntry* entry)  		addActiveCacheEntry(entry);  	} -    loadCacheMiscExtras(entry->getLocalID()); -  	return obj;  } @@ -3655,15 +3653,6 @@ std::string LLViewerRegion::getSimHostName()  	return std::string("...");  } -void LLViewerRegion::loadCacheMiscExtras(U32 local_id) -{ -    auto iter = mImpl->mGLTFOverridesLLSD.find(local_id); -    if (iter != mImpl->mGLTFOverridesLLSD.end()) -    { -        LLGLTFMaterialList::loadCacheOverrides(iter->second); -    } -} -  void LLViewerRegion::applyCacheMiscExtras(LLViewerObject* obj)  {      LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY; diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a409d837a4..622490c881 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -435,8 +435,6 @@ private:  	bool isNonCacheableObjectCreated(U32 local_id);	  public: -	void loadCacheMiscExtras(U32 local_id); -      void applyCacheMiscExtras(LLViewerObject* obj);  	struct CompareDistance | 
