Game Development Community

Bug in atlasResourceInfo.h

by Claude-Alain Fournier · in Torque Game Engine Advanced · 08/11/2005 (12:21 am) · 3 replies

Don't know if this is a bug ?

Found this in atlasResourceInfo.h :

struct AtlasResourceInfo
{
...
       inline void clear()
      {
      [b]   min = S16_MAX;
         max = S16_MIN;[/b]
      }

      bool read(Stream *s)
      {
         s->read(&min);
         s->read(&max);

         AssertFatal([b]max >= min[/b], "ChunkGeomInfo::ColNode::read - invalid min/max!");

         return true;
      }
...
}


The read assert fail everytime when running debug mode.

#1
08/11/2005 (4:36 am)
It looks correct to me

the function clear sets the min/max variables to a value that will always fail in a "max >= min" comparison ... then in another function it reads values from file and after that checks if these values are valid now ... if he couldnt read correctly we would still have the invalid values from clear and the assert will kick in.
#2
08/11/2005 (7:01 am)
It's correct. Florian's analysis is accurate.
#3
08/16/2005 (4:24 am)
Thanks. I was not sure.