1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-12-26 21:35:10 +02:00

MessageBox: minor cleanup.

Declare local variables where they are used, not way in advance.
This commit is contained in:
Maarten ter Huurne 2011-10-23 09:24:42 +02:00
parent ccf55e5d61
commit 40fd35d764

View File

@ -64,8 +64,6 @@ void MessageBox::setButton(int action, const string &btn) {
} }
int MessageBox::exec() { int MessageBox::exec() {
int result = -1;
Surface bg(gmenu2x->s); Surface bg(gmenu2x->s);
//Darken background //Darken background
bg.box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,200); bg.box(0, 0, gmenu2x->resX, gmenu2x->resY, 0,0,0,200);
@ -103,8 +101,8 @@ int MessageBox::exec() {
bg.blit(gmenu2x->s,0,0); bg.blit(gmenu2x->s,0,0);
gmenu2x->s->flip(); gmenu2x->s->flip();
InputManager::ButtonEvent event; int result = -1;
while (result<0) { while (result < 0) {
#ifdef PLATFORM_GP2X #ifdef PLATFORM_GP2X
//touchscreen //touchscreen
@ -119,6 +117,7 @@ int MessageBox::exec() {
} }
#endif #endif
InputManager::ButtonEvent event;
if (gmenu2x->input.pollEvent(&event) if (gmenu2x->input.pollEvent(&event)
&& (event.state == InputManager::PRESSED) && (event.state == InputManager::PRESSED)
&& (buttons[event.button] != "")) { && (buttons[event.button] != "")) {