git repos / blockattack-game

commit 38c615f9

sago007 · 2016-01-27 17:26
38c615f979029da28a7a70d22c2e973b149e5e6b patch · browse files
parent c54116f34fbd35eec3a940519520611a619df1bd

The close button does now work in the level select screen

Changed files

M source/code/main.cpp before
M source/code/mainVars.hpp before
diff --git a/source/code/main.cpp b/source/code/main.cpp index 3d8c0d7..b057ffe 100644 --- a/source/code/main.cpp +++ b/source/code/main.cpp
@@ -1562,7 +1562,12 @@ int PuzzleLevelSelect(int Type) {
}
SDL_Event event;
- while ( SDL_PollEvent(&event) )
+ while ( SDL_PollEvent(&event) ) {
+ if ( event.type == SDL_QUIT ) {
+ Config::getInstance()->setShuttingDown(5);
+ levelNr = -1;
+ levelSelected = true;
+ }
if ( event.type == SDL_KEYDOWN ) {
if ( event.key.keysym.sym == SDLK_ESCAPE ) {
levelNr = -1;
@@ -1597,6 +1602,7 @@ int PuzzleLevelSelect(int Type) {
}
}
}
+ }
SDL_GetKeyboardState(nullptr);
diff --git a/source/code/mainVars.hpp b/source/code/mainVars.hpp index a35598e..6de66d1 100644 --- a/source/code/mainVars.hpp +++ b/source/code/mainVars.hpp
@@ -197,8 +197,6 @@ std::string player2name;
bool twoPlayers; //True if two players are playing
-//Old mouse position:
-static int oldMousex, oldMousey;
//Old Stage Clear Buble
static int oldBubleX, oldBubleY;