[Tuxracer-checkins] CVS: tuxracer/src credits.c,1.4,1.5 event_select.c,1.8,1.9 game_over.c,1.18,1.19
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-10-01 19:55:44
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv6871 Modified Files: credits.c event_select.c game_over.c intro.c paused.c race_select.c Log Message: Added joystick support to selected screens. Can now press the continue button to move past intro, paused screen, and game over screen. Other screens will have to wait for better joystick infrastructure (need joystick buttonpress callbacks). Index: credits.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/credits.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** credits.c 2000/10/01 17:58:40 1.4 --- credits.c 2000/10/01 19:55:39 1.5 *************** *** 40,43 **** --- 40,44 ---- #include "ui_theme.h" #include "ui_snow.h" + #include "joystick.h" #define CREDITS_MAX_Y -140 Index: event_select.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/event_select.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** event_select.c 2000/10/01 18:00:02 1.8 --- event_select.c 2000/10/01 19:55:39 1.9 *************** *** 36,39 **** --- 36,40 ---- #include "save.h" #include "ui_snow.h" + #include "joystick.h" static listbox_t *event_listbox = NULL; Index: game_over.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/game_over.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** game_over.c 2000/09/26 14:57:16 1.18 --- game_over.c 2000/10/01 19:55:39 1.19 *************** *** 38,45 **** --- 38,56 ---- #include "fonts.h" #include "ui_mgr.h" + #include "joystick.h" + #include "part_sys.h" + #define NEXT_MODE RACE_SELECT + static bool_t aborted = False; static bool_t race_won = False; + static void mouse_cb( int button, int state, int x, int y ) + { + set_game_mode( NEXT_MODE ); + glutPostRedisplay(); + } + + /*---------------------------------------------------------------------------*/ /*! *************** *** 198,204 **** { glutDisplayFunc( main_loop ); ! glutIdleFunc( NULL ); glutReshapeFunc( reshape ); ! glutMouseFunc( ui_event_mouse_func ); glutMotionFunc( ui_event_motion_func ); glutPassiveMotionFunc( ui_event_motion_func ); --- 209,215 ---- { glutDisplayFunc( main_loop ); ! glutIdleFunc( main_loop ); glutReshapeFunc( reshape ); ! glutMouseFunc( mouse_cb ); glutMotionFunc( ui_event_motion_func ); glutPassiveMotionFunc( ui_event_motion_func ); *************** *** 231,234 **** --- 242,257 ---- check_gl_error(); + /* Check joystick */ + if ( is_joystick_active() ) { + update_joystick(); + + if ( is_joystick_continue_button_down() ) + { + set_game_mode( NEXT_MODE ); + glutPostRedisplay(); + return; + } + } + new_frame_for_fps_calc(); *************** *** 239,244 **** setup_fog(); ! update_player_pos( plyr, EPS ); ! update_view( plyr, EPS ); setup_view_frustum( plyr, NEAR_CLIP_DIST, --- 262,267 ---- setup_fog(); ! update_player_pos( plyr, 0 ); ! update_view( plyr, 0 ); setup_view_frustum( plyr, NEAR_CLIP_DIST, *************** *** 254,257 **** --- 277,284 ---- draw_trees(); + if ( getparam_draw_particles() ) { + draw_particles( plyr ); + } + draw_tux(); draw_tux_shadow(); *************** *** 273,277 **** { if ( release ) return; ! set_game_mode( RACE_SELECT ); glutPostRedisplay(); } --- 300,304 ---- { if ( release ) return; ! set_game_mode( NEXT_MODE ); glutPostRedisplay(); } Index: intro.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/intro.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** intro.c 2000/09/25 14:29:44 1.17 --- intro.c 2000/10/01 19:55:39 1.18 *************** *** 37,41 **** --- 37,56 ---- #include "part_sys.h" #include "course_load.h" + #include "joystick.h" + static void abort_intro( player_data_t *plyr ) { + point2d_t start_pt = get_start_pt(); + + set_game_mode( RACING ); + + plyr->orientation_initialized = False; + plyr->view.initialized = False; + + plyr->pos.x = start_pt.x; + plyr->pos.z = start_pt.y; + + glutPostRedisplay(); + } + void intro_init() { *************** *** 102,105 **** --- 117,130 ---- check_gl_error(); + /* Check joystick */ + if ( is_joystick_active() ) { + update_joystick(); + + if ( is_joystick_continue_button_down() ) { + abort_intro( plyr ); + return; + } + } + new_frame_for_fps_calc(); *************** *** 138,154 **** START_KEYBOARD_CB( intro_cb ) { - point2d_t start_pt = get_start_pt(); - if ( release ) return; ! set_game_mode( RACING ); ! ! plyr->orientation_initialized = False; ! plyr->view.initialized = False; ! ! plyr->pos.x = start_pt.x; ! plyr->pos.z = start_pt.y; ! ! glutPostRedisplay(); } END_KEYBOARD_CB --- 163,169 ---- START_KEYBOARD_CB( intro_cb ) { if ( release ) return; ! abort_intro( plyr ); } END_KEYBOARD_CB Index: paused.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/paused.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** paused.c 2000/09/26 14:57:44 1.13 --- paused.c 2000/10/01 19:55:39 1.14 *************** *** 39,44 **** --- 39,53 ---- #include "fonts.h" #include "ui_mgr.h" + #include "joystick.h" + #define NEXT_MODE RACING + static void mouse_cb( int button, int state, int x, int y ) + { + set_game_mode( NEXT_MODE ); + glutPostRedisplay(); + } + + /*---------------------------------------------------------------------------*/ /*! *************** *** 87,93 **** { glutDisplayFunc( main_loop ); ! glutIdleFunc( NULL ); glutReshapeFunc( reshape ); ! glutMouseFunc( ui_event_mouse_func ); glutMotionFunc( ui_event_motion_func ); glutPassiveMotionFunc( ui_event_motion_func ); --- 96,102 ---- { glutDisplayFunc( main_loop ); ! glutIdleFunc( main_loop ); glutReshapeFunc( reshape ); ! glutMouseFunc( mouse_cb ); glutMotionFunc( ui_event_motion_func ); glutPassiveMotionFunc( ui_event_motion_func ); *************** *** 105,108 **** --- 114,129 ---- check_gl_error(); + /* Check joystick */ + if ( is_joystick_active() ) { + update_joystick(); + + if ( is_joystick_continue_button_down() ) + { + set_game_mode( NEXT_MODE ); + glutPostRedisplay(); + return; + } + } + new_frame_for_fps_calc(); *************** *** 113,118 **** setup_fog(); ! update_player_pos( plyr, EPS ); ! update_view( plyr, EPS ); setup_view_frustum( plyr, NEAR_CLIP_DIST, --- 134,139 ---- setup_fog(); ! update_player_pos( plyr, 0 ); ! update_view( plyr, 0 ); setup_view_frustum( plyr, NEAR_CLIP_DIST, *************** *** 141,148 **** draw_paused_text(); - reshape( width, height ); - draw_hud( plyr ); glutSwapBuffers(); } --- 162,169 ---- draw_paused_text(); draw_hud( plyr ); + reshape( width, height ); + glutSwapBuffers(); } *************** *** 151,155 **** { if ( release ) return; ! set_game_mode( RACING ); glutPostRedisplay(); } --- 172,176 ---- { if ( release ) return; ! set_game_mode( NEXT_MODE ); glutPostRedisplay(); } Index: race_select.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/race_select.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** race_select.c 2000/10/01 18:00:02 1.12 --- race_select.c 2000/10/01 19:55:39 1.13 *************** *** 39,42 **** --- 39,43 ---- #include "game_logic_util.h" #include "ui_snow.h" + #include "joystick.h" static textarea_t *desc_ta = NULL; |