From 0f7927ab8aadc2c6f42c70d2809b357efc4ddb2f Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sat, 19 Mar 2005 00:03:33 +0000 Subject: Added handling of window close button. --- src/being.cpp | 4 ++-- src/game.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/being.cpp b/src/being.cpp index 93496ea6..a02ad79f 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -160,12 +160,12 @@ void Being::nextStep() if (newX > oldX) { if (newY > oldY) direction = SE; else if (newY < oldY) direction = NE; - else direction = EAST; + else direction = EAST; } else if (newX < oldX) { if (newY > oldY) direction = SW; else if (newY < oldY) direction = NW; - else direction = WEST; + else direction = WEST; } else { if (newY > oldY) direction = SOUTH; diff --git a/src/game.cpp b/src/game.cpp index 2c0b4f72..e7eebbe6 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -339,8 +339,7 @@ void do_input() } } } // End key down - - if (event.type == SDL_MOUSEBUTTONDOWN) + else if (event.type == SDL_MOUSEBUTTONDOWN) { int mx = event.button.x / 32 + camera_x; int my = event.button.y / 32 + camera_y; @@ -364,6 +363,10 @@ void do_input() } } } + else if (event.type == SDL_QUIT) + { + state = EXIT; + } // Push input to GUI when not used if (!used) { -- cgit v1.2.3-70-g09d2