diff options
author | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:50 -0500 |
commit | 89fe5dab825a62a0e3fd8d248cbc91c65eb2a426 (patch) | |
tree | bcff14b7888d04a2fec799c59369f6095224bd08 /linden/indra/newview/lldrawpoolsky.cpp | |
parent | Second Life viewer sources 1.13.3.2 (diff) | |
download | meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.zip meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.gz meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.bz2 meta-impy-89fe5dab825a62a0e3fd8d248cbc91c65eb2a426.tar.xz |
Second Life viewer sources 1.14.0.0
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lldrawpoolsky.cpp | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp index 52f9f16..8266892 100644 --- a/linden/indra/newview/lldrawpoolsky.cpp +++ b/linden/indra/newview/lldrawpoolsky.cpp | |||
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | #include "imageids.h" | 32 | #include "imageids.h" |
33 | 33 | ||
34 | #include "llagparray.h" | ||
35 | #include "llagent.h" | 34 | #include "llagent.h" |
36 | #include "lldrawable.h" | 35 | #include "lldrawable.h" |
37 | #include "llface.h" | 36 | #include "llface.h" |
@@ -45,7 +44,7 @@ | |||
45 | #include "pipeline.h" | 44 | #include "pipeline.h" |
46 | 45 | ||
47 | LLDrawPoolSky::LLDrawPoolSky() : | 46 | LLDrawPoolSky::LLDrawPoolSky() : |
48 | LLDrawPool(POOL_SKY, DATA_SIMPLE_IL_MASK, DATA_SIMPLE_NIL_MASK) | 47 | LLFacePool(POOL_SKY) |
49 | { | 48 | { |
50 | } | 49 | } |
51 | 50 | ||
@@ -81,15 +80,17 @@ void LLDrawPoolSky::render(S32 pass) | |||
81 | glMatrixMode( GL_PROJECTION ); | 80 | glMatrixMode( GL_PROJECTION ); |
82 | 81 | ||
83 | glPushMatrix(); | 82 | glPushMatrix(); |
84 | gViewerWindow->setup3DRender(); | 83 | //gViewerWindow->setup3DRender(); |
84 | |||
85 | glMatrixMode(GL_MODELVIEW); | ||
86 | glPushMatrix(); | ||
87 | LLVector3 origin = gCamera->getOrigin(); | ||
88 | glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); | ||
85 | 89 | ||
86 | glEnableClientState(GL_VERTEX_ARRAY); | 90 | glEnableClientState(GL_VERTEX_ARRAY); |
87 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | 91 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); |
88 | glDisableClientState(GL_NORMAL_ARRAY); | 92 | glDisableClientState(GL_NORMAL_ARRAY); |
89 | 93 | ||
90 | bindGLVertexPointer(); | ||
91 | bindGLTexCoordPointer(); | ||
92 | |||
93 | S32 face_count = (S32)mDrawFace.size(); | 94 | S32 face_count = (S32)mDrawFace.size(); |
94 | 95 | ||
95 | for (S32 i = 0; i < llmin(6, face_count); ++i) | 96 | for (S32 i = 0; i < llmin(6, face_count); ++i) |
@@ -97,13 +98,13 @@ void LLDrawPoolSky::render(S32 pass) | |||
97 | renderSkyCubeFace(i); | 98 | renderSkyCubeFace(i); |
98 | } | 99 | } |
99 | 100 | ||
100 | const LLFace *hbfaces[3]; | 101 | LLFace *hbfaces[3]; |
101 | hbfaces[0] = NULL; | 102 | hbfaces[0] = NULL; |
102 | hbfaces[1] = NULL; | 103 | hbfaces[1] = NULL; |
103 | hbfaces[2] = NULL; | 104 | hbfaces[2] = NULL; |
104 | for (S32 curr_face = 0; curr_face < face_count; curr_face++) | 105 | for (S32 curr_face = 0; curr_face < face_count; curr_face++) |
105 | { | 106 | { |
106 | const LLFace* facep = mDrawFace[curr_face]; | 107 | LLFace* facep = mDrawFace[curr_face]; |
107 | if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep)) | 108 | if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep)) |
108 | { | 109 | { |
109 | hbfaces[0] = facep; | 110 | hbfaces[0] = facep; |
@@ -137,11 +138,12 @@ void LLDrawPoolSky::render(S32 pass) | |||
137 | glMatrixMode( GL_PROJECTION ); | 138 | glMatrixMode( GL_PROJECTION ); |
138 | glPopMatrix(); | 139 | glPopMatrix(); |
139 | glMatrixMode( GL_MODELVIEW ); | 140 | glMatrixMode( GL_MODELVIEW ); |
141 | glPopMatrix(); | ||
140 | } | 142 | } |
141 | 143 | ||
142 | void LLDrawPoolSky::renderSkyCubeFace(U8 side) | 144 | void LLDrawPoolSky::renderSkyCubeFace(U8 side) |
143 | { | 145 | { |
144 | const LLFace &face = *mDrawFace[LLVOSky::FACE_SIDE0 + side]; | 146 | LLFace &face = *mDrawFace[LLVOSky::FACE_SIDE0 + side]; |
145 | if (!face.getGeomCount()) | 147 | if (!face.getGeomCount()) |
146 | { | 148 | { |
147 | return; | 149 | return; |
@@ -149,20 +151,20 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) | |||
149 | 151 | ||
150 | mSkyTex[side].bindTexture(TRUE); | 152 | mSkyTex[side].bindTexture(TRUE); |
151 | 153 | ||
152 | face.renderIndexed(getRawIndices()); | 154 | face.renderIndexed(); |
153 | 155 | ||
154 | if (LLSkyTex::doInterpolate()) | 156 | if (LLSkyTex::doInterpolate()) |
155 | { | 157 | { |
156 | LLGLEnable blend(GL_BLEND); | 158 | LLGLEnable blend(GL_BLEND); |
157 | mSkyTex[side].bindTexture(FALSE); | 159 | mSkyTex[side].bindTexture(FALSE); |
158 | glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled | 160 | glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled |
159 | face.renderIndexed(getRawIndices()); | 161 | face.renderIndexed(); |
160 | } | 162 | } |
161 | 163 | ||
162 | mIndicesDrawn += face.getIndicesCount(); | 164 | mIndicesDrawn += face.getIndicesCount(); |
163 | } | 165 | } |
164 | 166 | ||
165 | void LLDrawPoolSky::renderHeavenlyBody(U8 hb, const LLFace* face) | 167 | void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face) |
166 | { | 168 | { |
167 | if ( !mHB[hb]->getDraw() ) return; | 169 | if ( !mHB[hb]->getDraw() ) return; |
168 | if (! face->getGeomCount()) return; | 170 | if (! face->getGeomCount()) return; |
@@ -171,13 +173,13 @@ void LLDrawPoolSky::renderHeavenlyBody(U8 hb, const LLFace* face) | |||
171 | tex->bind(); | 173 | tex->bind(); |
172 | LLColor4 color(mHB[hb]->getInterpColor()); | 174 | LLColor4 color(mHB[hb]->getInterpColor()); |
173 | LLOverrideFaceColor override(this, color); | 175 | LLOverrideFaceColor override(this, color); |
174 | face->renderIndexed(getRawIndices()); | 176 | face->renderIndexed(); |
175 | mIndicesDrawn += face->getIndicesCount(); | 177 | mIndicesDrawn += face->getIndicesCount(); |
176 | } | 178 | } |
177 | 179 | ||
178 | 180 | ||
179 | 181 | ||
180 | void LLDrawPoolSky::renderSunHalo(const LLFace* face) | 182 | void LLDrawPoolSky::renderSunHalo(LLFace* face) |
181 | { | 183 | { |
182 | if (! mHB[0]->getDraw()) return; | 184 | if (! mHB[0]->getDraw()) return; |
183 | if (! face->getGeomCount()) return; | 185 | if (! face->getGeomCount()) return; |
@@ -188,7 +190,7 @@ void LLDrawPoolSky::renderSunHalo(const LLFace* face) | |||
188 | color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f); | 190 | color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f); |
189 | 191 | ||
190 | LLOverrideFaceColor override(this, color); | 192 | LLOverrideFaceColor override(this, color); |
191 | face->renderIndexed(getRawIndices()); | 193 | face->renderIndexed(); |
192 | mIndicesDrawn += face->getIndicesCount(); | 194 | mIndicesDrawn += face->getIndicesCount(); |
193 | } | 195 | } |
194 | 196 | ||