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.
23 #include "st_shared.h"
30 /*---------------------------------------------------------------------------*/
32 static int level_enter(void)
37 const float *textcol1, *textcol2;
39 if ((id = gui_vstack(0)))
41 if ((jd = gui_hstack(id)))
43 ln = level_repr (curr_level());
44 b = level_bonus(curr_level());
46 textcol1 = b ? gui_wht : 0;
47 textcol2 = b ? gui_grn : 0;
51 if ((kd = gui_vstack(jd)))
53 gui_label(kd, set_name(curr_set()), GUI_SML, GUI_ALL,
58 if ((ld = gui_hstack(kd)))
62 gui_label(ld, ln, GUI_LRG, GUI_NE,
64 gui_label(ld, _("Level "), GUI_LRG, GUI_NW,
69 gui_label(ld, ln, GUI_MED, GUI_NE,
71 gui_label(ld, _("Bonus Level "), GUI_MED, GUI_NW,
76 gui_label(kd, mode_to_str(curr_mode(), 1), GUI_SML, GUI_BOT,
84 gui_multi(id, level_msg(curr_level()),
96 static void level_timer(int id, float dt)
101 static int level_click(int b, int d)
103 return (b < 0 && d == 1) ? goto_state(&st_play_ready) : 1;
106 static int level_keybd(int c, int d)
108 if (d && c == SDLK_F12)
109 return goto_state(&st_poser);
113 static int level_buttn(int b, int d)
117 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
119 return goto_state(&st_play_ready);
121 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
124 return goto_state(&st_over);
130 /*---------------------------------------------------------------------------*/
132 static void poser_paint(int id, float t)
137 static int poser_buttn(int c, int d)
139 if (d && config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, c))
140 return goto_state(&st_level);
145 /*---------------------------------------------------------------------------*/
147 struct state st_level = {
161 struct state st_poser = {