2 * Copyright (C) 2003 Robert Kooima
4 * NEVERPUTT 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.
31 /*---------------------------------------------------------------------------*/
33 static SDL_Joystick *joystick = NULL;
35 void set_joystick(SDL_Joystick *j)
40 /*---------------------------------------------------------------------------*/
42 static char *number(int i)
44 static char str[MAXSTR];
46 sprintf(str, "%02d", i);
51 static int score_card(const char *title,
57 int p1 = (curr_party() >= 1) ? 1 : 0, l1 = (curr_party() == 1) ? 1 : 0;
58 int p2 = (curr_party() >= 2) ? 1 : 0, l2 = (curr_party() == 2) ? 1 : 0;
59 int p3 = (curr_party() >= 3) ? 1 : 0, l3 = (curr_party() == 3) ? 1 : 0;
60 int p4 = (curr_party() >= 4) ? 1 : 0, l4 = (curr_party() == 4) ? 1 : 0;
63 int n = curr_count() - 1;
64 int m = curr_count() / 2;
66 if ((id = gui_vstack(0)))
68 gui_label(id, title, GUI_MED, GUI_ALL, c0, c1);
71 if ((jd = gui_hstack(id)))
73 if ((kd = gui_varray(jd)))
75 if (p1) gui_label(kd, _("O"), 0, GUI_NE, 0, 0);
76 if (p1) gui_label(kd, hole_out(0), 0, 0, gui_wht, gui_wht);
77 if (p1) gui_label(kd, hole_out(1), 0, GUI_SE * l1, gui_red, gui_wht);
78 if (p2) gui_label(kd, hole_out(2), 0, GUI_SE * l2, gui_grn, gui_wht);
79 if (p3) gui_label(kd, hole_out(3), 0, GUI_SE * l3, gui_blu, gui_wht);
80 if (p4) gui_label(kd, hole_out(4), 0, GUI_SE * l4, gui_yel, gui_wht);
83 if ((kd = gui_harray(jd)))
84 for (i = m; i > 0; i--)
85 if ((ld = gui_varray(kd)))
87 if (p1) gui_label(ld, number(i), 0, (i == 1) ? GUI_NW : 0, 0, 0);
88 if (p1) gui_label(ld, hole_score(i, 0), 0, 0, gui_wht, gui_wht);
89 if (p1) gui_label(ld, hole_score(i, 1), 0, 0, gui_red, gui_wht);
90 if (p2) gui_label(ld, hole_score(i, 2), 0, 0, gui_grn, gui_wht);
91 if (p3) gui_label(ld, hole_score(i, 3), 0, 0, gui_blu, gui_wht);
92 if (p4) gui_label(ld, hole_score(i, 4), 0, 0, gui_yel, gui_wht);
94 if ((kd = gui_varray(jd)))
97 if (p1) gui_label(kd, _("Par"), 0, GUI_NW, gui_wht, gui_wht);
98 if (p1) gui_label(kd, _("P1"), 0, GUI_SW * l1, gui_red, gui_wht);
99 if (p2) gui_label(kd, _("P2"), 0, GUI_SW * l2, gui_grn, gui_wht);
100 if (p3) gui_label(kd, _("P3"), 0, GUI_SW * l3, gui_blu, gui_wht);
101 if (p4) gui_label(kd, _("P4"), 0, GUI_SW * l4, gui_yel, gui_wht);
107 if ((jd = gui_hstack(id)))
109 if ((kd = gui_varray(jd)))
111 if (p1) gui_label(kd, _("Tot"), 0, GUI_TOP, 0, 0);
112 if (p1) gui_label(kd, hole_tot(0), 0, 0, gui_wht, gui_wht);
113 if (p1) gui_label(kd, hole_tot(1), 0, GUI_BOT * l1, gui_red, gui_wht);
114 if (p2) gui_label(kd, hole_tot(2), 0, GUI_BOT * l2, gui_grn, gui_wht);
115 if (p3) gui_label(kd, hole_tot(3), 0, GUI_BOT * l3, gui_blu, gui_wht);
116 if (p4) gui_label(kd, hole_tot(4), 0, GUI_BOT * l4, gui_yel, gui_wht);
118 if ((kd = gui_varray(jd)))
120 if (p1) gui_label(kd, _("I"), 0, GUI_NE, 0, 0);
121 if (p1) gui_label(kd, hole_in(0), 0, 0, gui_wht, gui_wht);
122 if (p1) gui_label(kd, hole_in(1), 0, GUI_SE * l1, gui_red, gui_wht);
123 if (p2) gui_label(kd, hole_in(2), 0, GUI_SE * l2, gui_grn, gui_wht);
124 if (p3) gui_label(kd, hole_in(3), 0, GUI_SE * l3, gui_blu, gui_wht);
125 if (p4) gui_label(kd, hole_in(4), 0, GUI_SE * l4, gui_yel, gui_wht);
127 if ((kd = gui_harray(jd)))
128 for (i = n; i > m; i--)
129 if ((ld = gui_varray(kd)))
131 if (p1) gui_label(ld, number(i), 0, (i == m+1) ? GUI_NW : 0, 0, 0);
132 if (p1) gui_label(ld, hole_score(i, 0), 0, 0, gui_wht, gui_wht);
133 if (p1) gui_label(ld, hole_score(i, 1), 0, 0, gui_red, gui_wht);
134 if (p2) gui_label(ld, hole_score(i, 2), 0, 0, gui_grn, gui_wht);
135 if (p3) gui_label(ld, hole_score(i, 3), 0, 0, gui_blu, gui_wht);
136 if (p4) gui_label(ld, hole_score(i, 4), 0, 0, gui_yel, gui_wht);
138 if ((kd = gui_varray(jd)))
141 if (p1) gui_label(kd, _("Par"), 0, GUI_NW, gui_wht, gui_wht);
142 if (p1) gui_label(kd, _("P1"), 0, GUI_SW * l1, gui_red, gui_wht);
143 if (p2) gui_label(kd, _("P2"), 0, GUI_SW * l2, gui_grn, gui_wht);
144 if (p3) gui_label(kd, _("P3"), 0, GUI_SW * l3, gui_blu, gui_wht);
145 if (p4) gui_label(kd, _("P4"), 0, GUI_SW * l4, gui_yel, gui_wht);
149 gui_layout(id, 0, 0);
155 /*---------------------------------------------------------------------------*/
157 static void shared_stick(int id, int a, int v)
161 if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
162 jd = gui_stick(id, v, 0);
163 else if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
164 jd = gui_stick(id, 0, v);
170 /*---------------------------------------------------------------------------*/
176 static int title_action(int i)
178 audio_play(AUD_MENU, 1.0f);
182 case TITLE_PLAY: return goto_state(&st_course);
183 case TITLE_CONF: return goto_state(&st_conf);
184 case TITLE_EXIT: return 0;
189 static int title_enter(void)
193 /* Build the title GUI. */
195 if ((id = gui_vstack(0)))
197 gui_label(id, "Neverputt", GUI_LRG, GUI_ALL, 0, 0);
200 if ((jd = gui_harray(id)))
204 if ((kd = gui_varray(jd)))
206 gui_start(kd, sgettext("menu^Play"), GUI_MED, TITLE_PLAY, 1);
207 gui_state(kd, sgettext("menu^Options"), GUI_MED, TITLE_CONF, 0);
208 gui_state(kd, sgettext("menu^Exit"), GUI_MED, TITLE_EXIT, 0);
213 gui_layout(id, 0, 0);
222 static void title_leave(int id)
227 static void title_paint(int id, float st)
233 static void title_timer(int id, float dt)
235 float g[3] = { 0.f, 0.f, 0.f };
238 game_set_fly(fcosf(time_state() / 10.f));
244 static void title_point(int id, int x, int y, int dx, int dy)
246 gui_pulse(gui_point(id, x, y), 1.2f);
249 static int title_click(int b, int d)
251 return (d && b < 0) ? title_action(gui_token(gui_click())) : 1;
254 static int title_buttn(int b, int d)
258 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
259 return title_action(gui_token(gui_click()));
260 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
261 return title_action(TITLE_EXIT);
266 /*---------------------------------------------------------------------------*/
271 #define COURSE_BACK -1
273 static int course_action(int i)
275 if (course_exists(i))
278 goto_state(&st_party);
280 if (i == COURSE_BACK)
281 goto_state(&st_title);
286 static int course_enter(void)
288 int w = config_get_d(CONFIG_WIDTH);
289 int h = config_get_d(CONFIG_HEIGHT);
291 int id, jd, kd, ld, md, i = 0, j, n = course_count();
292 int m = (int)(sqrt(n/2.0)*2);
294 if ((id = gui_vstack(0)))
296 gui_label(id, _("Select Course"), GUI_MED, GUI_ALL, 0, 0);
299 if ((jd = gui_hstack(id)))
301 shot_id = gui_image(jd, course_shot(0), w / 3, h / 3);
305 if ((kd = gui_varray(jd)))
307 for(i = 0; i < n; i += m)
309 if ((ld = gui_harray(kd)))
311 for (j = (m - 1); j >= 0; j--)
315 md = gui_image(ld, course_shot(i + j),
316 w / 3 / m, h / 3 / m);
317 gui_active(md, i + j, 0);
331 desc_id = gui_multi(id, _(course_desc(0)), GUI_SML, GUI_ALL, gui_yel, gui_wht);
334 if ((jd = gui_hstack(id)))
337 gui_state(jd, _("Back"), GUI_SML, COURSE_BACK, 0);
340 gui_layout(id, 0, 0);
343 audio_music_fade_to(0.5f, "bgm/inter.ogg");
348 static void course_leave(int id)
353 static void course_paint(int id, float st)
359 static void course_timer(int id, float dt)
365 static void course_point(int id, int x, int y, int dx, int dy)
369 if ((jd = gui_point(id, x, y)))
371 int i = gui_token(jd);
372 if (course_exists(i))
374 gui_set_image(shot_id, course_shot(i));
375 gui_set_multi(desc_id, _(course_desc(i)));
381 static int course_click(int b, int d)
383 return (d && b < 0) ? course_action(gui_token(gui_click())) : 1;
386 static int course_buttn(int b, int d)
390 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
391 return course_action(gui_token(gui_click()));
392 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
393 return course_action(COURSE_BACK);
398 /*---------------------------------------------------------------------------*/
407 static int party_action(int i)
412 audio_play(AUD_MENU, 1.f);
414 goto_state(&st_next);
417 audio_play(AUD_MENU, 1.f);
419 goto_state(&st_next);
422 audio_play(AUD_MENU, 1.f);
424 goto_state(&st_next);
427 audio_play(AUD_MENU, 1.f);
429 goto_state(&st_next);
432 audio_play(AUD_MENU, 1.f);
433 goto_state(&st_course);
439 static int party_enter(void)
443 if ((id = gui_vstack(0)))
445 gui_label(id, _("Players?"), GUI_MED, GUI_ALL, 0, 0);
448 if ((jd = gui_harray(id)))
450 int p4 = gui_state(jd, "4", GUI_LRG, PARTY_4, 0);
451 int p3 = gui_state(jd, "3", GUI_LRG, PARTY_3, 0);
452 int p2 = gui_state(jd, "2", GUI_LRG, PARTY_2, 0);
453 int p1 = gui_state(jd, "1", GUI_LRG, PARTY_1, 0);
455 gui_set_color(p1, gui_red, gui_wht);
456 gui_set_color(p2, gui_grn, gui_wht);
457 gui_set_color(p3, gui_blu, gui_wht);
458 gui_set_color(p4, gui_yel, gui_wht);
465 if ((jd = gui_hstack(id)))
468 gui_state(jd, _("Back"), GUI_SML, PARTY_B, 0);
471 gui_layout(id, 0, 0);
477 static void party_leave(int id)
482 static void party_paint(int id, float st)
488 static void party_timer(int id, float dt)
494 static void party_point(int id, int x, int y, int dx, int dy)
496 gui_pulse(gui_point(id, x, y), 1.2f);
499 static int party_click(int b, int d)
501 return (d && b < 0) ? party_action(gui_token(gui_click())) : 1;
504 static int party_buttn(int b, int d)
508 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
509 return party_action(gui_token(gui_click()));
510 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
511 return party_action(PARTY_B);
516 /*---------------------------------------------------------------------------*/
518 static int paused = 0;
520 static struct state *st_continue;
521 static struct state *st_quit;
523 #define PAUSE_CONTINUE 1
526 int goto_pause(struct state *s, int e)
528 if (e && (SDL_GetModState() & (KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_META)))
529 return goto_state(s);
530 st_continue = curr_state();
533 return goto_state(&st_pause);
536 static int pause_action(int i)
538 audio_play(AUD_MENU, 1.0f);
543 return goto_state(st_continue ? st_continue : &st_title);
546 return goto_state(st_quit);
551 static int pause_enter(void)
555 audio_music_fade_out(0.2f);
557 if ((id = gui_vstack(0)))
559 td = gui_label(id, _("Paused"), GUI_LRG, GUI_ALL, 0, 0);
562 if ((jd = gui_harray(id)))
564 gui_state(jd, _("Quit"), GUI_SML, PAUSE_QUIT, 0);
565 gui_start(jd, _("Continue"), GUI_SML, PAUSE_CONTINUE, 1);
569 gui_layout(id, 0, 0);
576 static void pause_leave(int id)
580 audio_music_fade_in(0.5f);
583 static void pause_paint(int id, float st)
590 static void pause_timer(int id, float dt)
596 static void pause_point(int id, int x, int y, int dx, int dy)
598 gui_pulse(gui_point(id, x, y), 1.2f);
601 static int pause_click(int b, int d)
603 return (d && b < 0) ? pause_action(gui_token(gui_click())) : 1;
606 static int pause_keybd(int c, int d)
608 if (d && config_tst_d(CONFIG_KEY_PAUSE, c))
609 return pause_action(PAUSE_CONTINUE);
613 static int pause_buttn(int b, int d)
617 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
618 return pause_action(gui_token(gui_click()));
619 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
620 return pause_action(PAUSE_CONTINUE);
625 /*---------------------------------------------------------------------------*/
627 static int shared_keybd(int c, int d)
631 if (c == SDLK_ESCAPE)
632 return goto_pause(&st_over, 1);
633 if (config_tst_d(CONFIG_KEY_PAUSE, c))
634 return goto_pause(&st_over, 0);
639 /*---------------------------------------------------------------------------*/
643 static int next_enter(void)
648 sprintf(str, _("Hole %02d"), curr_hole());
650 if ((id = gui_vstack(0)))
652 gui_label(id, str, GUI_MED, GUI_ALL, 0, 0);
655 gui_label(id, _("Player"), GUI_SML, GUI_TOP, 0, 0);
657 switch (curr_player())
660 gui_label(id, "1", GUI_LRG, GUI_BOT, gui_red, gui_wht);
661 if (curr_party() > 1) audio_play(AUD_PLAYER1, 1.f);
664 gui_label(id, "2", GUI_LRG, GUI_BOT, gui_grn, gui_wht);
665 if (curr_party() > 1) audio_play(AUD_PLAYER2, 1.f);
668 gui_label(id, "3", GUI_LRG, GUI_BOT, gui_blu, gui_wht);
669 if (curr_party() > 1) audio_play(AUD_PLAYER3, 1.f);
672 gui_label(id, "4", GUI_LRG, GUI_BOT, gui_yel, gui_wht);
673 if (curr_party() > 1) audio_play(AUD_PLAYER4, 1.f);
676 gui_layout(id, 0, 0);
688 static void next_leave(int id)
694 static void next_paint(int id, float st)
701 static void next_timer(int id, float dt)
707 static void next_point(int id, int x, int y, int dx, int dy)
709 gui_pulse(gui_point(id, x, y), 1.2f);
712 static int next_click(int b, int d)
714 return (d && b < 0) ? goto_state(&st_flyby) : 1;
717 static int next_keybd(int c, int d)
722 return goto_state(&st_poser);
723 if (config_tst_d(CONFIG_KEY_PAUSE, c))
724 return goto_pause(&st_over, 0);
729 return goto_state(&st_next);
731 if ('0' <= c && c <= '9')
732 num = num * 10 + c - '0';
737 static int next_buttn(int b, int d)
741 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
742 return goto_state(&st_flyby);
743 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
744 return goto_pause(&st_over, 1);
749 /*---------------------------------------------------------------------------*/
751 static int poser_enter(void)
757 static void poser_paint(int id, float st)
762 static int poser_buttn(int b, int d)
766 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
767 return goto_state(&st_next);
768 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
769 return goto_state(&st_next);
774 /*---------------------------------------------------------------------------*/
776 static int flyby_enter(void)
786 static void flyby_leave(int id)
791 static void flyby_paint(int id, float st)
797 static void flyby_timer(int id, float dt)
799 float t = time_state();
801 if (dt > 0.f && t > 1.f)
802 goto_state(&st_stroke);
804 game_set_fly(1.f - t);
810 static int flyby_click(int b, int d)
815 return goto_state(&st_stroke);
820 static int flyby_buttn(int b, int d)
824 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
827 return goto_state(&st_stroke);
829 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
830 return goto_pause(&st_over, 1);
835 /*---------------------------------------------------------------------------*/
837 static int stroke_rotate = 0;
838 static int stroke_mag = 0;
840 static int stroke_enter(void)
844 config_set_d(CONFIG_CAMERA, 2);
845 config_set_grab(!paused);
853 static void stroke_leave(int id)
857 config_set_d(CONFIG_CAMERA, 0);
860 static void stroke_paint(int id, float st)
866 static void stroke_timer(int id, float dt)
868 float g[3] = { 0.f, 0.f, 0.f };
872 if (SDL_GetModState() & (KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_META) ||
874 SDL_JoystickGetButton(joystick, config_get_d(CONFIG_JOYSTICK_BUTTON_B)))
879 game_set_rot(stroke_rotate * k);
880 game_set_mag(stroke_mag * k);
882 game_update_view(dt);
887 static void stroke_point(int id, int x, int y, int dx, int dy)
893 static void stroke_stick(int id, int a, int v)
895 if (v == 1) /* See 'loop' in main.c */
898 if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
899 stroke_rotate = (6 * v) / JOY_MAX;
900 else if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
901 stroke_mag = -((6 * v) / JOY_MAX);
904 static int stroke_click(int b, int d)
906 return (d && b < 0) ? goto_state(&st_roll) : 1;
909 static int stroke_buttn(int b, int d)
913 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
914 return goto_state(&st_roll);
915 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
916 return goto_pause(&st_over, 1);
921 /*---------------------------------------------------------------------------*/
923 static int roll_enter(void)
935 static void roll_leave(int id)
940 static void roll_paint(int id, float st)
946 static void roll_timer(int id, float dt)
948 float g[3] = { 0.0f, -9.8f, 0.0f };
950 switch (game_step(g, dt))
952 case GAME_STOP: goto_state(&st_stop); break;
953 case GAME_GOAL: goto_state(&st_goal); break;
954 case GAME_FALL: goto_state(&st_fall); break;
959 static int roll_buttn(int b, int d)
963 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
964 return goto_pause(&st_over, 1);
969 /*---------------------------------------------------------------------------*/
971 static int goal_enter(void)
975 if ((id = gui_label(0, _("It's In!"), GUI_MED, GUI_ALL, gui_grn, gui_grn)))
976 gui_layout(id, 0, 0);
988 static void goal_leave(int id)
994 static void goal_paint(int id, float st)
1001 static void goal_timer(int id, float dt)
1003 if (time_state() > 3)
1006 goto_state(&st_next);
1008 goto_state(&st_score);
1013 static int goal_click(int b, int d)
1015 if (b < 0 && d == 1)
1018 goto_state(&st_next);
1020 goto_state(&st_score);
1025 static int goal_buttn(int b, int d)
1029 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
1032 goto_state(&st_next);
1034 goto_state(&st_score);
1036 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
1037 return goto_pause(&st_over, 1);
1042 /*---------------------------------------------------------------------------*/
1044 static int stop_enter(void)
1056 static void stop_leave(int id)
1061 static void stop_paint(int id, float st)
1067 static void stop_timer(int id, float dt)
1069 float g[3] = { 0.f, 0.f, 0.f };
1071 game_update_view(dt);
1075 if (time_state() > 1)
1078 goto_state(&st_next);
1080 goto_state(&st_score);
1084 static int stop_click(int b, int d)
1086 if (b < 0 && d == 1)
1089 goto_state(&st_next);
1091 goto_state(&st_score);
1096 static int stop_buttn(int b, int d)
1100 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
1103 goto_state(&st_next);
1105 goto_state(&st_score);
1107 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
1108 return goto_pause(&st_over, 1);
1113 /*---------------------------------------------------------------------------*/
1115 static int fall_enter(void)
1119 if ((id = gui_label(0, _("1 Stroke Penalty"), GUI_MED, GUI_ALL, gui_blk, gui_red)))
1120 gui_layout(id, 0, 0);
1127 game_draw(0); /*TODO: is this call ok? */
1135 static void fall_leave(int id)
1141 static void fall_paint(int id, float st)
1148 static void fall_timer(int id, float dt)
1150 if (time_state() > 3)
1153 goto_state(&st_next);
1155 goto_state(&st_score);
1160 static int fall_click(int b, int d)
1162 if (b < 0 && d == 1)
1165 goto_state(&st_next);
1167 goto_state(&st_score);
1172 static int fall_buttn(int b, int d)
1176 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
1179 goto_state(&st_next);
1181 goto_state(&st_score);
1183 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
1184 return goto_pause(&st_over, 1);
1189 /*---------------------------------------------------------------------------*/
1191 static int score_enter(void)
1193 audio_music_fade_out(2.f);
1198 return score_card(_("Scores"), gui_yel, gui_red);
1201 static void score_leave(int id)
1206 static void score_paint(int id, float st)
1212 static void score_timer(int id, float dt)
1218 static int score_click(int b, int d)
1220 if (b < 0 && d == 1)
1223 return goto_state(&st_next);
1225 return goto_state(&st_title);
1230 static int score_buttn(int b, int d)
1234 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
1237 goto_state(&st_next);
1239 goto_state(&st_score);
1241 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
1242 return goto_pause(&st_over, 1);
1247 /*---------------------------------------------------------------------------*/
1249 static int over_enter(void)
1251 audio_music_fade_out(2.f);
1252 return score_card(_("Final Scores"), gui_yel, gui_red);
1255 static void over_leave(int id)
1260 static void over_paint(int id, float st)
1266 static void over_timer(int id, float dt)
1272 static int over_click(int b, int d)
1274 return (d && b < 0) ? goto_state(&st_title) : 1;
1277 static int over_buttn(int b, int d)
1281 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
1282 return goto_state(&st_title);
1283 if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
1284 return goto_state(&st_title);
1289 /*---------------------------------------------------------------------------*/
1291 struct state st_title = {
1304 struct state st_course = {
1317 struct state st_party = {
1330 struct state st_next = {
1343 struct state st_poser = {
1356 struct state st_flyby = {
1369 struct state st_stroke = {
1382 struct state st_roll = {
1395 struct state st_goal = {
1408 struct state st_stop = {
1421 struct state st_fall = {
1434 struct state st_score = {
1447 struct state st_over = {
1460 struct state st_pause = {