- bugfix for keydown event in intro and battle end screens (missed htis when converted to SDL keys)

This commit is contained in:
Mark Vejvoda
2011-11-21 19:00:20 +00:00
parent cf1e3509fe
commit 0dacf7b439
4 changed files with 7 additions and 7 deletions

View File

@@ -435,9 +435,9 @@ void BattleEnd::render() {
renderer.swapBuffers();
}
void BattleEnd::keyDown(char key){
void BattleEnd::keyDown(SDL_KeyboardEvent key){
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s %d]\n",__FILE__,__FUNCTION__,__LINE__);
if(key == vkEscape || key == SDLK_ESCAPE) {
if(isKeyPressed(SDLK_ESCAPE,key) == true) {
//program->setState(new MainMenu(program));
if(mainMessageBox.getEnabled()) {
@@ -448,7 +448,7 @@ void BattleEnd::keyDown(char key){
showMessageBox(lang.get("ExitGame?"), "", true);
}
}
else if(key == vkReturn && mainMessageBox.getEnabled()) {
else if(isKeyPressed(SDLK_RETURN,key) && mainMessageBox.getEnabled()) {
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
program->setState(new MainMenu(program));
}

View File

@@ -45,7 +45,7 @@ public:
virtual void update();
virtual void render();
virtual void keyDown(char key);
virtual void keyDown(SDL_KeyboardEvent key);
virtual void mouseDownLeft(int x, int y);
virtual void mouseMove(int x, int y, const MouseState *ms);
//virtual void tick();

View File

@@ -743,11 +743,11 @@ void Intro::render() {
renderer.swapBuffers();
}
void Intro::keyDown(char key){
void Intro::keyDown(SDL_KeyboardEvent key) {
mouseUpLeft(0, 0);
}
void Intro::mouseUpLeft(int x, int y){
void Intro::mouseUpLeft(int x, int y) {
SoundRenderer &soundRenderer= SoundRenderer::getInstance();
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);

View File

@@ -119,7 +119,7 @@ public:
virtual void update();
virtual void render();
virtual void keyDown(char key);
virtual void keyDown(SDL_KeyboardEvent key);
virtual void mouseUpLeft(int x, int y);
void mouseMove(int x, int y, const MouseState *ms);
};