Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2852 in orxonox.OLD for orxonox/trunk/importer


Ignore:
Timestamp:
Nov 14, 2004, 6:25:32 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: better checking of objectCount

Location:
orxonox/trunk/importer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/object.cc

    r2851 r2852  
    151151   \brief Draws the Object number groupNumber
    152152   It does this by just calling the List that must have been created earlier.
    153    \param groupNumber The number of the Group that will be displayed.
     153   \param groupNumber The number of the group that will be displayed.
    154154*/
    155155void Object::draw (int groupNumber)
    156156{
     157  if (groupNumber >= groupCount)
     158    {
     159      if (verbose>=2)
     160        printf ("You requested object number %i, but this File only contains of %i Objects.\n", groupNumber-1, groupCount);
     161      return;
     162    }
    157163  if (verbose >=2)
    158164    printf("drawing the requested 3D-Objects if found.\n");
     
    176182
    177183}
     184
     185/**
     186   \brief Draws the Object with a specific groupname
     187   It does this by just calling the List that must have been created earlier.
     188   \param groupName The name of the group that will be displayed.
     189*/
    178190void Object::draw (char* groupName)
    179191{
     
    197209}
    198210
     211/**
     212   \returns Count of the Objects in this File
     213*/
     214int Object::getGroupCount (void)
     215{
     216  return groupCount;
     217}
    199218
    200219/**
  • orxonox/trunk/importer/object.h

    r2851 r2852  
    3434  void draw (int groupNumber);
    3535  void draw (char* groupName);
     36  int getGroupCount();
    3637
    3738 private:
Note: See TracChangeset for help on using the changeset viewer.