Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3225 in orxonox.OLD for orxonox/trunk/src/command_node.cc


Ignore:
Timestamp:
Dec 20, 2004, 12:23:58 AM (19 years ago)
Author:
patrick
Message:

/orxonox/trunk: unstable - added many comments and now redefinit all function/variable names with underline

File:
1 edited

Legend:

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

    r3221 r3225  
    108108   \param filename: The path and name of the file to load the bindings from
    109109*/
    110 void CommandNode::load_bindings (char* filename)
     110void CommandNode::loadBindings (char* filename)
    111111{
    112112  FILE* stream;
     
    125125  // create parser
    126126  IniParser parser (filename);
    127   if( parser.get_section ("Bindings") == -1)
     127  if( parser.getSection ("Bindings") == -1)
    128128    {
    129129      printf("Could not find key bindings in %s\n", filename);
     
    145145        {
    146146        case 0:
    147           printf("Key binding %d(%s) set to %s\n", index[1], SDLK_to_keyname( index[1]), valuebuf);
     147          printf("Key binding %d(%s) set to %s\n", index[1], SDLKToKeyname( index[1]), valuebuf);
    148148          strcpy (aliases->keys[index[1]], valuebuf);
    149149          break;
    150150        case 1:
    151           printf("Button binding %d(%s) set to %s\n", index[1], SDLB_to_buttonname( index[1]), valuebuf);
     151          printf("Button binding %d(%s) set to %s\n", index[1], SDLBToButtonname( index[1]), valuebuf);
    152152          strcpy (aliases->buttons[index[1]], valuebuf);
    153153          break;
     
    166166void CommandNode::bind (WorldEntity* entity)
    167167{
    168   bound->add(entity);
     168  bound->add (entity);
    169169}
    170170
     
    175175void CommandNode::unbind (WorldEntity* entity)
    176176{
    177   bound->remove(entity);
    178 }
    179 
    180 int* CommandNode::name_to_index (char* name)
     177  bound->remove (entity);
     178}
     179
     180int* CommandNode::nameToIndex (char* name)
    181181{
    182182  coord[0] = -1;
    183183  coord[1] = -1;
    184184  int c;
    185   if( (c = keyname_to_SDLK (name)) != -1)
     185  if( (c = keynameToSDLK (name)) != -1)
    186186    {
    187187      coord[1] = c;
    188188      coord[0] = 0;
    189189    }
    190   if( (c = buttonname_to_SDLB (name)) != -1)
     190  if( (c = buttonnameToSDLB (name)) != -1)
    191191    {
    192192      coord[1] = c;
     
    203203  if( this->bEnabled)
    204204    {
    205       if( bLocalInput) process_local ();
    206       else process_network ();
     205      if( bLocalInput) processLocal ();
     206      else processNetwork ();
    207207    }
    208208}
     
    220220          strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]);
    221221          cmd.bUp = false;
    222           if( strlen (cmd.cmd) > 0) relay (&cmd);
     222          if( strlen (cmd.cmd) > 0) relay(&cmd);
    223223          break;
    224224        case SDL_KEYUP:
    225225          strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]);
    226226          cmd.bUp = true;
    227           if( strlen (cmd.cmd) > 0) relay (&cmd);
     227          if( strlen (cmd.cmd) > 0) relay(&cmd);
    228228          break;
    229229        case SDL_MOUSEMOTION:
     
    237237          strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    238238          cmd.bUp = true;
    239           if( strlen (cmd.cmd) > 0) relay (&cmd);
     239          if( strlen (cmd.cmd) > 0) relay(&cmd);
    240240          break;
    241241        case SDL_MOUSEBUTTONDOWN:
    242242          strcpy( cmd.cmd, aliases->buttons[event.button.button]);
    243243          cmd.bUp = false;
    244           if( strlen (cmd.cmd) > 0) relay (&cmd);
     244          if( strlen (cmd.cmd) > 0) relay(&cmd);
    245245          break;
    246246        case SDL_JOYAXISMOTION:
     
    252252        default:
    253253          Orxonox *orx = Orxonox::getInstance();
    254           orx->event_handler (&event);
     254          orx->eventHandler(&event);
    255255          break;
    256256        }
     
    259259
    260260
    261 void CommandNode::process_network ()
     261void CommandNode::processNetwork ()
    262262{
    263263
     
    269269
    270270  Orxonox *orx = Orxonox::getInstance();
    271   if( orx->system_command (cmd)) return;
     271  if( orx->systemCommand (cmd)) return;
    272272
    273273  GameLoader* gl = GameLoader::getInstance();
    274274  if( gl->worldCommand(cmd)) return;
    275275
    276   if( bLocalInput) send_over_network (cmd);
     276  if( bLocalInput) sendOverNetwork (cmd);
    277277 
    278278  if( this->world->command(cmd)) return;
     
    291291   \param ID: the new ID to use
    292292*/
    293 void CommandNode::set_netID (int ID)
     293void CommandNode::setNetID (int ID)
    294294{
    295295  netID = ID;
    296296}
    297297
    298 void CommandNode::send_over_network (Command* cmd)
    299 {
    300 }
     298void CommandNode::sendOverNetwork (Command* cmd)
     299{
     300}
Note: See TracChangeset for help on using the changeset viewer.