mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-20 03:45:26 +00:00
added checks for valid pointers after locking
This commit is contained in:
parent
95ef5ec226
commit
53abbe066d
13 changed files with 39 additions and 10 deletions
|
|
@ -190,7 +190,8 @@ void CameraSpline::renderTimeMap()
|
|||
// Build vertex buffer
|
||||
GFXVertexBufferHandle<GFXVertexPC> vb;
|
||||
vb.set(GFX, mTimeMap.size(), GFXBufferTypeVolatile);
|
||||
vb.lock();
|
||||
void *ptr = vb.lock();
|
||||
if(!ptr) return;
|
||||
|
||||
MRandomLCG random(1376312589 * (U32)this);
|
||||
int index = 0;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue