diff options
author | Dave Parks <davep@lindenlab.com> | 2022-11-08 12:20:59 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-08 12:20:59 -0600 |
commit | 40d01ba39388c5400e2582145e77295c51f33fc3 (patch) | |
tree | aadf2694c8f67926ef14e710fdc23d9595644b85 /indra/newview/llgltfmateriallist.h | |
parent | a0c7a7ecdc7b9fb53fa1175babf0d8497a3e9112 (diff) |
SL-18585 Batch updates to ModifyMaterialParams capability.
Diffstat (limited to 'indra/newview/llgltfmateriallist.h')
-rw-r--r-- | indra/newview/llgltfmateriallist.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h index bfdd9e5e32..e035d2108d 100644 --- a/indra/newview/llgltfmateriallist.h +++ b/indra/newview/llgltfmateriallist.h @@ -51,6 +51,12 @@ public: static void registerCallbacks(); + // save an override update that we want to send to the simulator for later + static void queueModifyMaterial(const LLUUID& id, S32 side, const LLGLTFMaterial& mat); + + // flush pending material updates to the simulator + static void flushModifyMaterialQueue(void(*done_callback)(bool)); + // apply given override data via given cap url // cap_url -- should be gAgent.getRegionCapability("ModifyMaterialParams") // overrides -- LLSD map in the format @@ -58,11 +64,11 @@ public: // "side": integer - index of face to be modified // "gltf_json" : string - GLTF compliant json of override data (optional, if omitted any existing override data will be cleared) static void modifyMaterialCoro(std::string cap_url, LLSD overrides, void(*done_callback)(bool)); - // save an override update for later (for example, if an override arrived for an unknown object) + + // save an override update that we got from the simulator for later (for example, if an override arrived for an unknown object) void queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFMaterial* override_data); void applyQueuedOverrides(LLViewerObject* obj); - private: typedef std::unordered_map<LLUUID, LLPointer<LLFetchedGLTFMaterial > > uuid_mat_map_t; uuid_mat_map_t mList; @@ -72,6 +78,21 @@ private: queued_override_map_t mQueuedOverrides; LLUUID mLastUpdateKey; + + struct ModifyMaterialData + { + LLUUID object_id; + S32 side = -1; + LLGLTFMaterial override_data; + LLUUID asset_id; + + bool has_override = false; + bool has_asset_id = false; + }; + + typedef std::list<ModifyMaterialData> modify_queue_t; + static modify_queue_t sModifyQueue; + }; extern LLGLTFMaterialList gGLTFMaterialList; |