fix uninitialized mem
authorhgn <hgodden00@gmail.com>
Mon, 10 Oct 2022 03:37:38 +0000 (04:37 +0100)
committerhgn <hgodden00@gmail.com>
Mon, 10 Oct 2022 03:37:38 +0000 (04:37 +0100)
build.sh
models_src/mp_dev.mdl
player.h
player_animation.h
player_physics.h
textures_src/graffitibox.png
vg_config.h
world_routes.h

index 28ef0e739fab6865581b86599ad2c081c4037d05..0b958721a60804f5854e175e43499f9694830e6a 100755 (executable)
--- 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
       # ========================================================================
index fc7c735b64bc6af44df3bef72f8004c9ff0369d5..c5150faaa959a09cacd1c63d73fba3837c39f49c 100644 (file)
Binary files a/models_src/mp_dev.mdl and b/models_src/mp_dev.mdl differ
index 2c6ee19ef51b94e21e9df556a6ce0bb6a51f2d4c..25054e03f38db5040af9c9437364e99d9a4adc71 100644 (file)
--- 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 );
+      }
    }
 }
 
index e03c7cb309c748df94f507174c7e89b38a2d5844..6f19b83b7a34687b3cab17640b5c0eca6f828c3d 100644 (file)
@@ -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 );
index 553e5d7abb8df868a8556272eee1fc59211e6f0f..7594f13a50efe078ec2dc439fe5e4b124d9b1bde 100644 (file)
@@ -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 )
    {
index 21c757346b00f870da5a49723de39eef9e9d8cf0..ec924057c6209de8722f85d554299a16be7d94a0 100644 (file)
Binary files a/textures_src/graffitibox.png and b/textures_src/graffitibox.png differ
index c7655fedae8be44cc6fd4921de94750dc9dac23a..e1784ec1900b06100609e2093ddfca995b5d6b09 100644 (file)
@@ -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[] = 
index 1a51102f08f39f1cbec769e27af032502bfe8e7d..8f570d20689cbb0546c8bd8f5694c63bfae7116f 100644 (file)
@@ -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;