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.
25 /*---------------------------------------------------------------------------*/
27 static int level_enter(void)
31 if ((id
= gui_vstack(0)))
33 if ((jd
= gui_hstack(id
)))
36 gui_count(jd
, curr_level(), GUI_LRG
, GUI_NE
| GUI_SE
);
37 gui_label(jd
, "Level ", GUI_LRG
, GUI_NW
| GUI_SW
, 0, 0);
41 gui_multi(id
, curr_intro(), GUI_SML
, GUI_ALL
, gui_wht
, gui_wht
);
51 static void level_leave(int id
)
56 static void level_timer(int id
, float dt
)
62 static void level_paint(int id
, float st
)
68 static int level_click(int b
, int d
)
70 return (b
< 0 && d
== 1) ? goto_state(&st_play_ready
) : 1;
73 static int level_keybd(int c
, int d
)
75 if (d
&& c
== SDLK_ESCAPE
)
77 if (d
&& c
== SDLK_F12
)
78 goto_state(&st_poser
);
82 static int level_buttn(int b
, int d
)
86 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A
, b
))
87 return goto_state(&st_play_ready
);
88 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT
, b
))
89 return goto_state(&st_over
);
94 /*---------------------------------------------------------------------------*/
96 static void poser_paint(int id
, float st
)
101 static int poser_keybd(int c
, int d
)
103 return (d
&& c
== SDLK_ESCAPE
) ? goto_state(&st_level
) : 1;
106 /*---------------------------------------------------------------------------*/
108 struct state st_level
= {
121 struct state st_poser
= {