summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llgltfmateriallist.cpp28
-rw-r--r--indra/newview/llgltfmateriallist.h2
-rw-r--r--indra/newview/llstartup.cpp4
3 files changed, 34 insertions, 0 deletions
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 <strstream>
+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();