Manual LOD mesh not found: FNFexception instead of assert

Minor issues with the Ogre API that can be trivial to fix
Posts: 287
Joined: Mon Dec 08, 2008 4:49 pm

Manual LOD mesh not found: FNFexception instead of assert

Postby jonim8or » Wed Sep 28, 2011 10:12 am

I'm using manual LOD's for my meshes. Now that I am re-organizing my resources, I found out that if the path to the lower LOD meshes is not correct, an assertion fails. (due to an Ogre::SharedPtr that's being used while NULL)
The problem with assertion failures is that you can't catch them the way you catch exceptions. I suggest the following lines (175+) in OgreEntity.cpp to add a check for validity of the LOD mesh:

Code: Select all

   // Check if mesh is using manual LOD
      if (mMesh->isLodManual())
         ushort i, numLod;
         numLod = mMesh->getNumLodLevels();
         // NB skip LOD 0 which is the original
         for (i = 1; i < numLod; ++i)
            const MeshLodUsage& usage = mMesh->getLodLevel(i);
                           "ManualLOD file " + usage.manualName + " not found",
               // Manually create entity
               Entity* lodEnt = OGRE_NEW Entity(mName + "Lod" + StringConverter::toString(i),
0 x

Return to “Papercuts”

Who is online

Users browsing this forum: No registered users and 1 guest