[Tuxracer-checkins] CVS: tuxracer/src ui_snow.c,1.2,1.3
Status: Beta
Brought to you by:
jfpatry
From: Jasmin P. <jf...@us...> - 2000-10-02 04:23:29
|
Update of /cvsroot/tuxracer/tuxracer/src In directory slayer.i.sourceforge.net:/tmp/cvs-serv14391 Modified Files: ui_snow.c Log Message: - Added proper initialization check - Added maximum push velocity Index: ui_snow.c =================================================================== RCS file: /cvsroot/tuxracer/tuxracer/src/ui_snow.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** ui_snow.c 2000/10/01 19:59:56 1.2 --- ui_snow.c 2000/10/02 04:23:25 1.3 *************** *** 37,41 **** #define PUSH_DIST_DECAY 100 #define PUSH_FACTOR 0.5 ! #define MAX_PUSH_FORCE 100 #define WIND_FORCE 0.03 #define AIR_DRAG 0.4 --- 37,41 ---- #define PUSH_DIST_DECAY 100 #define PUSH_FACTOR 0.5 ! #define MAX_PUSH_FORCE 5 #define WIND_FORCE 0.03 #define AIR_DRAG 0.4 *************** *** 60,63 **** --- 60,64 ---- static point2d_t last_push_position; static scalar_t last_update_time = -1; + static bool_t push_position_initialized = False; static scalar_t frand() *************** *** 119,123 **** push_timestep = 0; ! if ( last_update_time > 0 ) { push_vector.x = push_position.x - last_push_position.x; push_vector.y = push_position.y - last_push_position.y; --- 120,124 ---- push_timestep = 0; ! if ( push_position_initialized ) { push_vector.x = push_position.x - last_push_position.x; push_vector.y = push_position.y - last_push_position.y; *************** *** 274,277 **** --- 275,279 ---- pos.y/(scalar_t)yres ); last_push_position = push_position; + push_position_initialized = True; } *************** *** 285,288 **** --- 287,294 ---- push_position = make_point2d( pos.x/(scalar_t)xres, pos.y/(scalar_t)yres ); + if ( !push_position_initialized ) { + last_push_position = push_position; + } + push_position_initialized = True; } |