Example #1
0
static int demo_play_enter(struct state *st, struct state *prev)
{
    video_hide_cursor();

    if (demo_paused)
    {
        demo_paused = 0;
        prelude = 0;
        audio_music_fade_in(0.5f);
        return 0;
    }

    /*
     * Post-1.5.1 replays include view data in the first update, this
     * line is currently left in for compatibility with older replays.
     */
    game_client_fly(0.0f);

    if (check_compat && !game_compat_map)
    {
        goto_state(&st_demo_compat);
        return 0;
    }

    prelude = 1.0f;

    speed = SPEED_NORMAL;
    demo_replay_speed(speed);

    show_hud = 1;
    hud_update(0);
    hud_demo();

    return demo_play_gui();
}
Example #2
0
static int pause_enter(struct state *st, struct state *prev)
{
    st_continue = prev;

    video_clr_grab();
    audio_pause(1);

    hud_update(0);

    return pause_gui();
}
Example #3
0
static int play_loop_enter(struct state *st, struct state *prev)
{
    rot_init();
    fast_rotate = 0;

    if (prev == &st_pause)
        return 0;

    audio_play(AUD_GO, 1.f);

    game_client_fly(0.0f);

    show_hud = 1;
    hud_update(0);

    return play_loop_gui();
}
Example #4
0
static int demo_play_enter(void)
{
    int id;

    if (demo_paused)
    {
        demo_paused = 0;
        audio_music_fade_in(0.5f);
        return 0;
    }

    /*
     * Post-1.5.1 replays include view data in the first update, these
     * two lines are currently left in for compatibility with older
     * replays.
     */

    game_set_fly(0.f, game_client_file());
    game_client_step(NULL);

    if (check_compat && !game_compat_map)
    {
        goto_state(&st_demo_compat);
        return 0;
    }

    if ((id = gui_vstack(0)))
    {
        gui_label(id, _("Replay"), GUI_LRG, GUI_ALL, gui_blu, gui_grn);
        gui_layout(id, 0, 0);
        gui_pulse(id, 1.2f);
    }

    show_hud = 1;
    hud_update(0);

    return id;
}