Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
Dec 20, 2004, 12:27:51 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: world fixed (still unstable)

File:
1 edited

Legend:

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

    r3220 r3226  
    4747Orxonox::~Orxonox ()
    4848{
    49   Orxonox::singleton_ref = NULL;
     49  Orxonox::singletonRef = NULL;
    5050  if( world != NULL) delete world;
    5151  if( localinput != NULL) delete world;
     
    5656
    5757/* this is a singleton class to prevent duplicates */
    58 Orxonox* Orxonox::singleton_ref = 0;
     58Orxonox* Orxonox::singletonRef = 0;
    5959
    6060Orxonox* Orxonox::getInstance (void)
    6161{
    62   if (singleton_ref == NULL)
    63     singleton_ref = new Orxonox();
    64   return singleton_ref;
     62  if (singletonRef == NULL)
     63    singletonRef = new Orxonox();
     64  return singletonRef;
    6565}
    6666
     
    7272   it's path and name into configfilename
    7373*/
    74 void Orxonox::get_config_file (int argc, char** argv)
     74void Orxonox::getConfigFile (int argc, char** argv)
    7575{
    7676  strcpy (configfilename, "orxonox.conf");
     
    8585  // config file
    8686 
    87   get_config_file (argc, argv);
     87  getConfigFile (argc, argv);
    8888  SDL_Init (SDL_INIT_TIMER);
    8989  // initialize everything
    90   if( init_video () == -1) return -1;
    91   if( init_sound () == -1) return -1;
     90  if( initVideo() == -1) return -1;
     91  if( initSound() == -1) return -1;
    9292  printf("> Initializing input\n");
    93   if( init_input () == -1) return -1;
     93  if( initInput() == -1) return -1;
    9494  printf("> Initializing networking\n");
    95   if( init_networking () == -1) return -1;
     95  if( initNetworking () == -1) return -1;
    9696  printf("> Initializing resources\n");
    97   if( init_resources () == -1) return -1;
     97  if( initResources () == -1) return -1;
    9898  //printf("> Initializing world\n");
    9999  //if( init_world () == -1) return -1; PB: world will be initialized when started
     
    105105   \brief initializes SDL and OpenGL
    106106*/
    107 int Orxonox::init_video ()
     107int Orxonox::initVideo()
    108108{
    109109  printf("> Initializing video\n");
    110   if (SDL_Init (SDL_INIT_VIDEO) == -1)
     110  if (SDL_Init(SDL_INIT_VIDEO) == -1)
    111111    {
    112112      printf ("could not initialize SDL Video\n");
     
    115115  // Set video mode
    116116  // TO DO: parse arguments for settings
    117   SDL_GL_SetAttribute (SDL_GL_RED_SIZE, 5);
    118   SDL_GL_SetAttribute (SDL_GL_GREEN_SIZE, 5);
    119   SDL_GL_SetAttribute (SDL_GL_BLUE_SIZE, 5);
    120   SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16);
     117  SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
     118  SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
     119  SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
     120  SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16);
    121121 
    122122  int bpp = 16;
     
    125125  Uint32 flags = SDL_HWSURFACE | SDL_OPENGL | SDL_GL_DOUBLEBUFFER;
    126126 
    127   if( (screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
     127  if((screen = SDL_SetVideoMode (width, height, bpp, flags)) == NULL)
    128128  {
    129     printf ("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
     129    printf("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", width, height, bpp, flags, SDL_GetError());
    130130    SDL_Quit();
    131131    return -1;
     
    133133 
    134134  // Set window labeling
    135   SDL_WM_SetCaption( "Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);
     135  SDL_WM_SetCaption("Orxonox " PACKAGE_VERSION, "Orxonox " PACKAGE_VERSION);
    136136 
    137137  // TO DO: Create a cool icon and use it here
     
    169169   \brief initializes the sound engine
    170170*/
    171 int Orxonox::init_sound ()
     171int Orxonox::initSound()
    172172{
    173173  printf("> Initializing sound\n");
    174   // SDL_Init (SDL_INIT_AUDIO);
     174  // SDL_Init(SDL_INIT_AUDIO);
    175175  printf("Not yet implemented\n");
    176176  return 0;
     
    181181   \brief initializes input functions
    182182*/
    183 int Orxonox::init_input ()
     183int Orxonox::initInput()
    184184{
    185185  // create localinput
     
    193193   \brief initializes network system
    194194*/
    195 int Orxonox::init_networking ()
     195int Orxonox::initNetworking()
    196196{
    197197  printf("Not yet implemented\n");
     
    203203   \brief initializes and loads resource files
    204204*/
    205 int Orxonox::init_resources ()
     205int Orxonox::initResources()
    206206{
    207207  printf("Not yet implemented\n");
     
    213213   \brief initializes the world
    214214*/
    215 int Orxonox::init_world ()
     215int Orxonox::initWorld()
    216216{
    217217  //world = new World();
     
    256256   \param event: an event not handled by the CommandNode
    257257*/
    258 void Orxonox::event_handler (SDL_Event* event)
     258void Orxonox::eventHandler(SDL_Event* event)
    259259{
    260260  // Handle special events such as reshape, quit, focus changes
     
    267267   \return true if the command was handled by the system or false if it may be passed to the WorldEntities
    268268*/
    269 bool Orxonox::system_command (Command* cmd)
     269bool Orxonox::systemCommand(Command* cmd)
    270270{
    271271  /*
     
    285285   \return a pointer to localcamera
    286286*/
    287 Camera* Orxonox::get_camera ()
     287Camera* Orxonox::getCamera()
    288288{
    289289  return localcamera;
     
    295295   \return a pointer to localinput
    296296*/
    297 CommandNode* Orxonox::get_localinput ()
     297CommandNode* Orxonox::getLocalInput()
    298298{
    299299  return localinput;
     
    305305   \return a pointer to world
    306306*/
    307 World* Orxonox::get_world ()
     307World* Orxonox::getWorld()
    308308{
    309309  return world;
     
    313313
    314314
    315 int main (int argc, char** argv)
     315int main(int argc, char** argv)
    316316
    317317  printf(">>> Starting Orxonox <<<\n");
    318318  Orxonox *orx = Orxonox::getInstance();
    319319 
    320   if( (*orx).init(argc, argv) == -1)
     320  if((*orx).init(argc, argv) == -1)
    321321    {
    322322      printf("! Orxonox initialization failed\n");
Note: See TracChangeset for help on using the changeset viewer.