diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-08-31 21:25:47 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-09-01 20:43:42 +0800 |
commit | 95582654e49422d51b55665c3f2821c848ad1cb8 (patch) | |
tree | d6d03a887b8e1b6c3be1b139d63b1638c5d0fdcd /indra/newview/llgltfmateriallist.h | |
parent | ab3f483a3e5ed213882a83b882095cfdb6a4de57 (diff) | |
parent | b0fefd62adbf51f32434ba077e9f52d8a9241d15 (diff) |
Merge remote-tracking branch 'secondlife/release/2024.08-DeltaFPS' into 2024.08-DeltaFPS
Diffstat (limited to 'indra/newview/llgltfmateriallist.h')
-rw-r--r-- | indra/newview/llgltfmateriallist.h | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h index 982538f106..e79da3592a 100644 --- a/indra/newview/llgltfmateriallist.h +++ b/indra/newview/llgltfmateriallist.h @@ -58,7 +58,9 @@ public: // NOTE: do not use to revert to asset when applying a new asset id, use queueApply below static void queueModify(const LLViewerObject* obj, S32 side, const LLGLTFMaterial* mat); - // Queue an application of a material asset we want to send to the simulator. Call "flushUpdates" to flush pending updates. + // Queue an application of a material asset we want to send to the simulator. + // Call "flushUpdates" to flush pending updates immediately. + // Will be flushed automatically if queue is full. // object_id - ID of object to apply material asset to // side - TextureEntry index to apply material to, or -1 for all sides // asset_id - ID of material asset to apply, or LLUUID::null to disassociate current material asset @@ -66,7 +68,9 @@ public: // NOTE: Implicitly clears most override data if present static void queueApply(const LLViewerObject* obj, S32 side, const LLUUID& asset_id); - // Queue an application of a material asset we want to send to the simulator. Call "flushUpdates" to flush pending updates. + // Queue an application of a material asset we want to send to the simulator. + // Call "flushUpdates" to flush pending updates immediately. + // Will be flushed automatically if queue is full. // object_id - ID of object to apply material asset to // side - TextureEntry index to apply material to, or -1 for all sides // asset_id - ID of material asset to apply, or LLUUID::null to disassociate current material asset @@ -104,7 +108,22 @@ private: // NOTE: this is NOT for applying overrides from the UI, see queueModifyMaterial above void queueOverrideUpdate(const LLUUID& id, S32 side, LLGLTFMaterial* override_data); - static void modifyMaterialCoro(std::string cap_url, LLSD overrides, void(*done_callback)(bool)); + + class CallbackHolder + { + public: + CallbackHolder(void(*done_callback)(bool)) + : mCallback(done_callback) + {} + ~CallbackHolder() + { + if (mCallback) mCallback(mSuccess); + } + std::function<void(bool)> mCallback = nullptr; + bool mSuccess = true; + }; + static void flushUpdatesOnce(std::shared_ptr<CallbackHolder> callback_holder); + static void modifyMaterialCoro(std::string cap_url, LLSD overrides, std::shared_ptr<CallbackHolder> callback_holder); protected: static void onAssetLoadComplete( |