diff options
Diffstat (limited to 'indra/newview/llviewermenu.cpp')
-rw-r--r-- | indra/newview/llviewermenu.cpp | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 1a0437ed92..fd16b07985 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -139,6 +139,7 @@ #include "boost/unordered_map.hpp" #include <boost/regex.hpp> #include <boost/algorithm/string.hpp> +#include <boost/json.hpp> #include "llcleanup.h" #include "llviewershadermgr.h" #include "gltfscenemanager.h" @@ -3317,6 +3318,13 @@ bool enable_os_exception() #endif } + +bool enable_gltf() +{ + static LLCachedControl<bool> enablegltf(gSavedSettings, "GLTFEnabled", false); + return enablegltf; +} + class LLSelfRemoveAllAttachments : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -8080,7 +8088,6 @@ class LLAdvancedClickGLTFOpen: public view_listener_t { bool handleEvent(const LLSD& userdata) { - // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools) LL::GLTFSceneManager::instance().load(); return true; } @@ -8090,7 +8097,6 @@ class LLAdvancedClickGLTFSaveAs : public view_listener_t { bool handleEvent(const LLSD& userdata) { - // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools) LL::GLTFSceneManager::instance().saveAs(); return true; } @@ -8100,12 +8106,39 @@ class LLAdvancedClickGLTFDecompose : public view_listener_t { bool handleEvent(const LLSD& userdata) { - // open personal lighting floater when previewing an HDRI (keeps HDRI from implicitly unloading when opening build tools) LL::GLTFSceneManager::instance().decomposeSelection(); return true; } }; +class LLAdvancedClickGLTFUpload: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LL::GLTFSceneManager::instance().uploadSelection(); + return true; + } +}; + +class LLAdvancedClickResizeWindow : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + S32 w = 0; + S32 h = 0; + + sscanf(userdata.asString().c_str(), "%dx%d", &w, &h); + + if (w > 0 && h > 0) + { + gViewerWindow->getWindow()->setSize(LLCoordWindow(w, h)); + } + + return true; + } +}; + + // these are used in the gl menus to set control values that require shader recompilation class LLToggleShaderControl : public view_listener_t { @@ -9761,6 +9794,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedClickGLTFOpen(), "Advanced.ClickGLTFOpen"); view_listener_t::addMenu(new LLAdvancedClickGLTFSaveAs(), "Advanced.ClickGLTFSaveAs"); view_listener_t::addMenu(new LLAdvancedClickGLTFDecompose(), "Advanced.ClickGLTFDecompose"); + view_listener_t::addMenu(new LLAdvancedClickGLTFUpload(), "Advanced.ClickGLTFUpload"); + view_listener_t::addMenu(new LLAdvancedClickResizeWindow(), "Advanced.ClickResizeWindow"); view_listener_t::addMenu(new LLAdvancedPurgeShaderCache(), "Advanced.ClearShaderCache"); view_listener_t::addMenu(new LLAdvancedRebuildTerrain(), "Advanced.RebuildTerrain"); @@ -10065,6 +10100,7 @@ void initialize_menus() commit.add("Pathfinding.Characters.Select", boost::bind(&LLFloaterPathfindingCharacters::openCharactersWithSelectedObjects)); enable.add("EnableSelectInPathfindingCharacters", boost::bind(&enable_object_select_in_pathfinding_characters)); enable.add("Advanced.EnableErrorOSException", boost::bind(&enable_os_exception)); + enable.add("EnableGLTF", boost::bind(&enable_gltf)); view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible"); view_listener_t::addMenu(new LLShowSidetrayPanel(), "ShowSidetrayPanel"); |