aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llrendersphere.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llrendersphere.cpp (renamed from linden/indra/newview/llsphere.cpp)44
1 files changed, 16 insertions, 28 deletions
diff --git a/linden/indra/newview/llsphere.cpp b/linden/indra/newview/llrendersphere.cpp
index 663537c..6e5c850 100644
--- a/linden/indra/newview/llsphere.cpp
+++ b/linden/indra/newview/llrendersphere.cpp
@@ -1,27 +1,17 @@
1/** 1/**
2 * @file llsphere.cpp 2 * @file llrendersphere.cpp
3 * @brief implementation of the LLSphere class. 3 * @brief implementation of the LLRenderSphere class.
4 * 4 *
5 * $LicenseInfo:firstyear=2001&license=viewergpl$ 5 * $LicenseInfo:firstyear=2001&license=internal$
6 * 6 *
7 * Copyright (c) 2001-2008, Linden Research, Inc. 7 * Copyright (c) 2001-2008, Linden Research, Inc.
8 * 8 *
9 * Second Life Viewer Source Code 9 * The following source code is PROPRIETARY AND CONFIDENTIAL. Use of
10 * The source code in this file ("Source Code") is provided by Linden Lab 10 * this source code is governed by the Linden Lab Source Code Disclosure
11 * to you under the terms of the GNU General Public License, version 2.0 11 * Agreement ("Agreement") previously entered between you and Linden
12 * ("GPL"), unless you have obtained a separate licensing agreement 12 * Lab. By accessing, using, copying, modifying or distributing this
13 * ("Other License"), formally executed by you and Linden Lab. Terms of 13 * software, you acknowledge that you have been informed of your
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or 14 * obligations under the Agreement and agree to abide by those obligations.
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 * 15 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO 16 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, 17 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
@@ -34,13 +24,13 @@
34// per viewer - then call the appropriate list. 24// per viewer - then call the appropriate list.
35 25
36#include "llviewerprecompiledheaders.h" 26#include "llviewerprecompiledheaders.h"
37#include "llsphere.h" 27#include "llrendersphere.h"
38#include "llerror.h" 28#include "llerror.h"
39#include "llvertexbuffer.h" 29
40#include "llglheaders.h" 30#include "llglheaders.h"
41 31
42GLUquadricObj *gQuadObj2 = NULL; 32GLUquadricObj *gQuadObj2 = NULL;
43LLSphere gSphere; 33LLRenderSphere gSphere;
44 34
45void drawSolidSphere(GLdouble radius, GLint slices, GLint stacks); 35void drawSolidSphere(GLdouble radius, GLint slices, GLint stacks);
46 36
@@ -108,7 +98,7 @@ void lat2xyz_rad(LLVector3 * result, F32 lat, F32 lon)
108// A couple thoughts on sphere drawing: 98// A couple thoughts on sphere drawing:
109// 1) You need more slices than stacks, but little less than 2:1 99// 1) You need more slices than stacks, but little less than 2:1
110// 2) At low LOD, setting stacks to an odd number avoids a "band" around the equator, making things look smoother 100// 2) At low LOD, setting stacks to an odd number avoids a "band" around the equator, making things look smoother
111void LLSphere::prerender() 101void LLRenderSphere::prerender()
112{ 102{
113 // Create a series of display lists for different LODs 103 // Create a series of display lists for different LODs
114 mDList[0] = glGenLists(1); 104 mDList[0] = glGenLists(1);
@@ -132,7 +122,7 @@ void LLSphere::prerender()
132 glEndList(); 122 glEndList();
133} 123}
134 124
135void LLSphere::cleanupGL() 125void LLRenderSphere::cleanupGL()
136{ 126{
137 for (S32 detail = 0; detail < 4; detail++) 127 for (S32 detail = 0; detail < 4; detail++)
138 { 128 {
@@ -151,7 +141,7 @@ void LLSphere::cleanupGL()
151// 141//
152// The toughest adjustment is the cutoff for the lowest LOD 142// The toughest adjustment is the cutoff for the lowest LOD
153// Maybe we should have more LODs at the low end? 143// Maybe we should have more LODs at the low end?
154void LLSphere::render(F32 pixel_area) 144void LLRenderSphere::render(F32 pixel_area)
155{ 145{
156 S32 level_of_detail; 146 S32 level_of_detail;
157 147
@@ -171,13 +161,11 @@ void LLSphere::render(F32 pixel_area)
171 { 161 {
172 level_of_detail = 3; 162 level_of_detail = 3;
173 } 163 }
174 LLVertexBuffer::unbind();
175 glCallList(mDList[level_of_detail]); 164 glCallList(mDList[level_of_detail]);
176} 165}
177 166
178 167
179void LLSphere::render() 168void LLRenderSphere::render()
180{ 169{
181 LLVertexBuffer::unbind();
182 glCallList(mDList[0]); 170 glCallList(mDList[0]);
183} 171}