Esempio n. 1
0
// ---------------------------- init ----------------------------------
void racing_init (void) {
    CControl *ctrl = Players.GetCtrl (g_game.player_id);

    if (param.view_mode < 0 || param.view_mode >= NUM_VIEW_MODES) {
		param.view_mode = ABOVE;
    }
    set_view_mode (ctrl, (TViewMode)param.view_mode);
    left_turn = right_turn = trick_modifier = false;

    ctrl->turn_fact = 0.0;
    ctrl->turn_animation = 0.0;
    ctrl->is_braking = false;
    ctrl->is_paddling = false;
    ctrl->jumping = false;
    ctrl->jump_charging = false;

	lastsound = -1;
	newsound = -1;

    if (g_game.prev_mode != PAUSED) ctrl->Init ();
    g_game.raceaborted = false;

	SetSoundVolumes ();
	Music.PlayTheme (g_game.theme_id, MUS_RACING);
	
	g_game.fps = 0;
	g_game.timesteps = 0;
	g_game.finish = false;
}
Esempio n. 2
0
// ---------------------------- init ----------------------------------
void CRacing::Enter (void) {
    CControl *ctrl = Players.GetCtrl (g_game.player_id);

    if (param.view_mode < 0 || param.view_mode >= NUM_VIEW_MODES) {
		param.view_mode = ABOVE;
    }
    set_view_mode (ctrl, (TViewMode)param.view_mode);
    left_turn = right_turn = trick_modifier = false;

    ctrl->turn_fact = 0.0;
    ctrl->turn_animation = 0.0;
    ctrl->is_braking = false;
    ctrl->is_paddling = false;
    ctrl->jumping = false;
    ctrl->jump_charging = false;

	lastsound = -1;
	newsound = -1;

	if (State::manager.PreviousState() != &Paused) ctrl->Init ();
    g_game.raceaborted = false;

	SetSoundVolumes ();
	Music.PlayTheme (g_game.theme_id, MUS_RACING);

	g_game.finish = false;
}