diff options
Diffstat (limited to 'indra/newview/llsurface.cpp')
-rw-r--r-- | indra/newview/llsurface.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/indra/newview/llsurface.cpp b/indra/newview/llsurface.cpp index 27a08e7d7b..de3d80f044 100644 --- a/indra/newview/llsurface.cpp +++ b/indra/newview/llsurface.cpp @@ -36,7 +36,7 @@ #include "llrender.h" -#include "llviewerimagelist.h" +#include "llviewertexturelist.h" #include "llpatchvertexarray.h" #include "patch_dct.h" #include "patch_code.h" @@ -47,7 +47,7 @@ #include "llappviewer.h" #include "llworld.h" #include "llviewercontrol.h" -#include "llviewerimage.h" +#include "llviewertexture.h" #include "llsurfacepatch.h" #include "llvosurfacepatch.h" #include "llvowater.h" @@ -137,12 +137,10 @@ LLSurface::~LLSurface() // Don't enable this until we blitz the draw pool for it as well. -- djs if (mSTexturep) { - gImageList.deleteImage(mSTexturep); mSTexturep = NULL; } if (mWaterTexturep) { - gImageList.deleteImage(mWaterTexturep); mWaterTexturep = NULL; } } @@ -214,18 +212,18 @@ void LLSurface::create(const S32 grids_per_edge, createPatchData(); } -LLViewerImage* LLSurface::getSTexture() +LLViewerTexture* LLSurface::getSTexture() { - if (mSTexturep.notNull() && !mSTexturep->getHasGLTexture()) + if (mSTexturep.notNull() && !mSTexturep->hasValidGLTexture()) { createSTexture(); } return mSTexturep; } -LLViewerImage* LLSurface::getWaterTexture() +LLViewerTexture* LLSurface::getWaterTexture() { - if (mWaterTexturep.notNull() && !mWaterTexturep->getHasGLTexture()) + if (mWaterTexturep.notNull() && !mWaterTexturep->hasValidGLTexture()) { createWaterTexture(); } @@ -249,11 +247,10 @@ void LLSurface::createSTexture() } } - mSTexturep = new LLViewerImage(raw, FALSE); + mSTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mSTexturep->dontDiscard(); - gGL.getTexUnit(0)->bind(mSTexturep.get()); - mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); - gImageList.addImage(mSTexturep); + gGL.getTexUnit(0)->bind(mSTexturep); + mSTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); } } @@ -274,11 +271,10 @@ void LLSurface::createWaterTexture() *(default_texture + (i*sTextureSize/2 + j)*4 + 3) = MAX_WATER_COLOR.mV[3]; } } - mWaterTexturep = new LLViewerImage(raw, FALSE); + mWaterTexturep = LLViewerTextureManager::getLocalTexture(raw.get(), FALSE); mWaterTexturep->dontDiscard(); - gGL.getTexUnit(0)->bind(mWaterTexturep.get()); + gGL.getTexUnit(0)->bind(mWaterTexturep); mWaterTexturep->setAddressMode(LLTexUnit::TAM_CLAMP); - gImageList.addImage(mWaterTexturep); } } @@ -1193,7 +1189,7 @@ F32 LLSurface::getWaterHeight() const BOOL LLSurface::generateWaterTexture(const F32 x, const F32 y, const F32 width, const F32 height) { - if (!getWaterTexture()) + if (!getWaterTexture() || !mWaterTexturep->hasGLTexture()) { return FALSE; } |