From b9acc0285cd5026fdd22f4f35c1cfdcb1258155e Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 16 Dec 2010 19:19:20 -0800 Subject: Dummy placeholder code for ER-414: Add object update type debug rendering view --- indra/newview/llspatialpartition.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'indra/newview/llspatialpartition.cpp') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 960e72ee42..3dd0e1081e 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2578,6 +2578,20 @@ void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color) gGL.end(); } +void renderUpdateType(LLDrawable* drawablep) +{ + S32 num_faces = drawablep->getNumFaces(); + if (num_faces) + { + LLGLEnable blend(GL_BLEND); + glColor4f(0,1,1,0.5f); + for (S32 i = 0; i < num_faces; ++i) + { + pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); + } + } +} + void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) { @@ -3018,6 +3032,10 @@ public: { renderRaycast(drawable); } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE)) + { + renderUpdateType(drawable); + } LLVOAvatar* avatar = dynamic_cast(drawable->getVObj().get()); @@ -3180,6 +3198,7 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_OCCLUSION | LLPipeline::RENDER_DEBUG_LIGHTS | LLPipeline::RENDER_DEBUG_BATCH_SIZE | + LLPipeline::RENDER_DEBUG_UPDATE_TYPE | LLPipeline::RENDER_DEBUG_BBOXES | LLPipeline::RENDER_DEBUG_POINTS | LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY | -- cgit v1.2.3 From 14e402cf5e8274caddaf1c763c2e044c53514b1e Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Thu, 16 Dec 2010 22:09:49 -0800 Subject: ER-414: Add object update type debug rendering view --- indra/newview/llspatialpartition.cpp | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) (limited to 'indra/newview/llspatialpartition.cpp') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 3dd0e1081e..8adb8c30e0 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2580,11 +2580,40 @@ void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color) void renderUpdateType(LLDrawable* drawablep) { + LLViewerObject* vobj = drawablep->getVObj(); + if (!vobj || OUT_UNKNOWN == vobj->getLastUpdateType()) + { + return; + } + LLGLEnable blend(GL_BLEND); + switch (vobj->getLastUpdateType()) + { + case OUT_FULL: + glColor4f(0,1,0,0.5f); + break; + case OUT_TERSE_IMPROVED: + glColor4f(0,1,1,0.5f); + break; + case OUT_FULL_COMPRESSED: + if (vobj->getLastUpdateCached()) + { + glColor4f(1,0,0,0.5f); + } + else + { + glColor4f(1,1,0,0.5f); + } + break; + case OUT_FULL_CACHED: + glColor4f(0,0,1,0.5f); + break; + default: + llwarns << "Unknown update_type " << vobj->getLastUpdateType() << llendl; + break; + }; S32 num_faces = drawablep->getNumFaces(); if (num_faces) { - LLGLEnable blend(GL_BLEND); - glColor4f(0,1,1,0.5f); for (S32 i = 0; i < num_faces; ++i) { pushVerts(drawablep->getFace(i), LLVertexBuffer::MAP_VERTEX); -- cgit v1.2.3