summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 16:45:13 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2007-01-14 16:45:13 +0000
commitd1395845cdc678db2a71326f2e6f20253ed14cac (patch)
tree9a75fe0591fc7bd74f828aa048aa027f59a4ae66 /src/game.cpp
parent6c3a2550813c14290307f2ad91e1d76eea3e6a02 (diff)
downloadmana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.gz
mana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.bz2
mana-d1395845cdc678db2a71326f2e6f20253ed14cac.tar.xz
mana-d1395845cdc678db2a71326f2e6f20253ed14cac.zip
Merged 0.0 changes from revision 2988 to 3035 to trunk.
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 2af13146..40d78248 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -124,9 +124,11 @@ const int MAX_TIME = 10000;
* Listener used for exitting handling.
*/
namespace {
- struct ExitListener : public gcn::ActionListener {
- void action(const std::string &eventId, gcn::Widget *widget) {
- if (eventId == "yes") {
+ struct ExitListener : public gcn::ActionListener
+ {
+ void action(const gcn::ActionEvent &event)
+ {
+ if (event.getId() == "yes") {
done = true;
}
exitConfirm = NULL;
@@ -386,10 +388,6 @@ void Game::logic()
void Game::handleInput()
{
- // Get the state of the keyboard keys
- Uint8* keys;
- keys = SDL_GetKeyState(NULL);
-
if (joystick != NULL)
{
joystick->update();
@@ -455,7 +453,7 @@ void Game::handleInput()
// Close the config window, cancelling changes if opened
else if (setupWindow->isVisible())
{
- setupWindow->action("cancel", NULL);
+ setupWindow->action(gcn::ActionEvent(NULL, "cancel"));
}
// Else, open the chat edit box
else
@@ -633,7 +631,12 @@ void Game::handleInput()
current_npc == 0 &&
!chatWindow->isFocused())
{
+ // Get the state of the keyboard keys
+ Uint8* keys;
+ keys = SDL_GetKeyState(NULL);
+
Uint16 x = player_node->mX / 32, y = player_node->mY / 32;
+
unsigned char direction = 0;
// Translate pressed keys to movement and direction