X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=share%2Fst_resol.c;h=c3ebaa3c01b49f4cf2f3818f8d45631016ed2345;hb=70da92a0efb91317f15717e7cc0725ba820a0334;hp=31d3a6638464f40c70b9939a8f4a1e87059899be;hpb=0c25472b7d40be80a5a654bf51c595a1fd491383;p=neverball diff --git a/share/st_resol.c b/share/st_resol.c index 31d3a66..c3ebaa3 100644 --- a/share/st_resol.c +++ b/share/st_resol.c @@ -32,23 +32,23 @@ static SDL_Rect **modes; /*---------------------------------------------------------------------------*/ -#define LANG_BACK 100 +#define RESOL_BACK -1 static int resol_action(int i) { - int f = config_get_d(CONFIG_FULLSCREEN); int r = 1; switch (i) { - case LANG_BACK: + case RESOL_BACK: goto_state(&st_conf); break; default: goto_state(&st_null); - r = config_mode(f, modes[i - 1]->w, modes[i - 1]->h); - goto_state(&st_conf); + r = config_mode(config_get_d(CONFIG_FULLSCREEN), + modes[i]->w, modes[i]->h); + goto_state(&st_resol); break; } @@ -58,13 +58,12 @@ static int resol_action(int i) static int resol_enter(void) { int id, jd; - int i; back_init("back/gui.png", config_get_d(CONFIG_GEOMETRY)); modes = SDL_ListModes(NULL, SDL_OPENGL | SDL_FULLSCREEN); - if ((int) modes == -1) + if (modes == (SDL_Rect **) -1) modes = NULL; if ((id = gui_vstack(0))) @@ -72,13 +71,17 @@ static int resol_enter(void) if ((jd = gui_harray(id))) { gui_label(jd, _("Resolution"), GUI_SML, GUI_ALL, 0, 0); - gui_filler(jd); - gui_start(jd, _("Back"), GUI_SML, LANG_BACK, 0); + gui_space(jd); + gui_start(jd, _("Back"), GUI_SML, RESOL_BACK, 0); } + gui_space(id); + if (modes) { - for(i = 0; modes[i]; i++) + int i; + + for (i = 0; modes[i]; i++) { char s[20]; @@ -87,7 +90,7 @@ static int resol_enter(void) if (i % 4 == 0) jd = gui_harray(id); - gui_state(jd, s, GUI_SML, i + 1, + gui_state(jd, s, GUI_SML, i, config_get_d(CONFIG_WIDTH) == modes[i]->w && config_get_d(CONFIG_HEIGHT) == modes[i]->h); } @@ -123,7 +126,6 @@ static void resol_paint(int id, float st) static void resol_timer(int id, float dt) { gui_timer(id, dt); - audio_timer(dt); } static void resol_point(int id, int x, int y, int dx, int dy) @@ -175,6 +177,7 @@ struct state st_resol = { resol_timer, resol_point, resol_stick, + NULL, resol_click, resol_keybd, resol_buttn,