diff options
author | Jacek Antonelli | 2008-12-12 23:24:52 -0600 |
---|---|---|
committer | Jacek Antonelli | 2008-12-12 23:25:00 -0600 |
commit | d1345838c6e36c35dbe3a6b683eb8ffe274b024a (patch) | |
tree | 5e727fcabbd5cf0337c11192bfe4db6191c7b044 /linden/indra/llrender/llrender.cpp | |
parent | Second Life viewer sources 1.22.2-RC (diff) | |
download | meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.zip meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.gz meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.bz2 meta-impy-d1345838c6e36c35dbe3a6b683eb8ffe274b024a.tar.xz |
Second Life viewer sources 1.22.3-RC
Diffstat (limited to 'linden/indra/llrender/llrender.cpp')
-rw-r--r-- | linden/indra/llrender/llrender.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/linden/indra/llrender/llrender.cpp b/linden/indra/llrender/llrender.cpp index a15f44a..fcd76d4 100644 --- a/linden/indra/llrender/llrender.cpp +++ b/linden/indra/llrender/llrender.cpp | |||
@@ -175,7 +175,7 @@ void LLTexUnit::disable(void) | |||
175 | } | 175 | } |
176 | } | 176 | } |
177 | 177 | ||
178 | bool LLTexUnit::bind(const LLImageGL* texture) | 178 | bool LLTexUnit::bind(const LLImageGL* texture, bool forceBind) |
179 | { | 179 | { |
180 | if (mIndex < 0) return false; | 180 | if (mIndex < 0) return false; |
181 | 181 | ||
@@ -183,29 +183,27 @@ bool LLTexUnit::bind(const LLImageGL* texture) | |||
183 | 183 | ||
184 | if (texture == NULL) | 184 | if (texture == NULL) |
185 | { | 185 | { |
186 | return texture->bindError(mIndex); | 186 | llwarns << "NULL LLTexUnit::bind texture" << llendl; |
187 | return false; | ||
187 | } | 188 | } |
188 | 189 | ||
189 | if (!texture->isInitialized()) | 190 | if (!texture->isInitialized() && !forceBind) |
190 | { | 191 | { |
191 | return texture->bindDefaultImage(mIndex); | 192 | return texture->bindDefaultImage(mIndex); |
192 | } | 193 | } |
194 | |||
193 | if (!texture->getTexName()) //if texture does not exist | 195 | if (!texture->getTexName()) //if texture does not exist |
194 | { | 196 | { |
195 | return texture->bindDefaultImage(mIndex); | 197 | return texture->bindDefaultImage(mIndex); |
196 | } | 198 | } |
197 | 199 | ||
198 | // Disabled caching of binding state. | 200 | // Disabled caching of binding state. |
199 | if (texture != NULL) | 201 | activate(); |
200 | { | 202 | enable(texture->getTarget()); |
201 | activate(); | 203 | mCurrTexture = texture->getTexName(); |
202 | enable(texture->getTarget()); | 204 | glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); |
203 | mCurrTexture = texture->getTexName(); | 205 | texture->updateBindStats(); |
204 | glBindTexture(sGLTextureType[texture->getTarget()], mCurrTexture); | 206 | return true; |
205 | texture->updateBindStats(); | ||
206 | return true; | ||
207 | } | ||
208 | return false; | ||
209 | } | 207 | } |
210 | 208 | ||
211 | bool LLTexUnit::bind(LLCubeMap* cubeMap) | 209 | bool LLTexUnit::bind(LLCubeMap* cubeMap) |