Example #1
0
  void
GameOver::loop(float timeStep)
{
  int width, height;
  width = getparam_x_resolution();
  height = getparam_y_resolution();

  /* Check joystick */
  if ( is_joystick_active() ) {
    update_joystick();

    if ( is_joystick_continue_button_down() )
    {
      if ( gameMgr->gametype != GameMgr::PRACTICING ) {
        set_game_mode( EVENT_RACE_SELECT );
      }else{
        set_game_mode( RACE_SELECT );
      }
      winsys_post_redisplay();
      return;
    }
  }
  fpsCounter.update();

  update_audio();

  clear_rendering_context();

  fogPlane.setup();
  update_player_pos( players[0], 0 );
  update_view( players[0], 0 );

  setup_view_frustum( players[0], NEAR_CLIP_DIST, 
      getparam_forward_clip_distance() );

  draw_sky(players[0].view.pos);
  draw_fog_plane();

  set_course_clipping( true );
  set_course_eye_point( players[0].view.pos );
  setup_course_lighting();
  render_course();
  draw_trees();
  if ( getparam_draw_particles() ) {
    draw_particles( players[0] );
  }

  ModelHndl->draw_tux();
  draw_tux_shadow();
  set_gl_options( GUI );

  UIMgr.setupDisplay();
  UIMgr.draw();

  HUD1.draw(players[0]);
  reshape( width, height );

  winsys_swap_buffers();
}
Example #2
0
void game_over_loop( scalar_t time_step )
{
    player_data_t *plyr = get_player_data( local_player() );
    int width, height;
    width = getparam_x_resolution();
    height = getparam_y_resolution();

    check_gl_error();

    /* Check joystick */
    if ( is_joystick_active() ) {
        update_joystick();

        if ( is_joystick_continue_button_down() )
        {
            set_game_mode( NEXT_MODE );
            winsys_post_redisplay();
            return;
        }
    }

    new_frame_for_fps_calc();

    update_audio();

    clear_rendering_context();

    setup_fog();

    update_player_pos( plyr, 0 );
    update_view( plyr, 0 );

    setup_view_frustum( plyr, NEAR_CLIP_DIST,
                        getparam_forward_clip_distance() );

    draw_sky(plyr->view.pos);

    draw_fog_plane();

    set_course_clipping( True );
    set_course_eye_point( plyr->view.pos );
    setup_course_lighting();
    render_course();
    draw_trees();

    if ( getparam_draw_particles() ) {
        draw_particles( plyr );
    }

    draw_tux();
    draw_tux_shadow();

    set_gl_options( GUI );

    ui_setup_display();

    draw_game_over_text();

#ifndef __APPLE__
    draw_hud( plyr );
#endif
    draw_hud_training(plyr);
    reshape( width, height );

    winsys_swap_buffers();
}