summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraham Madarasz (Graham) <graham@lindenlab.com>2013-05-17 14:02:31 -0700
committerGraham Madarasz (Graham) <graham@lindenlab.com>2013-05-17 14:02:31 -0700
commit74c1bc29e7dc566c7bb1a654b1dbf632d39dcb17 (patch)
tree266c353919add41bfe9d4079f1339a33dc9a42c0
parent2a3f4dfc458c42101f048d96b8df68ccd23646be (diff)
NORSPEC-189 restore old mat param update registration
-rw-r--r--indra/newview/llmaterialmgr.cpp5
-rw-r--r--indra/newview/llmaterialmgr.h9
-rwxr-xr-xindra/newview/llvovolume.cpp19
-rwxr-xr-xindra/newview/llvovolume.h4
4 files changed, 32 insertions, 5 deletions
diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp
index 59e5d05736..edf8e83038 100644
--- a/indra/newview/llmaterialmgr.cpp
+++ b/indra/newview/llmaterialmgr.cpp
@@ -217,6 +217,7 @@ boost::signals2::connection LLMaterialMgr::get(const LLUUID& region_id, const LL
return connection;
}
+#if USE_TE_SPECIFIC_REGISTRATION
boost::signals2::connection LLMaterialMgr::getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, LLMaterialMgr::get_callback_te_t::slot_type cb)
{
boost::signals2::connection connection;
@@ -261,6 +262,7 @@ boost::signals2::connection LLMaterialMgr::getTE(const LLUUID& region_id, const
return connection;
}
+#endif
bool LLMaterialMgr::isGetAllPending(const LLUUID& region_id) const
{
@@ -346,6 +348,7 @@ const LLMaterialPtr LLMaterialMgr::setMaterial(const LLUUID& region_id, const LL
mGetCallbacks.erase(itCallback);
}
+#if USE_TE_SPECIFIC_REGISTRATION
TEMaterialPair te_mat_pair;
te_mat_pair.materialID = material_id;
@@ -361,6 +364,7 @@ const LLMaterialPtr LLMaterialMgr::setMaterial(const LLUUID& region_id, const LL
mGetTECallbacks.erase(itCallbackTE);
}
}
+#endif
return itMaterial->second;
}
@@ -779,3 +783,4 @@ void LLMaterialMgr::onRegionRemoved(LLViewerRegion* regionp)
clearGetQueues(regionp->getRegionID());
// Put doesn't need clearing: objects that can't be found will clean up in processPutQueue()
}
+
diff --git a/indra/newview/llmaterialmgr.h b/indra/newview/llmaterialmgr.h
index b5ba8ab680..9b3d7a0246 100644
--- a/indra/newview/llmaterialmgr.h
+++ b/indra/newview/llmaterialmgr.h
@@ -44,11 +44,13 @@ public:
typedef std::map<LLMaterialID, LLMaterialPtr> material_map_t;
typedef boost::signals2::signal<void (const LLMaterialID&, const LLMaterialPtr)> get_callback_t;
- typedef boost::signals2::signal<void (const LLMaterialID&, const LLMaterialPtr, U32 te)> get_callback_te_t;
-
const LLMaterialPtr get(const LLUUID& region_id, const LLMaterialID& material_id);
boost::signals2::connection get(const LLUUID& region_id, const LLMaterialID& material_id, get_callback_t::slot_type cb);
+
+#if USE_TE_SPECIFIC_REGISTRATION
+ typedef boost::signals2::signal<void (const LLMaterialID&, const LLMaterialPtr, U32 te)> get_callback_te_t;
boost::signals2::connection getTE(const LLUUID& region_id, const LLMaterialID& material_id, U32 te, get_callback_te_t::slot_type cb);
+#endif
typedef boost::signals2::signal<void (const LLUUID&, const material_map_t&)> getall_callback_t;
void getAll(const LLUUID& region_id);
@@ -82,6 +84,7 @@ protected:
typedef std::map<LLMaterialID, get_callback_t*> get_callback_map_t;
get_callback_map_t mGetCallbacks;
+#if USE_TE_SPECIFIC_REGISTRATION
// struct for TE-specific material ID query
struct TEMaterialPair
{
@@ -101,6 +104,7 @@ protected:
typedef std::map<TEMaterialPair, get_callback_te_t*> get_callback_te_map_t;
get_callback_te_map_t mGetTECallbacks;
+#endif
typedef std::set<LLUUID> getall_queue_t;
getall_queue_t mGetAllQueue;
@@ -118,3 +122,4 @@ protected:
};
#endif // LL_LLMATERIALMGR_H
+
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index c3c6747e99..d8f1896654 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1973,7 +1973,7 @@ S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow)
return res;
}
-void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te)
+void LLVOVolume::setTEMaterialParamsCallbackTE(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams, U32 te)
{
LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << " to TE " << te << LL_ENDL;
if (te >= getNumTEs())
@@ -1986,6 +1986,18 @@ void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, co
}
}
+void LLVOVolume::setTEMaterialParamsCallback(const LLMaterialID &pMaterialID, const LLMaterialPtr pMaterialParams)
+{
+ LL_DEBUGS("MaterialTEs") << "materialid " << pMaterialID.asString() << LL_ENDL;
+ for (U8 i = 0; i < getNumTEs(); i++)
+ {
+ if (getTE(i) && (getTE(i)->getMaterialID().isNull() || (getTE(i)->getMaterialID() == pMaterialID)))
+ {
+ setTEMaterialParams(i, pMaterialParams);
+ }
+ }
+}
+
S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
{
S32 res = LLViewerObject::setTEMaterialID(te, pMaterialID);
@@ -1996,7 +2008,11 @@ S32 LLVOVolume::setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID)
LL_DEBUGS("MaterialTEs") << " " << pMaterialID.asString() << LL_ENDL;
if (res)
{
+#if USE_TE_SPECIFIC_REGISTRATION
LLMaterialMgr::instance().getTE(getRegion()->getRegionID(), pMaterialID, te, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2, _3));
+#else
+ LLMaterialMgr::instance().get(getRegion()->getRegionID(), pMaterialID, boost::bind(&LLVOVolume::setTEMaterialParamsCallback, this, _1, _2));
+#endif
setChanged(TEXTURE);
if (!mDrawable.isNull())
{
@@ -5553,4 +5569,3 @@ void LLHUDPartition::shift(const LLVector4a &offset)
//HUD objects don't shift with region crossing. That would be silly.
}
-
diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h
index a5f933c319..52539ab8d5 100755
--- a/indra/newview/llvovolume.h
+++ b/indra/newview/llvovolume.h
@@ -187,7 +187,8 @@ public:
/*virtual*/ S32 setTEMediaFlags(const U8 te, const U8 media_flags);
/*virtual*/ S32 setTEGlow(const U8 te, const F32 glow);
/*virtual*/ S32 setTEMaterialID(const U8 te, const LLMaterialID& pMaterialID);
- void setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te);
+ void setTEMaterialParamsCallback(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams);
+ void setTEMaterialParamsCallbackTE(const LLMaterialID& pMaterialID, const LLMaterialPtr pMaterialParams, U32 te);
/*virtual*/ S32 setTEMaterialParams(const U8 te, const LLMaterialPtr pMaterialParams);
/*virtual*/ S32 setTEScale(const U8 te, const F32 s, const F32 t);
/*virtual*/ S32 setTEScaleS(const U8 te, const F32 s);
@@ -382,3 +383,4 @@ protected:
};
#endif // LL_LLVOVOLUME_H
+