Changeset 3225 in orxonox.OLD for orxonox/trunk/src/command_node.cc
- Timestamp:
- Dec 20, 2004, 12:23:58 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/command_node.cc
r3221 r3225 108 108 \param filename: The path and name of the file to load the bindings from 109 109 */ 110 void CommandNode::load _bindings (char* filename)110 void CommandNode::loadBindings (char* filename) 111 111 { 112 112 FILE* stream; … … 125 125 // create parser 126 126 IniParser parser (filename); 127 if( parser.get _section ("Bindings") == -1)127 if( parser.getSection ("Bindings") == -1) 128 128 { 129 129 printf("Could not find key bindings in %s\n", filename); … … 145 145 { 146 146 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); 148 148 strcpy (aliases->keys[index[1]], valuebuf); 149 149 break; 150 150 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); 152 152 strcpy (aliases->buttons[index[1]], valuebuf); 153 153 break; … … 166 166 void CommandNode::bind (WorldEntity* entity) 167 167 { 168 bound->add (entity);168 bound->add (entity); 169 169 } 170 170 … … 175 175 void CommandNode::unbind (WorldEntity* entity) 176 176 { 177 bound->remove (entity);178 } 179 180 int* CommandNode::name _to_index (char* name)177 bound->remove (entity); 178 } 179 180 int* CommandNode::nameToIndex (char* name) 181 181 { 182 182 coord[0] = -1; 183 183 coord[1] = -1; 184 184 int c; 185 if( (c = keyname _to_SDLK (name)) != -1)185 if( (c = keynameToSDLK (name)) != -1) 186 186 { 187 187 coord[1] = c; 188 188 coord[0] = 0; 189 189 } 190 if( (c = buttonname _to_SDLB (name)) != -1)190 if( (c = buttonnameToSDLB (name)) != -1) 191 191 { 192 192 coord[1] = c; … … 203 203 if( this->bEnabled) 204 204 { 205 if( bLocalInput) process _local ();206 else process _network ();205 if( bLocalInput) processLocal (); 206 else processNetwork (); 207 207 } 208 208 } … … 220 220 strcpy (cmd.cmd, aliases->keys[event.key.keysym.sym]); 221 221 cmd.bUp = false; 222 if( strlen (cmd.cmd) > 0) relay 222 if( strlen (cmd.cmd) > 0) relay(&cmd); 223 223 break; 224 224 case SDL_KEYUP: 225 225 strcpy( cmd.cmd, aliases->keys[event.key.keysym.sym]); 226 226 cmd.bUp = true; 227 if( strlen (cmd.cmd) > 0) relay 227 if( strlen (cmd.cmd) > 0) relay(&cmd); 228 228 break; 229 229 case SDL_MOUSEMOTION: … … 237 237 strcpy( cmd.cmd, aliases->buttons[event.button.button]); 238 238 cmd.bUp = true; 239 if( strlen (cmd.cmd) > 0) relay 239 if( strlen (cmd.cmd) > 0) relay(&cmd); 240 240 break; 241 241 case SDL_MOUSEBUTTONDOWN: 242 242 strcpy( cmd.cmd, aliases->buttons[event.button.button]); 243 243 cmd.bUp = false; 244 if( strlen (cmd.cmd) > 0) relay 244 if( strlen (cmd.cmd) > 0) relay(&cmd); 245 245 break; 246 246 case SDL_JOYAXISMOTION: … … 252 252 default: 253 253 Orxonox *orx = Orxonox::getInstance(); 254 orx->event _handler(&event);254 orx->eventHandler(&event); 255 255 break; 256 256 } … … 259 259 260 260 261 void CommandNode::process _network ()261 void CommandNode::processNetwork () 262 262 { 263 263 … … 269 269 270 270 Orxonox *orx = Orxonox::getInstance(); 271 if( orx->system _command (cmd)) return;271 if( orx->systemCommand (cmd)) return; 272 272 273 273 GameLoader* gl = GameLoader::getInstance(); 274 274 if( gl->worldCommand(cmd)) return; 275 275 276 if( bLocalInput) send _over_network (cmd);276 if( bLocalInput) sendOverNetwork (cmd); 277 277 278 278 if( this->world->command(cmd)) return; … … 291 291 \param ID: the new ID to use 292 292 */ 293 void CommandNode::set _netID (int ID)293 void CommandNode::setNetID (int ID) 294 294 { 295 295 netID = ID; 296 296 } 297 297 298 void CommandNode::send _over_network (Command* cmd)299 { 300 } 298 void CommandNode::sendOverNetwork (Command* cmd) 299 { 300 }
Note: See TracChangeset
for help on using the changeset viewer.