home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / demos / audio / drive / drive.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.9 KB  |  75 lines

  1. /*
  2.  * Copyright 1992-1993, 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #include <Inventor/SoDB.h>
  18. #include <Inventor/SbString.h>
  19. #include <stdlib.h>
  20. #include "Simulation.h"
  21.  
  22.  
  23. int main(int argc,  char *argv[])
  24. {
  25.     if (argc < 3)
  26.     {
  27.         fprintf(stderr,
  28.         "usage: %s roadfile carfile [-path datapath] [-robots num] [-quiet]\n", argv[0]);
  29.         exit(0);
  30.     }
  31.  
  32.     // initialize Inventor
  33.     SoDB::init();
  34.     
  35.     Boolean quiet = FALSE;
  36.     Boolean race = FALSE;
  37.     int num_robots = 4;
  38.     SbString path("/usr/demos/data/drive");
  39.     
  40.     if (argc >= 4)
  41.     {
  42.         SbString quiet_string("-quiet");
  43.         // SbString race_string("-race");
  44.         SbString robot_string("-robots");
  45.         SbString path_string("-path");
  46.         
  47.         for (int i = 3; i < argc; i++)
  48.         {
  49.             if ((robot_string == argv[i]) && (i != (argc - 1)))
  50.                 num_robots = atoi(argv[i+1]);
  51.             else if ((path_string == argv[i]) && (i != (argc - 1)))
  52.                 path = argv[i+1];
  53.             else
  54.             {                
  55.                 quiet = quiet || (quiet_string == argv[i]);
  56.                 // race = race || (race_string == argv[i]);
  57.             }
  58.         }
  59.     }
  60.  
  61.     SbString carfile(argv[1]);
  62.     SbString roadfile(argv[2]);
  63.  
  64.     
  65.     Simulation *simulation = 
  66.         new Simulation(carfile, roadfile, path, num_robots, quiet, race);
  67.         
  68.     simulation->go();
  69.     delete simulation;
  70.  
  71.     printf("Bye!\n");
  72.     return(0);
  73. }
  74.  
  75.