From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/client/keyboard.cc | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/client/keyboard.cc') diff --git a/src/client/keyboard.cc b/src/client/keyboard.cc index 23e6634..bf08db1 100644 --- a/src/client/keyboard.cc +++ b/src/client/keyboard.cc @@ -31,7 +31,7 @@ Keyboard::Keyboard() // ------------------ ACTIONS // FIXME actions should be state keys and not use key repeat - + add_action("+left", Action::None, "rotate left"); add_action("+right", Action::None, "rotate right"); add_action("+up", Action::None, "rotate up"); @@ -253,12 +253,12 @@ Keyboard::~Keyboard() { // clear key map for (iterator it = begin(); it != end(); it++) - delete (*it).second; + delete(*it).second; keys.clear(); - + // clear action list - for(std::list::iterator ait = actions.begin(); ait != actions.end(); ait++) - delete (*ait); + for (std::list::iterator ait = actions.begin(); ait != actions.end(); ait++) + delete(*ait); actions.clear(); } @@ -317,7 +317,7 @@ void Keyboard::load_binds() con_print << " reading keyboard binds from " << filename << std::endl; char line[MAXCMDSIZE]; - while (ifs.getline(line, MAXCMDSIZE-1)) { + while (ifs.getline(line, MAXCMDSIZE - 1)) { if (line[0] && line[0] != '#' && line[0] != ';') core::cmd() << line << '\n'; } @@ -383,7 +383,7 @@ void Keyboard::bind(std::string const &name, const std::string str) { Key::Modifier modifier = Key::None; std::string keyname(name); - + if ((keyname.size() > 6) && (keyname.substr(0, 6).compare("shift+") == 0)) { keyname.erase(0, 6); modifier = Key::Shift; @@ -393,7 +393,7 @@ void Keyboard::bind(std::string const &name, const std::string str) } else if ((keyname.size() > 4) && (keyname.substr(0, 4).compare("alt+") == 0)) { keyname.erase(0, 4); modifier = Key::Alt; - + } else if ((keyname.size() > 6) && (keyname.substr(keyname.size() - 6, 6).compare("+shift") == 0)) { keyname.erase(keyname.size() - 6, 6); modifier = Key::Shift; @@ -401,10 +401,10 @@ void Keyboard::bind(std::string const &name, const std::string str) keyname.erase(keyname.size() - 5, 5); modifier = Key::Ctrl; } else if ((keyname.size() > 4) && (keyname.substr(keyname.size() - 4, 4).compare("+alt") == 0)) { - keyname.erase(0, keyname.size() -46); + keyname.erase(0, keyname.size() - 46); modifier = Key::Alt; } - + Key *key = find(keyname); if (key) { if (str.size()) @@ -425,10 +425,10 @@ void Keyboard::bind(std::string const &name, const std::string str) } void Keyboard::unbind(std::string const &name) -{ +{ Key::Modifier modifier = Key::None; std::string keyname(name); - + if ((keyname.size() > 6) && (keyname.substr(0, 6).compare("shift+") == 0)) { keyname.erase(0, 6); modifier = Key::Shift; @@ -438,7 +438,7 @@ void Keyboard::unbind(std::string const &name) } else if ((keyname.size() > 4) && (keyname.substr(0, 4).compare("alt+") == 0)) { keyname.erase(0, 4); modifier = Key::Alt; - + } else if ((keyname.size() > 6) && (keyname.substr(keyname.size() - 6, 6).compare("+shift") == 0)) { keyname.erase(keyname.size() - 6, 6); modifier = Key::Shift; @@ -446,7 +446,7 @@ void Keyboard::unbind(std::string const &name) keyname.erase(keyname.size() - 5, 5); modifier = Key::Ctrl; } else if ((keyname.size() > 4) && (keyname.substr(keyname.size() - 4, 4).compare("+alt") == 0)) { - keyname.erase(0, keyname.size() -46); + keyname.erase(0, keyname.size() - 46); modifier = Key::Alt; } @@ -498,7 +498,7 @@ void Keyboard::list_keys() void Keyboard::list_binds() { - size_t n =0; + size_t n = 0; for (iterator it = begin(); it != end(); it++) { if ((*it).second->bind(Key::None).size()) { con_print << " " << aux::pad_right((*it).second->name(), 6) << " " << (*it).second->bind(Key::None) << std::endl; @@ -719,7 +719,7 @@ void setkeyboardmode(bool input) SDL_EnableKeyRepeat(250, SDL_DEFAULT_REPEAT_INTERVAL); else SDL_EnableKeyRepeat(10, SDL_DEFAULT_REPEAT_INTERVAL); - + } */ } // namespace client -- cgit v1.2.3