Merge pull request #424 from tdev/lock-checking

Added checks for valid pointers after locking
This commit is contained in:
SilentMike 2013-08-11 22:14:16 -07:00
commit 77bd934167
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;