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/lldrawpoolstars.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 'linden/indra/newview/lldrawpoolstars.cpp')
-rw-r--r-- | linden/indra/newview/lldrawpoolstars.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/linden/indra/newview/lldrawpoolstars.cpp b/linden/indra/newview/lldrawpoolstars.cpp index a0eedb8..3d4eebb 100644 --- a/linden/indra/newview/lldrawpoolstars.cpp +++ b/linden/indra/newview/lldrawpoolstars.cpp | |||
@@ -33,9 +33,10 @@ | |||
33 | #include "llsky.h" | 33 | #include "llsky.h" |
34 | #include "llvostars.h" | 34 | #include "llvostars.h" |
35 | #include "pipeline.h" | 35 | #include "pipeline.h" |
36 | #include "llviewercamera.h" | ||
36 | 37 | ||
37 | LLDrawPoolStars::LLDrawPoolStars() : | 38 | LLDrawPoolStars::LLDrawPoolStars() : |
38 | LLDrawPool(POOL_STARS, DATA_VERTICES_MASK | DATA_COLORS_MASK, 0) | 39 | LLFacePool(POOL_STARS) |
39 | { | 40 | { |
40 | } | 41 | } |
41 | 42 | ||
@@ -72,28 +73,42 @@ void LLDrawPoolStars::render(S32 pass) | |||
72 | 73 | ||
73 | gPipeline.disableLights(); | 74 | gPipeline.disableLights(); |
74 | 75 | ||
75 | glPointSize(2.0); | 76 | GLint viewport[4]; |
76 | 77 | ||
77 | bindGLVertexPointer(); | 78 | glGetIntegerv(GL_VIEWPORT, viewport); |
79 | |||
80 | if (viewport[2] > 512 && viewport[3] > 512) | ||
81 | { | ||
82 | glPointSize(2.f); | ||
83 | } | ||
84 | |||
85 | LLVector3 origin = gCamera->getOrigin(); | ||
86 | glPushMatrix(); | ||
87 | glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); | ||
78 | 88 | ||
79 | glEnableClientState(GL_COLOR_ARRAY); | 89 | glEnableClientState(GL_COLOR_ARRAY); |
80 | bindGLColorPointer(); | ||
81 | 90 | ||
82 | S32 face_count = (S32)mDrawFace.size(); | 91 | S32 face_count = (S32)mDrawFace.size(); |
83 | for (S32 curr_face = 0; curr_face < face_count; curr_face++) | 92 | for (S32 curr_face = 0; curr_face < face_count; curr_face++) |
84 | { | 93 | { |
85 | const LLFace* face = mDrawFace[curr_face]; | 94 | LLFace* face = mDrawFace[curr_face]; |
86 | if (!face->getGeomCount()) | 95 | if (!face->getGeomCount()) |
87 | { | 96 | { |
88 | continue; | 97 | continue; |
89 | } | 98 | } |
90 | 99 | ||
91 | // render the stars as a sphere centered at viewer camera | 100 | // render the stars as a sphere centered at viewer camera |
92 | 101 | if (face->mVertexBuffer.notNull()) | |
93 | face->renderIndexed(getRawIndices()); | 102 | { |
94 | mIndicesDrawn += face->getIndicesCount(); | 103 | face->mVertexBuffer->setBuffer(getVertexDataMask()); |
104 | U32* indicesp = (U32*) face->mVertexBuffer->getIndicesPointer(); | ||
105 | glDrawElements(GL_POINTS, face->getIndicesCount(), GL_UNSIGNED_INT, indicesp); | ||
106 | mIndicesDrawn += face->getIndicesCount(); | ||
107 | } | ||
95 | } | 108 | } |
96 | glDisableClientState(GL_COLOR_ARRAY); | 109 | glDisableClientState(GL_COLOR_ARRAY); |
110 | glPointSize(1.f); | ||
111 | glPopMatrix(); | ||
97 | } | 112 | } |
98 | 113 | ||
99 | 114 | ||