1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 21:02:56 +03: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 result = -1;
Surface bg(gmenu2x->s);
//Darken background
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);
gmenu2x->s->flip();
InputManager::ButtonEvent event;
while (result<0) {
int result = -1;
while (result < 0) {
#ifdef PLATFORM_GP2X
//touchscreen
@ -119,6 +117,7 @@ int MessageBox::exec() {
}
#endif
InputManager::ButtonEvent event;
if (gmenu2x->input.pollEvent(&event)
&& (event.state == InputManager::PRESSED)
&& (buttons[event.button] != "")) {