From 0539b08370392385831f631fbdd8cb41977636b9 Mon Sep 17 00:00:00 2001 From: prep Date: Thu, 1 Dec 2011 11:38:16 -0500 Subject: Renamed segment rendering class into RenderNavPrim --- indra/llrender/llrendernavprim.cpp | 69 +++++++++++++++++++++++++++++++++++ indra/llrender/llrendernavprim.h | 50 +++++++++++++++++++++++++ indra/llrender/llrendersegment.cpp | 71 ------------------------------------ indra/llrender/llrendersegment.h | 50 ------------------------- indra/newview/llspatialpartition.cpp | 8 +--- 5 files changed, 120 insertions(+), 128 deletions(-) create mode 100644 indra/llrender/llrendernavprim.cpp create mode 100644 indra/llrender/llrendernavprim.h delete mode 100644 indra/llrender/llrendersegment.cpp delete mode 100644 indra/llrender/llrendersegment.h (limited to 'indra') diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp new file mode 100644 index 0000000000..eea65b3a0d --- /dev/null +++ b/indra/llrender/llrendernavprim.cpp @@ -0,0 +1,69 @@ +/** + * @file LLRenderNavPrim.cpp + * @brief + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + + +#include "linden_common.h" +#include "llrendernavprim.h" +#include "llerror.h" +#include "llglheaders.h" + +//============================================================================= +LLRenderNavPrim gRenderNav; +//============================================================================= +void LLRenderNavPrim::renderSegment( const LLVector3& start, const LLVector3& end, int color ) +{ + + LLColor4 colorA( color ); + glLineWidth(1.5f); + gGL.color3fv( colorA.mV ); + + gGL.begin(LLRender::LINES); + { + gGL.vertex3fv( start.mV ); + gGL.vertex3fv( end.mV ); + } + gGL.end(); + glLineWidth(1.0f); +} +//============================================================================= +void LLRenderNavPrim::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) +{ + LLGLEnable offset(GL_POLYGON_OFFSET_LINE); + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + glLineWidth(1.5f); + LLColor4 colorA( color ); + gGL.color4fv( colorA.mV ); + gGL.begin(LLRender::TRIANGLES); + { + gGL.vertex3fv( a.mV ); + gGL.vertex3fv( b.mV ); + gGL.vertex3fv( c.mV ); + } + gGL.end(); + + glLineWidth(1.f); +} +//============================================================================= \ No newline at end of file diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h new file mode 100644 index 0000000000..697c344d21 --- /dev/null +++ b/indra/llrender/llrendernavprim.h @@ -0,0 +1,50 @@ +/** + * @file LLRenderNavPrim.h + * @brief + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_RENDER_NAVPRIM_H +#define LL_RENDER_NAVPRIM_H + +#include "llmath.h" +#include "v3math.h" +#include "v4math.h" +#include "m3math.h" +#include "m4math.h" +#include "v4color.h" +#include "llgl.h" + + +class LLRenderNavPrim +{ +public: + void renderSegment( const LLVector3& start, const LLVector3& end, int color ); + void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ); + +private: +}; + +extern LLRenderNavPrim gRenderNav; + +#endif diff --git a/indra/llrender/llrendersegment.cpp b/indra/llrender/llrendersegment.cpp deleted file mode 100644 index 1f57af174e..0000000000 --- a/indra/llrender/llrendersegment.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file llrendersegment.cpp - * @brief - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -// Sphere creates a set of display lists that can then be called to create -// a lit sphere at different LOD levels. You only need one instance of sphere -// per viewer - then call the appropriate list. - -#include "linden_common.h" -#include "llrendersegment.h" -#include "llerror.h" -#include "llglheaders.h" - -LLRenderSegment gSegment; -//============================================================================= -void LLRenderSegment::renderSegment( const LLVector3& start, const LLVector3& end, int color ) -{ - - LLColor4 colorA( color ); - glLineWidth(1.5f); - gGL.color3fv( colorA.mV ); - - gGL.begin(LLRender::LINES); - { - gGL.vertex3fv( start.mV ); - gGL.vertex3fv( end.mV ); - } - gGL.end(); - glLineWidth(1.0f); -} -//============================================================================= -void LLRenderSegment::renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ) -{ - LLGLEnable offset(GL_POLYGON_OFFSET_LINE); - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - glLineWidth(1.5f); - LLColor4 colorA( color ); - gGL.color4fv( colorA.mV ); - gGL.begin(LLRender::TRIANGLES); - { - gGL.vertex3fv( a.mV ); - gGL.vertex3fv( b.mV ); - gGL.vertex3fv( c.mV ); - } - gGL.end(); - - glLineWidth(1.f); -} -//============================================================================= \ No newline at end of file diff --git a/indra/llrender/llrendersegment.h b/indra/llrender/llrendersegment.h deleted file mode 100644 index 58bc083e25..0000000000 --- a/indra/llrender/llrendersegment.h +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file llrendersegment.h - * @brief - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLRENDERSEGMENT_H -#define LL_LLRENDERSEGMENT_H - -#include "llmath.h" -#include "v3math.h" -#include "v4math.h" -#include "m3math.h" -#include "m4math.h" -#include "v4color.h" -#include "llgl.h" - - -class LLRenderSegment -{ -public: - void renderSegment( const LLVector3& start, const LLVector3& end, int color ); - void renderTri( const LLVector3& a, const LLVector3& b, const LLVector3& c, int color ); - -private: -}; - -extern LLRenderSegment gSegment; - -#endif diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 529ca9f022..ebe42f79f4 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -48,7 +48,6 @@ #include "llvolumemgr.h" #include "lltextureatlas.h" #include "llglslshader.h" -#include "llrendersegment.h" #include "llagent.h" static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); @@ -3995,12 +3994,7 @@ public: renderAgentTarget(avatar); } - //prep# - //LLVector3 pos = gAgent.getPositionGlobal(); - //LLVector3d vel = gAgent.getVelocity(); - //gSegment.renderSegment( pos, pos+vel, 0 ); - - + if (gDebugGL) { for (U32 i = 0; i < drawable->getNumFaces(); ++i) -- cgit v1.2.3