From a6978e254af2a83b2b52778b4c59828b07542e5b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 26 Mar 2012 20:58:09 +0300 Subject: Fix code style and auto check issues. --- src/actionmanager.h | 2 -- src/depricatedevent.cpp | 12 ++++++++---- src/game.cpp | 3 --- src/inputevent.h | 2 ++ src/keyboardconfig.h | 5 +++-- src/keyboarddata.h | 13 +++++++++++++ 6 files changed, 26 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/actionmanager.h b/src/actionmanager.h index f0dcb9d77..05d84b989 100644 --- a/src/actionmanager.h +++ b/src/actionmanager.h @@ -109,6 +109,4 @@ namespace ActionManager decHandler(didYouKnowWindowShow); } -typedef bool (*ActionFuncPtr) (InputEvent &event); - #endif diff --git a/src/depricatedevent.cpp b/src/depricatedevent.cpp index 965876fd1..0d5ffca7b 100644 --- a/src/depricatedevent.cpp +++ b/src/depricatedevent.cpp @@ -39,7 +39,8 @@ DepricatedEvent::~DepricatedEvent() } } -void DepricatedEvent::setInt(const std::string &key, int value) throw (BadDepricatedEvent) +void DepricatedEvent::setInt(const std::string &key, int value) + throw (BadDepricatedEvent) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -47,7 +48,8 @@ void DepricatedEvent::setInt(const std::string &key, int value) throw (BadDepric mData[key] = new IntData(value); } -int DepricatedEvent::getInt(const std::string &key) const throw (BadDepricatedEvent) +int DepricatedEvent::getInt(const std::string &key) const + throw (BadDepricatedEvent) { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) @@ -82,7 +84,8 @@ const std::string &DepricatedEvent::getString(const std::string &key) } -void DepricatedEvent::setFloat(const std::string &key, double value) throw (BadDepricatedEvent) +void DepricatedEvent::setFloat(const std::string &key, double value) + throw (BadDepricatedEvent) { if (mData.find(key) != mData.end()) throw KEY_ALREADY_EXISTS; @@ -90,7 +93,8 @@ void DepricatedEvent::setFloat(const std::string &key, double value) throw (BadD mData[key] = new FloatData(value); } -double DepricatedEvent::getFloat(const std::string &key) const throw (BadDepricatedEvent) +double DepricatedEvent::getFloat(const std::string &key) const + throw (BadDepricatedEvent) { VariableMap::const_iterator it = mData.find(key); if (it == mData.end()) diff --git a/src/game.cpp b/src/game.cpp index 487f55f35..b17646730 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -950,7 +950,6 @@ void Game::handleInput() if (joystick) joystick->update(); - bool wasDown(false); // Events SDL_Event event; while (SDL_PollEvent(&event)) @@ -968,8 +967,6 @@ void Game::handleInput() // Keyboard events (for discontinuous keys) else if (event.type == SDL_KEYDOWN) { - wasDown = true; - if (setupWindow && setupWindow->isVisible() && keyboard.getNewKeyIndex() > keyboard.KEY_NO_VALUE) { diff --git a/src/inputevent.h b/src/inputevent.h index 7b73bba11..056a14e90 100644 --- a/src/inputevent.h +++ b/src/inputevent.h @@ -30,4 +30,6 @@ struct InputEvent int mask; }; +typedef bool (*ActionFuncPtr) (InputEvent &event); + #endif diff --git a/src/keyboardconfig.h b/src/keyboardconfig.h index a7542f17c..7efe5a16a 100644 --- a/src/keyboardconfig.h +++ b/src/keyboardconfig.h @@ -26,11 +26,12 @@ #include #include +#include "inputevent.h" + +#include #include #include -#include "actionmanager.h" - union SDL_Event; typedef std::vector KeysVector; diff --git a/src/keyboarddata.h b/src/keyboarddata.h index 78a6e990a..bfb0dbed1 100644 --- a/src/keyboarddata.h +++ b/src/keyboarddata.h @@ -20,7 +20,18 @@ * along with this program. If not, see . */ +#ifndef KEYBOARDDATA_H +#define KEYBOARDDATA_H + +#include "actionmanager.h" +#include "inputmanager.h" +#include "keyboardconfig.h" +#include "localconsts.h" + #include "utils/gettext.h" +#include "utils/stringutils.h" + +#include struct KeyData { @@ -1003,3 +1014,5 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { KeyboardConfig::KEY_NO_VALUE, 50, COND_DEFAULT} }; + +#endif -- cgit v1.2.3-60-g2f50