Game Development Community

MatInstance::setupPass() bug restoring cull mode

by Tom Spilman · in Torque Game Engine Advanced · 11/20/2006 (6:20 pm) · 1 replies

In MatInstance::setupPass() a simple bug keeps the cull mode from being properly restored in MatInstance::cleanup()....

if( mCurPass == 0 )
   {
      setTextureTransforms();

      if( mMaterial->doubleSided )
      {
         GFX->setCullMode( GFXCullNone );
         mCullMode = GFX->getCullMode(); // THIS SHOULD BE BEFORE THE SET!
      }
   }

   return true;
}

About the author

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