From a0392ec5ec5703bd54bc4e091820d1c1423bbad4 Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Sun, 2 Dec 2012 21:29:43 +0100 Subject: Refactor LLFloaterDebugMaterials::convertToPrintableMaterialID() as LLMaterialID::asString() so it can be used everywhere --- indra/newview/llfloaterdebugmaterials.cpp | 19 +------------------ indra/newview/llfloaterdebugmaterials.h | 1 - 2 files changed, 1 insertion(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterdebugmaterials.cpp b/indra/newview/llfloaterdebugmaterials.cpp index 026fd1a28c..7b3ad7aa13 100644 --- a/indra/newview/llfloaterdebugmaterials.cpp +++ b/indra/newview/llfloaterdebugmaterials.cpp @@ -972,9 +972,8 @@ void LLFloaterDebugMaterials::parseQueryViewableObjects() rowParams.columns.add(cellParams); cellParams.font = LLFontGL::getFontMonospace(); - std::string materialIDString = convertToPrintableMaterialID(objectMaterialID); cellParams.column = "material_id"; - cellParams.value = materialIDString; + cellParams.value = objectMaterialID.asString(); rowParams.columns.add(cellParams); LLSD rowValue = LLSD::emptyMap(); @@ -1624,22 +1623,6 @@ std::string LLFloaterDebugMaterials::convertToPrintableMaterialID(const LLSD& pB return materialIDString; } -std::string LLFloaterDebugMaterials::convertToPrintableMaterialID(const LLMaterialID& pMaterialID) const -{ - std::string materialID(reinterpret_cast(pMaterialID.get()), 16); - std::string materialIDString; - for (unsigned int i = 0U; i < 4; ++i) - { - if (i != 0U) - { - materialIDString += "-"; - } - const U32 *value = reinterpret_cast(&materialID.c_str()[i * 4]); - materialIDString += llformat("%08x", *value); - } - return materialIDString; -} - template T getLineEditorValue(const LLLineEditor *pLineEditor); template<> U8 getLineEditorValue(const LLLineEditor *pLineEditor) diff --git a/indra/newview/llfloaterdebugmaterials.h b/indra/newview/llfloaterdebugmaterials.h index 0643d7a252..572b17af27 100644 --- a/indra/newview/llfloaterdebugmaterials.h +++ b/indra/newview/llfloaterdebugmaterials.h @@ -135,7 +135,6 @@ private: void updateStatusMessage(); void updateControls(); std::string convertToPrintableMaterialID(const LLSD& pBinaryHash) const; - std::string convertToPrintableMaterialID(const LLMaterialID& pMaterialID) const; LLMaterial getMaterial() const; -- cgit v1.3