/*---------------------------------------------------------------------------*/
-static void shared_stick(int id, int a, int v)
+static int shared_stick_basic(int id, int a, int v)
{
int jd = 0;
if (jd)
gui_pulse(jd, 1.2f);
+
+ return jd;
+}
+
+static void shared_stick(int id, int a, int v)
+{
+ shared_stick_basic(id, a, v);
}
/*---------------------------------------------------------------------------*/
gui_delete(id);
}
-static void title_paint(int id, float st)
+static void title_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
}
game_set_fly(fcosf(time_state() / 10.f));
gui_timer(id, dt);
- audio_timer(dt);
}
static void title_point(int id, int x, int y, int dx, int dy)
gui_delete(id);
}
-static void course_paint(int id, float st)
+static void course_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
}
static void course_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static void course_point(int id, int x, int y, int dx, int dy)
if ((jd = gui_point(id, x, y)))
{
int i = gui_token(jd);
+
+ if (course_exists(i))
+ {
+ gui_set_image(shot_id, course_shot(i));
+ gui_set_multi(desc_id, _(course_desc(i)));
+ }
+ gui_pulse(jd, 1.2f);
+ }
+}
+
+static void course_stick(int id, int a, int v)
+{
+ int jd;
+
+ if ((jd = shared_stick_basic(id, a, v)))
+ {
+ int i = gui_token(jd);
+
if (course_exists(i))
{
gui_set_image(shot_id, course_shot(i));
gui_delete(id);
}
-static void party_paint(int id, float st)
+static void party_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
}
static void party_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static void party_point(int id, int x, int y, int dx, int dy)
int goto_pause(struct state *s, int e)
{
- if (e && (SDL_GetModState() & KMOD_SHIFT))
+ if (curr_state() == &st_pause)
+ return 1;
+
+ if (e && !config_tst_d(CONFIG_KEY_PAUSE, SDLK_ESCAPE))
return goto_state(s);
st_continue = curr_state();
audio_music_fade_in(0.5f);
}
-static void pause_paint(int id, float st)
+static void pause_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
hud_paint();
}
static void pause_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static void pause_point(int id, int x, int y, int dx, int dy)
{
if (d)
{
- if (c == SDLK_ESCAPE)
- return goto_pause(&st_over, 1);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
return goto_pause(&st_over, 0);
}
gui_delete(id);
}
-static void next_paint(int id, float st)
+static void next_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
hud_paint();
gui_paint(id);
}
static void next_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static void next_point(int id, int x, int y, int dx, int dy)
return goto_state(&st_poser);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
return goto_pause(&st_over, 0);
- if (c == SDLK_c)
- {
- hole_goto(num, -1);
- num = 0;
- return goto_state(&st_next);
- }
if ('0' <= c && c <= '9')
num = num * 10 + c - '0';
}
if (d)
{
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_A, b))
+ {
+ if (num > 0)
+ {
+ hole_goto(num, -1);
+ num = 0;
+ return goto_state(&st_next);
+ }
return goto_state(&st_flyby);
+ }
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
return goto_pause(&st_over, 1);
}
return 0;
}
-static void poser_paint(int id, float st)
+static void poser_paint(int id, float t)
{
- game_draw(1);
+ game_draw(1, t);
}
static int poser_buttn(int b, int d)
hud_free();
}
-static void flyby_paint(int id, float st)
+static void flyby_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
hud_paint();
}
game_set_fly(1.f - t);
gui_timer(id, dt);
- audio_timer(dt);
}
static int flyby_click(int b, int d)
config_set_d(CONFIG_CAMERA, 0);
}
-static void stroke_paint(int id, float st)
+static void stroke_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
hud_paint();
}
game_update_view(dt);
game_step(g, dt);
- audio_timer(dt);
}
static void stroke_point(int id, int x, int y, int dx, int dy)
hud_free();
}
-static void roll_paint(int id, float st)
+static void roll_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
hud_paint();
}
case GAME_GOAL: goto_state(&st_goal); break;
case GAME_FALL: goto_state(&st_fall); break;
}
- audio_timer(dt);
}
static int roll_buttn(int b, int d)
hud_free();
}
-static void goal_paint(int id, float st)
+static void goal_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
hud_paint();
}
else
goto_state(&st_score);
}
- audio_timer(dt);
}
static int goal_click(int b, int d)
hud_free();
}
-static void stop_paint(int id, float st)
+static void stop_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
hud_paint();
}
game_update_view(dt);
game_step(g, dt);
- audio_timer(dt);
if (time_state() > 1)
{
else
{
hole_fall();
- game_draw(0); /*TODO: is this call ok? */
+/* game_draw(0);*/ /*TODO: is this call ok? */ /* No, it's not. */
}
hud_init();
hud_free();
}
-static void fall_paint(int id, float st)
+static void fall_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
hud_paint();
}
else
goto_state(&st_score);
}
- audio_timer(dt);
}
static int fall_click(int b, int d)
gui_delete(id);
}
-static void score_paint(int id, float st)
+static void score_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
}
static void score_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static int score_click(int b, int d)
gui_delete(id);
}
-static void over_paint(int id, float st)
+static void over_paint(int id, float t)
{
- game_draw(0);
+ game_draw(0, t);
gui_paint(id);
}
static void over_timer(int id, float dt)
{
gui_timer(id, dt);
- audio_timer(dt);
}
static int over_click(int b, int d)
title_timer,
title_point,
shared_stick,
+ NULL,
title_click,
NULL,
title_buttn,
course_paint,
course_timer,
course_point,
- shared_stick,
+ course_stick,
+ NULL,
course_click,
NULL,
course_buttn,
party_timer,
party_point,
shared_stick,
+ NULL,
party_click,
NULL,
party_buttn,
next_timer,
next_point,
shared_stick,
+ NULL,
next_click,
next_keybd,
next_buttn,
NULL,
NULL,
NULL,
+ NULL,
poser_buttn,
1, 0
};
flyby_timer,
NULL,
NULL,
+ NULL,
flyby_click,
shared_keybd,
flyby_buttn,
stroke_timer,
stroke_point,
stroke_stick,
+ NULL,
stroke_click,
shared_keybd,
stroke_buttn,
NULL,
NULL,
NULL,
+ NULL,
shared_keybd,
roll_buttn,
0, 0
goal_timer,
NULL,
NULL,
+ NULL,
goal_click,
shared_keybd,
goal_buttn,
stop_timer,
NULL,
NULL,
+ NULL,
stop_click,
shared_keybd,
stop_buttn,
fall_timer,
NULL,
NULL,
+ NULL,
fall_click,
shared_keybd,
fall_buttn,
score_timer,
NULL,
NULL,
+ NULL,
score_click,
shared_keybd,
score_buttn,
over_timer,
NULL,
NULL,
+ NULL,
over_click,
NULL,
over_buttn,
pause_timer,
pause_point,
shared_stick,
+ NULL,
pause_click,
pause_keybd,
pause_buttn,