From: hgn Date: Mon, 10 Oct 2022 03:37:38 +0000 (+0100) Subject: fix uninitialized mem X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;ds=sidebyside;h=8bc80dc83f08a7016f1057f82d00727a2e417fa3;p=carveJwlIkooP6JGAAIwe30JlM.git fix uninitialized mem --- diff --git a/build.sh b/build.sh index 28ef0e7..0b95872 100755 --- a/build.sh +++ b/build.sh @@ -73,9 +73,9 @@ delay_run_game(){ } link_content(){ - ln -sr bin/content/textures/ $1/textures - ln -sr bin/content/models/ $1/models - ln -sr bin/content/sound/ $1/sound + ln -srf bin/content/textures $1/textures + ln -srf bin/content/models $1/models + ln -srf bin/content/sound $1/sound } TIMESTAMP=`date +%Y-%m-%d_%H-%M-%S` @@ -217,6 +217,7 @@ vg_command(){ tar -chzvf dist/skaterift_server__$TIMESTAMP.tar.gz bin/linux_server logit "Windows" tar -chzvf dist/skaterift_win32__$TIMESTAMP.tar.gz bin/win32/ + zip -r9 dist/skaterift_win32__$TIMESTAMP.zip bin/win32/ ;; # Runners # ======================================================================== diff --git a/models_src/mp_dev.mdl b/models_src/mp_dev.mdl index fc7c735..c5150fa 100644 Binary files a/models_src/mp_dev.mdl and b/models_src/mp_dev.mdl differ diff --git a/player.h b/player.h index 2c6ee19..25054e0 100644 --- a/player.h +++ b/player.h @@ -12,8 +12,8 @@ #include "bvh.h" static float - k_walkspeed = 7.0f, /* no longer used */ - k_runspeed = 14.0f, + k_walkspeed = 20.0f, /* no longer used */ + k_runspeed = 20.0f, k_board_radius = 0.3f, k_board_length = 0.45f, k_board_allowance = 0.04f, @@ -31,7 +31,7 @@ static float k_jump_force = 5.0f, k_pitch_limit = 1.5f, k_look_speed = 2.0f, - k_walk_accel = 5.0f, + k_walk_accel = 150.0f, k_walk_friction = 8.0f; static int freecam = 0; @@ -232,7 +232,7 @@ static void player_update_pre(void) { struct player_phys *phys = &player.phys; - if( vg_get_axis("grabl")>0.0f) + if( vg_get_button_down( "reset" ) ) { player.is_dead = 0; player_restore_frame(); @@ -252,6 +252,11 @@ static void player_update_pre(void) if( vg_get_button_down( "switchmode" ) ) { phys->on_board ^= 0x1; + + if( phys->on_board ) + { + v3_muladds( phys->rb.v, phys->rb.forward, 0.2f, phys->rb.v ); + } } } diff --git a/player_animation.h b/player_animation.h index e03c7cb..6f19b83 100644 --- a/player_animation.h +++ b/player_animation.h @@ -17,7 +17,7 @@ static void player_animate_offboard(void) float walk_norm = (float)player.mdl.anim_walk->length/30.0f, run_norm = (float)player.mdl.anim_run->length/30.0f, t = player.walk_timer, - l = vg_get_axis("grabr") * 0.5f + 0.5f; + l = vg_get_axis("grabl") * 0.5f + 0.5f; skeleton_sample_anim( sk, player.mdl.anim_walk, t*walk_norm, apose ); skeleton_sample_anim( sk, player.mdl.anim_run, t*run_norm, bpose ); diff --git a/player_physics.h b/player_physics.h index 553e5d7..7594f13 100644 --- a/player_physics.h +++ b/player_physics.h @@ -363,7 +363,7 @@ static void player_walk_physics(void) vg_line( phys->rb.co, p1, 0xff0000ff ); float move_dead = 0.1f, - move = vg_get_axis("grabr")*0.5f + 0.5f - move_dead; + move = vg_get_axis("grabl")*0.5f + 0.5f - move_dead; if( move > 0.0f ) { diff --git a/textures_src/graffitibox.png b/textures_src/graffitibox.png index 21c7573..ec92405 100644 Binary files a/textures_src/graffitibox.png and b/textures_src/graffitibox.png differ diff --git a/vg_config.h b/vg_config.h index c7655fe..e1784ec 100644 --- a/vg_config.h +++ b/vg_config.h @@ -25,7 +25,8 @@ static struct button_binding vg_controller_binds[] = { "push", GLFW_GAMEPAD_BUTTON_A }, { "break", GLFW_GAMEPAD_BUTTON_B }, { "switchmode", GLFW_GAMEPAD_BUTTON_Y }, - { "jump", GLFW_GAMEPAD_BUTTON_X } + { "jump", GLFW_GAMEPAD_BUTTON_X }, + { "reset", GLFW_GAMEPAD_BUTTON_LEFT_BUMPER } }; static struct axis_binding vg_axis_binds[] = diff --git a/world_routes.h b/world_routes.h index 1a51102..8f570d2 100644 --- a/world_routes.h +++ b/world_routes.h @@ -1015,6 +1015,7 @@ static void world_routes_loadfrom( mdl_header *mdl ) 1, sizeof( struct route ) ); struct route *route = &r->routes[r->route_count]; + memset( route, 0, sizeof(struct route) ); v3_copy( inf->colour, route->colour ); route->colour[3] = 1.0f;