summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-06-10 18:51:22 -0500
committerDave Parks <davep@lindenlab.com>2011-06-10 18:51:22 -0500
commit99b05f9647353f9bf5a44b1eb424105598d2b725 (patch)
tree57b5eee92a3e0b959f363339cc48860b3226054b /indra/newview
parent84132d5edb7fa77c24b28e09ff17f82995d6eec5 (diff)
Fix for show object updates not working (and crashing, and behaving badly).
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llviewermessage.cpp12
-rw-r--r--indra/newview/llviewerobject.cpp26
-rw-r--r--indra/newview/pipeline.cpp36
-rw-r--r--indra/newview/pipeline.h16
4 files changed, 62 insertions, 28 deletions
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3832be727f..b4a4aaa329 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -96,7 +96,6 @@
#include "llviewerwindow.h"
#include "llvlmanager.h"
#include "llvoavatarself.h"
-#include "llvotextbubble.h"
#include "llworld.h"
#include "pipeline.h"
#include "llfloaterworldmap.h"
@@ -4228,15 +4227,8 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
// Display green bubble on kill
if ( gShowObjectUpdates )
{
- LLViewerObject* newobject;
- newobject = gObjectList.createObjectViewer(LL_PCODE_LEGACY_TEXT_BUBBLE, objectp->getRegion());
-
- LLVOTextBubble* bubble = (LLVOTextBubble*) newobject;
-
- bubble->mColor.setVec(0.f, 1.f, 0.f, 1.f);
- bubble->setScale( 2.0f * bubble->getScale() );
- bubble->setPositionGlobal(objectp->getPositionGlobal());
- gPipeline.addObject(bubble);
+ LLColor4 color(0.f,1.f,0.f,1.f);
+ gPipeline.addDebugBlip(objectp->getPositionAgent(), color);
}
// Do the kill
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 72cdb4b355..be9ff872c0 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -89,7 +89,6 @@
#include "llvopartgroup.h"
#include "llvosky.h"
#include "llvosurfacepatch.h"
-#include "llvotextbubble.h"
#include "llvotree.h"
#include "llvovolume.h"
#include "llvowater.h"
@@ -168,8 +167,6 @@ LLViewerObject *LLViewerObject::createObject(const LLUUID &id, const LLPCode pco
// llwarns << "Creating new tree!" << llendl;
// res = new LLVOTree(id, pcode, regionp); break;
res = NULL; break;
- case LL_PCODE_LEGACY_TEXT_BUBBLE:
- res = new LLVOTextBubble(id, pcode, regionp); break;
case LL_VO_CLOUDS:
res = new LLVOClouds(id, pcode, regionp); break;
case LL_VO_SURFACE_PATCH:
@@ -1973,23 +1970,16 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
if ( gShowObjectUpdates )
{
- if (!((mPrimitiveCode == LL_PCODE_LEGACY_AVATAR) && (((LLVOAvatar *) this)->isSelf()))
- && mRegionp)
+ LLColor4 color;
+ if (update_type == OUT_TERSE_IMPROVED)
{
- LLViewerObject* object = gObjectList.createObjectViewer(LL_PCODE_LEGACY_TEXT_BUBBLE, mRegionp);
- LLVOTextBubble* bubble = (LLVOTextBubble*) object;
-
- if (update_type == OUT_TERSE_IMPROVED)
- {
- bubble->mColor.setVec(0.f, 0.f, 1.f, 1.f);
- }
- else
- {
- bubble->mColor.setVec(1.f, 0.f, 0.f, 1.f);
- }
- object->setPositionGlobal(getPositionGlobal());
- gPipeline.addObject(object);
+ color.setVec(0.f, 0.f, 1.f, 1.f);
+ }
+ else
+ {
+ color.setVec(1.f, 0.f, 0.f, 1.f);
}
+ gPipeline.addDebugBlip(getPositionAgent(), color);
}
if ((0.0f == vel_mag_sq) &&
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 4d678117a5..f2294335ed 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -4096,6 +4096,37 @@ void LLPipeline::renderDebug()
bool hud_only = hasRenderType(LLPipeline::RENDER_TYPE_HUD);
+ if (!hud_only && !mDebugBlips.empty())
+ { //render debug blips
+ glPointSize(8.f);
+ LLGLDepthTest depth(GL_TRUE, GL_TRUE, GL_ALWAYS);
+
+ gGL.begin(LLRender::POINTS);
+ for (std::list<DebugBlip>::iterator iter = mDebugBlips.begin(); iter != mDebugBlips.end(); )
+ {
+ DebugBlip& blip = *iter;
+
+ blip.mAge += gFrameIntervalSeconds;
+ if (blip.mAge > 2.f)
+ {
+ mDebugBlips.erase(iter++);
+ }
+ else
+ {
+ iter++;
+ }
+
+ blip.mPosition.mV[2] += gFrameIntervalSeconds*2.f;
+
+ gGL.color4fv(blip.mColor.mV);
+ gGL.vertex3fv(blip.mPosition.mV);
+ }
+ gGL.end();
+ gGL.flush();
+ glPointSize(1.f);
+ }
+
+
// Debug stuff.
for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin();
iter != LLWorld::getInstance()->getRegionList().end(); ++iter)
@@ -9839,4 +9870,9 @@ void LLPipeline::clearRenderTypeMask(U32 type, ...)
}
}
+void LLPipeline::addDebugBlip(const LLVector3& position, const LLColor4& color)
+{
+ DebugBlip blip(position, color);
+ mDebugBlips.push_back(blip);
+}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index e967b8c31e..e9da25e544 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -360,6 +360,8 @@ public:
static void updateRenderDeferred();
static void refreshRenderDeferred();
+ void addDebugBlip(const LLVector3& position, const LLColor4& color);
+
private:
void unloadShaders();
void addToQuickLookup( LLDrawPool* new_poolp );
@@ -730,6 +732,20 @@ public:
protected:
std::vector<LLFace*> mSelectedFaces;
+ class DebugBlip
+ {
+ public:
+ LLColor4 mColor;
+ LLVector3 mPosition;
+ F32 mAge;
+
+ DebugBlip(const LLVector3& position, const LLColor4& color)
+ : mColor(color), mPosition(position), mAge(0.f)
+ { }
+ };
+
+ std::list<DebugBlip> mDebugBlips;
+
LLPointer<LLViewerFetchedTexture> mFaceSelectImagep;
U32 mLightMask;