static int camera_gui(void) { int id, jd; if ((id = gui_vstack(0))) { conf_header(id, _("Camera"), GUI_BACK); int rot_speed = ROT_SPEED_RANGE_MAP(config_get_d(CONFIG_ROTATE_FAST)); int normal_rot_accel = config_get_d(CONFIG_ROTATE_ACCEL_NORMAL); int finesse_rot_accel = config_get_d(CONFIG_ROTATE_ACCEL_FINESSE); conf_slider(id, _("Max rotation speed"), CAMERA_ROT_SPEED, rot_speed, rot_speed_id, ARRAYSIZE(rot_speed_id)); conf_slider(id, _("Normal rotation accel."), CAMERA_NORMAL_ROT_ACCEL, normal_rot_accel, normal_rot_accel_id, ARRAYSIZE(normal_rot_accel_id)); conf_slider(id, _("Finesse-mode rotation accel."), CAMERA_FINESSE_ROT_ACCEL, finesse_rot_accel, finesse_rot_accel_id, ARRAYSIZE(finesse_rot_accel_id)); gui_space(id); conf_toggle(id, _("Reversed camera rotation"), CAMERA_REVERSED_CAMERA_ROTATION, config_get_d(CONFIG_REVERSED_CAMERA_ROTATION), _("On"), 1, _("Off"), 0); conf_toggle(id, _("Draw floor tilt"), CAMERA_SCREEN_TILT_ENABLED, config_get_d(CONFIG_SCREEN_TILT_ENABLED), _("On"), 1, _("Off"), 0); gui_layout(id, 0, 0); } return id; }
static int clobber_gui(void) { int id, jd, kd; int file_id; if ((id = gui_vstack(0))) { kd = gui_label(id, _("Overwrite?"), GUI_MED, gui_red, gui_red); file_id = gui_label(id, "MMMMMMMM", GUI_MED, gui_yel, gui_yel); if ((jd = gui_harray(id))) { gui_start(jd, _("Cancel"), GUI_SML, GUI_BACK, 0); gui_state(jd, _("Overwrite"), GUI_SML, SAVE_SAVE, 0); } gui_pulse(kd, 1.2f); gui_layout(id, 0, 0); gui_set_trunc(file_id, TRUNC_TAIL); gui_set_label(file_id, text_input); } return id; }
static int save_gui(void) { int id, jd; if ((id = gui_vstack(0))) { gui_label(id, _("Replay Name"), GUI_MED, 0, 0); gui_space(id); file_id = gui_label(id, " ", GUI_MED, gui_yel, gui_yel); gui_space(id); gui_keyboard(id); gui_space(id); if ((jd = gui_harray(id))) { enter_id = gui_start(jd, _("Save"), GUI_SML, SAVE_SAVE, 0); gui_space(jd); gui_state(jd, _("Cancel"), GUI_SML, GUI_BACK, 0); } gui_layout(id, 0, 0); gui_set_trunc(file_id, TRUNC_HEAD); gui_set_label(file_id, text_input); } return id; }
static int pause_gui(void) { int id, jd, title_id; /* Build the pause GUI. */ if ((id = gui_vstack(0))) { title_id = gui_label(id, _("Paused"), GUI_LRG, 0, 0); gui_space(id); if ((jd = gui_harray(id))) { gui_state(jd, _("Quit"), GUI_SML, PAUSE_EXIT, 0); if (progress_same_avail()) gui_state(jd, _("Restart"), GUI_SML, PAUSE_RESTART, 0); gui_start(jd, _("Continue"), GUI_SML, PAUSE_CONTINUE, 0); } gui_pulse(title_id, 1.2f); gui_layout(id, 0, 0); } return id; }
static int name_gui(void) { int id, jd; if ((id = gui_vstack(0))) { gui_label(id, _("Player Name"), GUI_MED, 0, 0); gui_space(id); name_id = gui_label(id, " ", GUI_MED, gui_yel, gui_yel); gui_space(id); gui_keyboard(id); gui_space(id); if ((jd = gui_harray(id))) { enter_id = gui_start(jd, _("OK"), GUI_SML, NAME_OK, 0); gui_space(jd); gui_state(jd, _("Cancel"), GUI_SML, GUI_BACK, 0); } gui_layout(id, 0, 0); gui_set_trunc(name_id, TRUNC_HEAD); gui_set_label(name_id, text_input); } return id; }
static int title_enter(void) { int id, jd, kd; /* Build the title GUI. */ if ((id = gui_vstack(0))) { gui_label(id, "Neverputt", GUI_LRG, GUI_ALL, 0, 0); gui_space(id); if ((jd = gui_harray(id))) { gui_filler(jd); if ((kd = gui_varray(jd))) { gui_start(kd, sgettext("menu^Play"), GUI_MED, TITLE_PLAY, 1); gui_state(kd, sgettext("menu^Options"), GUI_MED, TITLE_CONF, 0); gui_state(kd, sgettext("menu^Exit"), GUI_MED, TITLE_EXIT, 0); } gui_filler(jd); } gui_layout(id, 0, 0); } course_init(); course_rand(); return id; }
static int resol_gui(void) { int id, jd; if ((id = gui_vstack(0))) { if ((jd = gui_harray(id))) { gui_label(jd, _("Resolution"), GUI_SML, 0, 0); gui_space(jd); gui_start(jd, _("Back"), GUI_SML, RESOL_BACK, 0); } gui_space(id); if (modes) { int i; for (i = 0; fill_row(gui_harray(id), modes, i, 4); i += 4); } gui_layout(id, 0, 0); } return id; }
static int demo_end_gui(void) { int id, jd, kd; if ((id = gui_vstack(0))) { if (demo_paused) kd = gui_label(id, _("Replay Paused"), GUI_LRG, gui_gry, gui_red); else kd = gui_label(id, _("Replay Ends"), GUI_LRG, gui_gry, gui_red); if ((jd = gui_harray(id))) { if (standalone) { gui_start(jd, _("Quit"), GUI_SML, DEMO_QUIT, 0); } else { gui_start(jd, _("Keep"), GUI_SML, DEMO_KEEP, 0); gui_state(jd, _("Delete"), GUI_SML, DEMO_DEL, 0); } if (demo_paused) gui_start(jd, _("Continue"), GUI_SML, DEMO_CONTINUE, 0); else gui_state(jd, _("Repeat"), GUI_SML, DEMO_REPLAY, 0); } gui_pulse(kd, 1.2f); gui_layout(id, 0, 0); } return id; }
void hud_init(void) { static const GLubyte *color[5] = { gui_wht, gui_red, gui_grn, gui_blu, gui_yel }; int i = curr_player(); #ifdef __MOBILE__ if ((Shud_id = gui_vstack(0))) { gui_label(Shud_id, _(" S "), GUI_SML, gui_wht, gui_wht); gui_label(Shud_id, _(" W "), GUI_SML, gui_wht, gui_wht); gui_label(Shud_id, _(" I "), GUI_SML, gui_wht, gui_wht); gui_label(Shud_id, _(" N "), GUI_SML, gui_wht, gui_wht); gui_label(Shud_id, _(" G "), GUI_SML, gui_wht, gui_wht); gui_set_rect(Shud_id, GUI_RGT); gui_layout(Shud_id, -1, 0); } #endif if ((Lhud_id = gui_hstack(0))) { gui_label(Lhud_id, curr_scr(), GUI_MED, color[i], gui_wht); gui_label(Lhud_id, _("Shot"), GUI_SML, gui_wht, gui_wht); gui_set_rect(Lhud_id, GUI_NE); gui_layout(Lhud_id, -1, -1); } if ((Rhud_id = gui_hstack(0))) { gui_label(Rhud_id, curr_par(), GUI_MED, color[i], gui_wht); gui_label(Rhud_id, _("Par"), GUI_SML, gui_wht, gui_wht); gui_set_rect(Rhud_id, GUI_NW); gui_layout(Rhud_id, +1, -1); } if ((fps_id = gui_count(0, 1000, GUI_SML))) { gui_set_rect(fps_id, GUI_SE); gui_layout(fps_id, -1, +1); } }
void hud_init(void) { int id; if ((Rhud_id = gui_hstack(0))) { if ((id = gui_vstack(Rhud_id))) { gui_label(id, "Coins", GUI_SML, 0, gui_wht, gui_wht); gui_label(id, "Goal", GUI_SML, 0, gui_wht, gui_wht); } if ((id = gui_vstack(Rhud_id))) { coin_id = gui_count(id, 100, GUI_SML, GUI_NW); goal_id = gui_count(id, 10, GUI_SML, 0); } gui_layout(Rhud_id, +1, -1); } if ((Lhud_id = gui_hstack(0))) { if ((id = gui_vstack(Lhud_id))) { ball_id = gui_count(id, 10, GUI_SML, GUI_NE); scor_id = gui_count(id, 1000, GUI_SML, 0); } if ((id = gui_vstack(Lhud_id))) { gui_label(id, "Balls", GUI_SML, 0, gui_wht, gui_wht); gui_label(id, "Score", GUI_SML, 0, gui_wht, gui_wht); } gui_layout(Lhud_id, -1, -1); } if ((time_id = gui_clock(0, 59999, GUI_MED, GUI_TOP))) gui_layout(time_id, 0, -1); if ((view_id = gui_label(0, STR_VIEW2, GUI_SML, GUI_SW, gui_wht, gui_wht))) gui_layout(view_id, 1, 1); if ((fps_id = gui_count(0, 1000, GUI_SML, GUI_SE))) gui_layout(fps_id, -1, 1); }
static int demo_gui(void) { int id, jd; id = gui_vstack(0); if (total) { if (video.device_w < video.device_h && total > DEMO_STEP) { if ((jd = gui_vstack(id))) { gui_navig(jd, total, first, DEMO_STEP); gui_space(jd); gui_filler(jd); gui_label(jd, _("Select Replay"), GUI_MED, 0,0); } } else if ((jd = gui_hstack(id))) { gui_label(jd, _("Select Replay"), GUI_MED, 0,0); gui_space(jd); gui_filler(jd); gui_navig(jd, total, first, DEMO_STEP); } gui_demo_thumbs(id); //gui_space(id); //gui_demo_status(id); gui_layout(id, 0, 0); gui_demo_update_thumbs(); //gui_demo_update_status(last_viewed); } else { gui_label(id, _("No Replays"), GUI_MED, 0, 0); gui_space(id); gui_state(id, _("Back"), GUI_MED, GUI_BACK, 0); gui_layout(id, 0, 0); } return id; }
static int demo_enter(void) { int id, jd; if (items) demo_dir_free(items); items = demo_dir_scan(); total = array_len(items); id = gui_vstack(0); if (total) { if ((jd = gui_hstack(id))) { gui_label(jd, _("Select Replay"), GUI_SML, GUI_ALL, 0,0); gui_filler(jd); gui_navig(jd, first > 0, first + DEMO_STEP < total); } gui_demo_thumbs(id); gui_filler(id); gui_demo_status(id); gui_layout(id, 0, 0); gui_demo_update_thumbs(); gui_demo_update_status(last_viewed); } else { gui_label(id, _("No Replays"), GUI_MED, GUI_ALL, 0, 0); gui_layout(id, 0, 0); } audio_music_fade_to(0.5f, "bgm/inter.ogg"); return id; }
static int play_ready_gui(void) { int id; if ((id = gui_label(0, _("Ready?"), GUI_LRG, 0, 0))) { gui_layout(id, 0, 0); gui_pulse(id, 1.2f); } return id; }
static int over_gui(void) { int id; if ((id = gui_label(0, _("GAME OVER"), GUI_LRG, gui_gry, gui_red))) { gui_layout(id, 0, 0); gui_pulse(id, 1.2f); } return id; }
static int play_loop_gui(void) { int id; if ((id = gui_label(0, _("GO!"), GUI_LRG, gui_blu, gui_grn))) { gui_layout(id, 0, 0); gui_pulse(id, 1.2f); } return id; }
static int demo_play_gui(void) { int id; if ((id = gui_vstack(0))) { gui_label(id, _("Replay"), GUI_LRG, gui_blu, gui_grn); gui_layout(id, 0, 0); gui_pulse(id, 1.2f); } return id; }
static int lang_gui(void) { const int step = (first == 0 ? LANG_STEP - 1 : LANG_STEP); int id, jd; int i; if ((id = gui_vstack(0))) { if ((jd = gui_hstack(id))) { gui_label(jd, _("Language"), GUI_SML, 0, 0); gui_space(jd); gui_space(jd); gui_navig(jd, array_len(langs), first, LANG_STEP); } gui_space(id); if (step < LANG_STEP) { int default_id; default_id = gui_state(id, _("Default"), GUI_SML, LANG_DEFAULT, 0); gui_set_hilite(default_id, !*config_get_s(CONFIG_LANGUAGE)); } for (i = first; i < first + step; i++) { if (i < array_len(langs)) { struct lang_desc *desc = LANG_GET(langs, i); int lang_id; lang_id = gui_state(id, lang_name(desc), GUI_SML, LANG_SELECT, i); gui_set_hilite(lang_id, (strcmp(config_get_s(CONFIG_LANGUAGE), desc->code) == 0)); } else { gui_label(id, " ", GUI_SML, 0, 0); } } gui_layout(id, 0, 0); } return id; }
static int conf_video_gui(void) { static const struct option multisample_opts[] = { { N_("Off"), 0 }, { N_("2x"), 2 }, { N_("4x"), 4 }, { N_("8x"), 8 }, }; int id; if ((id = gui_vstack(0))) { char resolution[sizeof ("12345678 x 12345678")]; sprintf(resolution, "%d x %d", config_get_d(CONFIG_WIDTH), config_get_d(CONFIG_HEIGHT)); conf_header(id, _("Graphics"), GUI_BACK); conf_state (id, _("Resolution"), resolution, CONF_VIDEO_RESOLUTION); conf_toggle(id, _("Fullscreen"), CONF_VIDEO_FULLSCREEN, config_get_d(CONFIG_FULLSCREEN), _("On"), 1, _("Off"), 0); #ifdef ENABLE_HMD conf_toggle(id, _("HMD"), CONF_VIDEO_HMD, config_get_d(CONFIG_HMD), _("On"), 1, _("Off"), 0); #endif gui_space(id); conf_toggle(id, _("V-Sync"), CONF_VIDEO_VSYNC, config_get_d(CONFIG_VSYNC), _("On"), 1, _("Off"), 0); conf_select(id, _("Antialiasing"), CONF_VIDEO_MULTISAMPLE, config_get_d(CONFIG_MULTISAMPLE), multisample_opts, ARRAYSIZE(multisample_opts)); gui_space(id); conf_toggle(id, _("Reflection"), CONF_VIDEO_REFLECTION, config_get_d(CONFIG_REFLECTION), _("On"), 1, _("Off"), 0); conf_toggle(id, _("Background"), CONF_VIDEO_BACKGROUND, config_get_d(CONFIG_BACKGROUND), _("On"), 1, _("Off"), 0); conf_toggle(id, _("Shadow"), CONF_VIDEO_SHADOW, config_get_d(CONFIG_SHADOW), _("On"), 1, _("Off"), 0); gui_layout(id, 0, 0); } return id; }
static int next_enter(struct state *st, struct state *prev) { int id, jd; char str[MAXSTR]; sprintf(str, _("Hole %02d"), curr_hole()); if ((id = gui_vstack(0))) { gui_label(id, str, GUI_MED, 0, 0); gui_space(id); if ((jd = gui_vstack(id))) { gui_label(jd, _("Player"), GUI_SML, 0, 0); switch (curr_player()) { case 1: gui_label(jd, "1", GUI_LRG, gui_red, gui_wht); if (curr_party() > 1) audio_play(AUD_PLAYER1, 1.f); break; case 2: gui_label(jd, "2", GUI_LRG, gui_grn, gui_wht); if (curr_party() > 1) audio_play(AUD_PLAYER2, 1.f); break; case 3: gui_label(jd, "3", GUI_LRG, gui_blu, gui_wht); if (curr_party() > 1) audio_play(AUD_PLAYER3, 1.f); break; case 4: gui_label(jd, "4", GUI_LRG, gui_yel, gui_wht); if (curr_party() > 1) audio_play(AUD_PLAYER4, 1.f); break; } gui_set_rect(jd, GUI_ALL); } gui_layout(id, 0, 0); } hud_init(); game_set_fly(1.f); if (paused) paused = 0; return id; }
static int set_enter(void) { int w = config_get_d(CONFIG_WIDTH); int h = config_get_d(CONFIG_HEIGHT); int id, jd, kd; int i; if (do_init) { total = set_init(); first = MIN(first, (total - 1) - ((total - 1) % SET_STEP)); audio_music_fade_to(0.5f, "bgm/inter.ogg"); audio_play(AUD_START, 1.f); } else do_init = 1; if ((id = gui_vstack(0))) { if ((jd = gui_hstack(id))) { gui_label(jd, _("Level Set"), GUI_SML, GUI_ALL, gui_yel, gui_red); gui_filler(jd); gui_navig(jd, first > 0, first + SET_STEP < total); } gui_space(id); if ((jd = gui_harray(id))) { shot_id = gui_image(jd, set_shot(first), 7 * w / 16, 7 * h / 16); if ((kd = gui_varray(jd))) { for (i = first; i < first + SET_STEP; i++) gui_set(kd, i); } } gui_space(id); desc_id = gui_multi(id, " \\ \\ \\ \\ \\", GUI_SML, GUI_ALL, gui_yel, gui_wht); gui_layout(id, 0, 0); } return id; }
static int conf_gui(void) { int id; /* Initialize the configuration GUI. */ if ((id = gui_vstack(0))) { int sound = config_get_d(CONFIG_SOUND_VOLUME); int music = config_get_d(CONFIG_MUSIC_VOLUME); int mouse = MOUSE_RANGE_MAP(config_get_d(CONFIG_MOUSE_SENSE)); const char *player = config_get_s(CONFIG_PLAYER); const char *ball = config_get_s(CONFIG_BALL_FILE); int name_id = 0, ball_id = 0; conf_header(id, _("Options"), GUI_BACK); conf_state(id, _("Graphics"), _("Configure"), CONF_VIDEO); gui_space(id); conf_slider(id, _("Mouse Sensitivity"), CONF_MOUSE_SENSE, mouse, mouse_id, ARRAYSIZE(mouse_id)); gui_space(id); conf_slider(id, _("Sound Volume"), CONF_SOUND_VOLUME, sound, sound_id, ARRAYSIZE(sound_id)); conf_slider(id, _("Music Volume"), CONF_MUSIC_VOLUME, music, music_id, ARRAYSIZE(music_id)); gui_space(id); name_id = conf_state(id, _("Player Name"), " ", CONF_PLAYER); ball_id = conf_state(id, _("Ball Model"), " ", CONF_BALL); gui_layout(id, 0, 0); gui_set_trunc(name_id, TRUNC_TAIL); gui_set_trunc(ball_id, TRUNC_TAIL); gui_set_label(name_id, player); gui_set_label(ball_id, base_name(ball)); } return id; }
static int goal_enter(struct state *st, struct state *prev) { int id; if ((id = gui_label(0, _("It's In!"), GUI_MED, gui_grn, gui_grn))) gui_layout(id, 0, 0); if (paused) paused = 0; else hole_goal(); hud_init(); return id; }
static int goal_enter(void) { int id; if ((id = gui_label(0, _("It's In!"), GUI_MED, GUI_ALL, gui_grn, gui_grn))) gui_layout(id, 0, 0); if (paused) paused = 0; else hole_goal(); hud_init(); return id; }
static int title_enter(struct state *st, struct state *prev) { int id, jd, kd; /* Build the title GUI. */ if ((id = gui_vstack(0))) { #ifdef GCWZERO jd = gui_label(id, "Neverputt", GUI_LRG, 0, 0); if (jd) { gui_set_fill(jd); gui_set_rect(jd, GUI_TOP); } int credit_label; if ((credit_label = gui_label(id, "GCW Zero port by Senquack", GUI_SML, gui_wht, gui_wht))) { gui_set_rect(credit_label, GUI_BOT); } #else gui_label(id, "Neverputt", GUI_LRG, 0, 0); #endif //GCWZERO gui_space(id); if ((jd = gui_harray(id))) { gui_filler(jd); if ((kd = gui_varray(jd))) { gui_start(kd, gt_prefix("menu^Play"), GUI_MED, TITLE_PLAY, 1); gui_state(kd, gt_prefix("menu^Options"), GUI_MED, TITLE_CONF, 0); gui_state(kd, gt_prefix("menu^Exit"), GUI_MED, TITLE_EXIT, 0); } gui_filler(jd); } gui_layout(id, 0, 0); } course_init(); course_rand(); return id; }
static int demo_compat_gui(void) { int id; if ((id = gui_vstack(0))) { gui_label(id, _("Warning!"), GUI_MED, 0, 0); gui_space(id); gui_multi(id, _("The current replay was recorded with a\\" "different (or unknown) version of this level.\\" "Be prepared to encounter visual errors.\\"), GUI_SML, gui_wht, gui_wht); gui_layout(id, 0, 0); } return id; }
static int demo_end_enter(void) { int id, jd, kd; if ((id = gui_vstack(0))) { if (demo_paused) kd = gui_label(id, _("Replay Paused"), GUI_LRG, GUI_ALL, gui_gry, gui_red); else kd = gui_label(id, _("Replay Ends"), GUI_LRG, GUI_ALL, gui_gry, gui_red); if ((jd = gui_harray(id))) { int start_id = 0; if (standalone) { start_id = gui_start(jd, _("Quit"), GUI_SML, DEMO_QUIT, 1); } else { start_id = gui_start(jd, _("Keep"), GUI_SML, DEMO_KEEP, 1); gui_state(jd, _("Delete"), GUI_SML, DEMO_DEL, 0); } if (demo_paused) { gui_start(jd, _("Continue"), GUI_SML, DEMO_CONTINUE, 1); gui_toggle(start_id); } else gui_state(jd, _("Repeat"), GUI_SML, DEMO_REPLAY, 0); } gui_pulse(kd, 1.2f); gui_layout(id, 0, 0); } audio_music_fade_out(demo_paused ? 0.2f : 2.0f); return id; }
static int title_enter(void) { int id, jd, kd; /* Build the title GUI. */ if ((id = gui_vstack(0))) { gui_label(id, "Neverball", GUI_LRG, GUI_ALL, 0, 0); gui_space(id); if ((jd = gui_harray(id))) { gui_filler(jd); if ((kd = gui_varray(jd))) { gui_start(kd, "Play", GUI_MED, TITLE_PLAY, 1); gui_state(kd, "Replay", GUI_MED, TITLE_DEMO, 0); gui_state(kd, "Help", GUI_MED, TITLE_HELP, 0); gui_state(kd, "Options", GUI_MED, TITLE_CONF, 0); gui_state(kd, "Exit", GUI_MED, TITLE_EXIT, 0); } gui_filler(jd); } gui_layout(id, 0, 0); } /* Start the title screen music. */ audio_music_fade_to(0.5f, "bgm/tittle.mod"); /* Initialize the first level of the first set for display. */ game_init("map-rlk/title.sol", "map-back/jupiter.sol", "png/space.png", 0, 1); real_time = 0.0f; demo_time = 0.0f; mode = 0; return id; }
static int title_gui(void) { int id, jd, kd; /* Build the title GUI. */ if ((id = gui_vstack(0))) { if ((jd = gui_label(id, " Neverball ", GUI_LRG, 0, 0))) gui_set_fill(jd); gui_space(id); if ((jd = gui_hstack(id))) { gui_filler(jd); if ((kd = gui_varray(jd))) { if (config_cheat()) play_id = gui_start(kd, sgettext("menu^Cheat"), GUI_MED, TITLE_PLAY, 0); else play_id = gui_start(kd, sgettext("menu^Play"), GUI_MED, TITLE_PLAY, 0); gui_state(kd, sgettext("menu^Replay"), GUI_MED, TITLE_DEMO, 0); gui_state(kd, sgettext("menu^Help"), GUI_MED, TITLE_HELP, 0); gui_state(kd, sgettext("menu^Options"), GUI_MED, TITLE_CONF, 0); gui_state(kd, sgettext("menu^Exit"), GUI_MED, GUI_BACK, 0); /* Hilight the start button. */ gui_set_hilite(play_id, 1); } gui_filler(jd); } gui_layout(id, 0, 0); } return id; }
static int fall_enter(void) { int id; if ((id = gui_label(0, _("1 Stroke Penalty"), GUI_MED, GUI_ALL, gui_blk, gui_red))) gui_layout(id, 0, 0); if (paused) paused = 0; else { hole_fall(); /* game_draw(0);*/ /*TODO: is this call ok? */ /* No, it's not. */ } hud_init(); return id; }
static int resol_gui(void) { int id, jd, kd; if ((id = gui_vstack(0))) { const int W = config_get_d(CONFIG_WIDTH); const int H = config_get_d(CONFIG_HEIGHT); int i, j, n = ARRAYSIZE(modes); char buff[sizeof ("1234567890 x 1234567890")] = ""; conf_header(id, _("Resolution"), GUI_BACK); for (i = 0; i < n; i += 4) { if ((jd = gui_harray(id))) { for (j = 3; j >= 0; j--) { int m = i + j; if (m < n) { sprintf(buff, "%d x %d", modes[m].w, modes[m].h); kd = gui_state(jd, buff, GUI_SML, RESOL_MODE, m); gui_set_hilite(kd, (modes[m].w == W && modes[m].h == H)); } else { gui_space(jd); } } } } gui_layout(id, 0, 0); } return id; }