Game Development Community

ShapeBase::renderImage crash bug

by Tom Spilman · in Torque Game Engine Advanced · 06/10/2006 (4:17 am) · 3 replies

Pretty simple one. In the change of ShapeBase::renderImage from GL to GFX, you missed the check for a null mShapeInstance. Should look like this...

void ShapeBase::renderImage(SceneState* state, SceneRenderImage* image)
{
   if ( !mShapeInstance )
     return;

   GFX->pushWorldMatrix();

   MatrixF mat = getRenderTransform();
   mat.scale( mObjScale );
   GFX->setWorldMatrix( mat );

   mShapeInstance->animate();
   mShapeInstance->render();

   GFX->popWorldMatrix();
}

This was needed when GameBase::gShowBoundingBox is enabled as it forces render images on shapes like cameras which have no shape instance.

About the author

Tom is a programmer and co-owner of Sickhead Games, LLC.


#1
07/10/2006 (9:45 am)
Thanks, Tom - noted this in the list.
#2
07/10/2006 (3:19 pm)
Uhh, yeah fixed with MS 3.5 - this function no longer exists ;)
#3
07/22/2006 (3:43 pm)
Edit: figured it out :)