From 7a3ed9dadc116e73349ec6fcd37eb3aee5916676 Mon Sep 17 00:00:00 2001 From: Brad Kittenbrink Date: Fri, 14 Oct 2022 14:33:18 -0700 Subject: Added stub handler for GLTF LargeGenericMessage as part of work on SL-18105 SL-17697 and SL-17698 --- indra/newview/llgltfmateriallist.cpp | 28 ++++++++++++++++++++++++++++ indra/newview/llgltfmateriallist.h | 2 ++ indra/newview/llstartup.cpp | 4 ++++ 3 files changed, 34 insertions(+) diff --git a/indra/newview/llgltfmateriallist.cpp b/indra/newview/llgltfmateriallist.cpp index 5cbf853179..9c71f11bbc 100644 --- a/indra/newview/llgltfmateriallist.cpp +++ b/indra/newview/llgltfmateriallist.cpp @@ -28,13 +28,36 @@ #include "llgltfmateriallist.h" #include "llassetstorage.h" +#include "lldispatcher.h" #include "llfilesystem.h" #include "llsdserialize.h" #include "lltinygltfhelper.h" +#include "llviewergenericmessage.h" #include "tinygltf/tiny_gltf.h" #include +namespace +{ + class LLGLTFOverrideDispatchHandler : public LLDispatchHandler + { + public: + LLGLTFOverrideDispatchHandler() = default; + ~LLGLTFOverrideDispatchHandler() override = default; + + bool operator()(const LLDispatcher* dispatcher, const std::string& key, const LLUUID& invoice, const sparam_t& strings) override + { + LL_DEBUGS() << "strings: "; + for (std::string const & s : strings) { + LL_CONT << " " << s; + } + LL_CONT << LL_ENDL; + return true; + } + }; + LLGLTFOverrideDispatchHandler handle_gltf_override_message; +} + LLGLTFMaterialList gGLTFMaterialList; LLGLTFMaterial* LLGLTFMaterialList::getMaterial(const LLUUID& id) @@ -128,3 +151,8 @@ void LLGLTFMaterialList::removeMaterial(const LLUUID& id) mList.erase(id); } +// static +void LLGLTFMaterialList::registerCallbacks() +{ + gGenericDispatcher.addHandler("GLTF", &handle_gltf_override_message); +} diff --git a/indra/newview/llgltfmateriallist.h b/indra/newview/llgltfmateriallist.h index 49760504e6..4aed4b009d 100644 --- a/indra/newview/llgltfmateriallist.h +++ b/indra/newview/llgltfmateriallist.h @@ -44,6 +44,8 @@ public: void addMaterial(const LLUUID& id, LLGLTFMaterial* material); void removeMaterial(const LLUUID& id); + static void registerCallbacks(); + }; extern LLGLTFMaterialList gGLTFMaterialList; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 6aca701fe2..64dd3af223 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -60,6 +60,7 @@ #include "llfloatergridstatus.h" #include "llfloaterimsession.h" #include "lllocationhistory.h" +#include "llgltfmateriallist.h" #include "llimageworker.h" #include "llloginflags.h" @@ -1473,6 +1474,9 @@ bool idle_startup() gXferManager->registerCallbacks(gMessageSystem); display_startup(); + LLGLTFMaterialList::registerCallbacks(); + display_startup(); + LLStartUp::initNameCache(); display_startup(); -- cgit v1.2.3