Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4556 in orxonox.OLD for orxonox/trunk/src/orxonox.cc


Ignore:
Timestamp:
Jun 8, 2005, 2:35:10 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: style

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/orxonox.cc

    r4504 r4556  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    1616   You should have received a copy of the GNU General Public License
    1717   along with this program; if not, write to the Free Software Foundation,
    18    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 
     18   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    1919
    2020
     
    6868   \brief remove Orxonox from memory
    6969*/
    70 Orxonox::~Orxonox () 
     70Orxonox::~Orxonox ()
    7171{
    7272  int i =0;
     
    9696/**
    9797   \brief this finds the config file
    98    
     98
    9999   Since the config file varies from user to user and since one may want to specify different config files
    100100   for certain occasions or platforms this function finds the right config file for every occasion and stores
     
    115115  // parse command line
    116116  // config file
    117  
     117
    118118  getConfigFile (argc, argv);
    119119  SDL_Init (SDL_INIT_TIMER);
     
    130130  //printf("> Initializing world\n");
    131131  //if( init_world () == -1) return -1; PB: world will be initialized when started
    132  
     132
    133133  return 0;
    134134}
     
    137137   \brief initializes SDL and OpenGL
    138138*/
    139 int Orxonox::initVideo() 
     139int Orxonox::initVideo()
    140140{
    141141  PRINTF(3)("> Initializing video\n");
    142  
     142
    143143  GraphicsEngine::getInstance();
    144    
     144
    145145  return 0;
    146146}
     
    150150   \brief initializes the sound engine
    151151*/
    152 int Orxonox::initSound() 
     152int Orxonox::initSound()
    153153{
    154154  PRINT(3)("> Initializing sound\n");
     
    162162   \brief initializes input functions
    163163*/
    164 int Orxonox::initInput() 
     164int Orxonox::initInput()
    165165{
    166166  this->eventHandler = EventHandler::getInstance();
    167167  this->eventHandler->init();
    168  
     168
    169169  return 0;
    170170}
     
    174174   \brief initializes network system
    175175*/
    176 int Orxonox::initNetworking() 
     176int Orxonox::initNetworking()
    177177{
    178178  printf("Not yet implemented\n");
     
    184184   \brief initializes and loads resource files
    185185*/
    186 int Orxonox::initResources() 
     186int Orxonox::initResources()
    187187{
    188188  PRINT(3)("initializing ResourceManager\n");
     
    200200  memset (namebuf, 0, 256);
    201201  memset (valuebuf, 0, 256);
    202  
     202
    203203  while( parser.nextVar (namebuf, valuebuf) != -1)
    204204    {
    205205      if (!strcmp(namebuf, CONFIG_NAME_DATADIR))
    206         {
    207           //  printf("Not yet implemented\n");
    208           if (!resourceManager->setDataDir(valuebuf))
    209             {
    210               PRINTF(1)("Data Could not be located\n");
    211               exit(-1);
    212             }
    213         }
    214      
     206        {
     207          //  printf("Not yet implemented\n");
     208          if (!resourceManager->setDataDir(valuebuf))
     209            {
     210              PRINTF(1)("Data Could not be located\n");
     211              exit(-1);
     212            }
     213        }
     214
    215215      memset (namebuf, 0, 256);
    216216      memset (valuebuf, 0, 256);
    217217    }
    218  
     218
    219219  if (!resourceManager->checkDataDir(DEFAULT_DATA_DIR_CHECKFILE))
    220220    {
    221221      PRINTF(1)("The DataDirectory %s could not be verified\nPlease Change in File %s Section %s Entry %s to a suitable value\n",
    222                 resourceManager->getDataDir(),
    223                 DEFAULT_CONFIG_FILE,
    224                 CONFIG_SECTION_DATA,
    225                 CONFIG_NAME_DATADIR);
     222                resourceManager->getDataDir(),
     223                DEFAULT_CONFIG_FILE,
     224                CONFIG_SECTION_DATA,
     225                CONFIG_NAME_DATADIR);
    226226      exit(-1);
    227227    }
     
    250250void Orxonox::start()
    251251{
    252  
     252
    253253  this->gameLoader = GameLoader::getInstance();
    254254  this->gameLoader->loadCampaign("worlds/DefaultCampaign.oxc");
     
    261261/**
    262262   \brief handles sprecial events from localinput
    263    \param event: an event not handled by the CommandNode 
     263   \param event: an event not handled by the CommandNode
    264264*/
    265265void Orxonox::graphicsHandler(SDL_Event* event)
     
    274274    }
    275275}
    276  
     276
    277277
    278278/**
     
    292292   here the journey begins
    293293*/
    294 int main(int argc, char** argv) 
    295 { 
     294int main(int argc, char** argv)
     295{
    296296
    297297  // here the pre-arguments are loaded, these are needed to go either to orxonx itself, Help, or Benchmark.
     
    333333    {
    334334      if (ResourceManager::isFile("~/.orxonox/orxonox.lock"))
    335         ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
    336      
     335        ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
     336
    337337      // starting the GUI
    338338      Gui* gui = new Gui(argc, argv);
     
    340340
    341341      if (! gui->startOrxonox)
    342         return 0;
    343      
     342        return 0;
     343
    344344      delete gui;
    345345    }
    346  
     346
    347347  PRINT(0)(">>> Starting Orxonox <<<\n");
    348348
     
    350350
    351351  Orxonox *orx = Orxonox::getInstance();
    352  
     352
    353353  if((*orx).init(argc, argv) == -1)
    354354    {
     
    356356      return -1;
    357357    }
    358  
     358
    359359  orx->start();
    360  
     360
    361361  delete orx;
    362362  ResourceManager::deleteFile("~/.orxonox/orxonox.lock");
    363  
    364 }
     363
     364}
Note: See TracChangeset for help on using the changeset viewer.