[Tuxracer-checkins] CVS: tuxracer/src racing.c,1.20,1.21
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-09-14 01:23:08
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv15431 Modified Files: racing.c Log Message: Re-structured some of the player initialization code. Index: racing.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/racing.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** racing.c 2000/09/11 04:34:17 1.20 --- racing.c 2000/09/14 01:23:05 1.21 *************** *** 74,98 **** glutMouseFunc( NULL ); ! if ( g_game.prev_mode != PAUSED ) { ! g_game.time = 0.0; init_physical_simulation(); - clear_particles(); - - /* Initialize view */ - set_view_mode( plyr, ABOVE ); - update_view( plyr, EPS ); - - if ( getparam_view_mode() < 0 || - getparam_view_mode() >= NUM_VIEW_MODES ) - { - setparam_view_mode( ABOVE ); - } - set_view_mode( plyr, getparam_view_mode() ); - - left_turn = right_turn = paddling = False; - left_roll = right_roll = False; - roll_modifier = False; - charging = jumping = flying = False; } --- 74,102 ---- glutMouseFunc( NULL ); ! /* Initialize view */ ! if ( getparam_view_mode() < 0 || ! getparam_view_mode() >= NUM_VIEW_MODES ) ! { ! setparam_view_mode( ABOVE ); ! } ! set_view_mode( plyr, getparam_view_mode() ); + /* We need to reset controls here since callbacks won't have been + called in paused mode. This results in duplication between this + code and init_physical_simulation. Oh well. */ + left_turn = right_turn = paddling = False; + left_roll = right_roll = False; + roll_modifier = False; + charging = jumping = flying = False; + plyr->control.turn_fact = 0.0; + plyr->control.roll_factor = 0.0; + plyr->control.is_braking = False; + plyr->control.is_paddling = False; + plyr->control.jumping = False; + plyr->control.flying = False; + plyr->control.jump_charging = False; + + if ( g_game.prev_mode != PAUSED ) { init_physical_simulation(); } *************** *** 324,332 **** draw_trees(); - - draw_tux(); - draw_tux_shadow(); - - if ( getparam_draw_particles() ) { update_particles( time_step ); --- 328,331 ---- *************** *** 337,341 **** } ! print_fps(); draw_hud( plyr ); --- 336,342 ---- } ! draw_tux(); ! draw_tux_shadow(); ! draw_hud( plyr ); *************** *** 474,484 **** status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, ! "1", getparam_above_view_key, above_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, "2", getparam_follow_view_key, follow_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, ! "3", getparam_behind_view_key, ! behind_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, --- 475,485 ---- status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, ! "1", getparam_behind_view_key, ! behind_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, "2", getparam_follow_view_key, follow_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, ! "3", getparam_above_view_key, above_view_cb ); status |= add_keymap_entry( RACING, CONFIGURABLE_KEY, |