added checks for valid pointers after locking

This commit is contained in:
Thomas Fischer 2013-06-30 17:51:38 +02:00
parent 95ef5ec226
commit 53abbe066d
13 changed files with 39 additions and 10 deletions

View file

@ -1727,6 +1727,7 @@ void Precipitation::renderObject(ObjectRenderInst *ri, SceneRenderState *state,
// Do we need to relock the buffer?
if ( !vertPtr )
vertPtr = mRainVB.lock();
if(!vertPtr) return;
// Set the proper texture coords... (it's fun!)
tc = &mTexCoords[4*curr->texCoordIndex];
@ -1817,6 +1818,7 @@ void Precipitation::renderObject(ObjectRenderInst *ri, SceneRenderState *state,
// Do we need to relock the buffer?
if ( !vertPtr )
vertPtr = mRainVB.lock();
if(!vertPtr) return;
vertPtr->point = pos + leftUp;
vertPtr->texCoord = *tc;