2 * Copyright (C) 2003 Robert Kooima
4 * NEVERBALL is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published
6 * by the Free Software Foundation; either version 2 of the License,
7 * or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
26 /*---------------------------------------------------------------------------*/
28 static int level_enter(void)
35 if ((id = gui_vstack(0)))
37 if ((jd = gui_hstack(id)))
40 if ((kd = gui_vstack(jd)))
42 if ((ld = gui_hstack(kd)))
44 gui_count(ld, curr_level(), GUI_LRG, GUI_NE);
45 if (level_extra_bonus(curr_level()))
46 gui_label(ld, _("Bonus Level "), GUI_LRG, GUI_NW, gui_wht, gui_grn);
48 gui_label(ld, _("Level "), GUI_LRG, GUI_NW, 0, 0);
50 gui_label(kd, _(set_name(set_curr())), GUI_SML, GUI_BOT, gui_wht, gui_wht);
55 gui_multi(id, _(curr_intro()), GUI_SML, GUI_ALL, gui_wht, gui_wht);
65 static void level_leave(int id)
70 static void level_timer(int id, float dt)
76 static void level_paint(int id, float st)
82 static int level_click(int b, int d)
84 return (b < 0 && d == 1) ? goto_state(&st_play_ready) : 1;
87 static int level_keybd(int c, int d)
89 if (d && c == SDLK_ESCAPE)
91 if (d && c == SDLK_F12)
92 goto_state(&st_poser);
96 static int level_buttn(int b, int d)
100 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
101 return goto_state(&st_play_ready);
102 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
103 return goto_state(&st_over);
108 /*---------------------------------------------------------------------------*/
110 static void poser_paint(int id, float st)
115 static int poser_keybd(int c, int d)
117 return (d && c == SDLK_ESCAPE) ? goto_state(&st_level) : 1;
120 /*---------------------------------------------------------------------------*/
122 struct state st_level = {
135 struct state st_poser = {