Beispiel #1
0
static void playback_start (char *file)
{
    char buffer[1024];

    sprintf (buffer, "recordings/%s", file);
    playback_free ();
    if (record_load (buffer))
    {
        playback_stop ();
        gamestate = GAME_AMODE;
        return;
    }
/*
    if (playback_dump ())
    {
        playback_stop ();
        gamestate = GAME_AMODE;
        return;
    }
    playback_dump2 (buffer);
*/
    frame_counter = 0;
    rec_buffer_counter = 0;
    record_state = REC_PLAYING;
    input_mask = 0;
    fprintf (stdout, "Starting playback\n");
    gamestate = GAME_RUNNING;
    game_start ();
}
Beispiel #2
0
void update(void) {
    All * a = global_a;
#line 175
    if (land_was_resized()) {
#line 177
        viewport_update(game->viewport, land_display_width(), land_display_height());
        a->resize_in_ticks = 10;
    }
    if (a->resize_in_ticks > 0) {
        a->resize_in_ticks--;
        if (a->resize_in_ticks == 0) {
            reload_fonts();
        }
    }
#line 185
    if (a->load_after_redraw) {
        if (a->load_after_redraw == 2) {
#line 188
            load_level(a->editor || game->record->is_replaying || game->record->is_recording);
            if (a->find_entrance) {
                a->find_entrance = 0;
                if (game->player) {
                    player_find_entrance(& game->player->super);
                }
            }
#line 193
            if (game && game->player) {
#line 195
                record_load(game->record, game->level, game->player->super.x, game->player->super.y, game->player->super.z);
            }
#line 196
            a->load_after_redraw++;
        }
#line 196
        return ;
    }
#line 199
    config_check_controls(a);
#line 201
    if (a->title) {
        title_tick();
    }
#line 202
    else {
#line 204
        game_tick(game);
    }
}