cv_view_verts += [(v1[0],v1[1],v1[2])]
cv_view_colours += [(0,1,1,1),(0,1,1,1)]
#}
+
+ cv_draw_sphere( obj.location, 20.0, [0.1,0,0.9,0.4] )
#}
@staticmethod
#}
#}
+class classtype_spawn_link(Structure):
+#{
+ _pack_ = 1
+ _fields_ = [("connections",c_uint32*4)]
+
+ def encode_obj(_, node,node_def ):
+ #{
+ node.classtype = 0
+ #}
+
+ @staticmethod
+ def editor_interface( layout, obj ):
+ #{
+ pass
+ #}
+
+ @staticmethod
+ def draw_scene_helpers( obj ):
+ #{
+ global cv_view_verts, cv_view_colours
+
+ count = 0
+
+ for obj1 in bpy.context.collection.objects:
+ #{
+ if (obj1.cv_data.classtype != 'classtype_spawn_link') and \
+ (obj1.cv_data.classtype != 'classtype_spawn') :
+ continue
+
+ if (obj1.location - obj.location).length < 40.0:
+ #{
+ cv_draw_line( obj.location, obj1.location, [1,1,1,1] )
+ count +=1
+ #}
+
+ if count == 4:
+ break
+ #}
+
+ cv_draw_sphere( obj.location, 20.0, [0.5,0,0.2,0.4] )
+ #}
+#}
+
# ---------------------------------------------------------------------------- #
# #
# Compiler section #
('classtype_trigger',"classtype_trigger","",100),
('classtype_logic_achievement',"classtype_logic_achievement","",101),
('classtype_logic_relay',"classtype_logic_relay","",102),
+ ('classtype_spawn_link',"classtype_spawn_link","",150),
])
#}
vg_linear_alloc( vg_mem.rtmemory,
playerinfo_pool_size * sizeof(highscore_playerinfo) );
+ memset( sys->data, 0, pool_size*sizeof(highscore_record) );
+ memset( sys->playerinfo_data, 0,
+ playerinfo_pool_size*sizeof(highscore_playerinfo) );
+
/* This is ugly.. too bad! */
sys->aainfo.base = highscore_system.data;
VG_STATIC float menu_fov_target = 97.0f;
VG_STATIC v2f menu_extra_angles;
-VG_STATIC int menu_loc = 1,
+VG_STATIC int menu_loc = 0xb,
menu_loc_last = 1;
VG_STATIC u32 menu_page = 0;
VG_STATIC void menu_btn_map_b( int event );
VG_STATIC void menu_btn_map_c( int event );
VG_STATIC void menu_btn_fuckoff( int event );
+VG_STATIC void menu_btn_reset( int event );
struct menu_button
{
VG_STATIC menu_buttons[] =
{
/*0*/{"text_paused", 1, menu_btn_paused },
-/*1*/{"text_quit", 9, menu_btn_quit, {3,-1,4,2}},
-/*2*/{"text_skater", 3, menu_btn_skater, {3,1,4,-1}},
-/*3*/{"text_map", 5, menu_btn_map, {-1,-1,2,-1}},
+/*1*/{"text_quit", 9, menu_btn_quit, {3,-1,4,0xb}},
+/*2*/{"text_skater", 3, menu_btn_skater, {3,0xb,4,-1}},
+/*3*/{"text_map", 5, NULL, {-1,-1,2,-1}},
/*4*/{"text_about_game", 1, NULL, {2,-1,-1,-1}},
/*5*/{"skater_left", 2, NULL, {-1,-1,-1,-1}},
/*6*/{"skater_right", 2, NULL, {-1,-1,-1,-1}},
-/*7*/{"map_a", 4, menu_btn_map_a,{8, -1, 9, 9 }},
-/*8*/{"map_b", 4, menu_btn_map_b,{-1,7,7,-1}},
-/*9*/{"map_c", 4, menu_btn_map_c,{7,7,-1,8}},
-/*a*/{"g_map", 5, NULL },
-/*b*/{"g_controls", 1, NULL },
-/*c*/{"text_quitty", 8, NULL },
-/*d*/{"text_yes", 8, menu_btn_fuckoff,{-1,-1,-1,-1} },
+/*7*/{"g_map", 5, NULL },
+/*8*/{"g_controls", 1, NULL },
+/*9*/{"text_quitty", 8, NULL },
+/*a*/{"text_yes", 8, menu_btn_fuckoff,{-1,-1,-1,-1} },
+/*b*/{"text_reset", 1, menu_btn_reset,{3,1,4,2} },
};
VG_STATIC void menu_btn_map_a( int event ){}
}
+VG_STATIC void menu_btn_reset( int event )
+{
+ reset_player(0,NULL);
+ world_routes_clear();
+
+ cl_menu_go_away = 1;
+ menu_page = 0;
+}
+
VG_STATIC void menu_btn_fuckoff( int event )
{
glfwSetWindowShouldClose( vg.window, 1 );
VG_STATIC void menu_btn_quit( int event )
{
menu_page = 0x8;
- menu_loc = 0xd;
+ menu_loc = 0xa;
}
VG_STATIC void menu_btn_map( int event )
if( (fabsf(h) > 0.7f) && (menu_input_cooldown <= 0.0f) )
{
+ audio_lock();
+ audio_play_oneshot( &audio_rewind[4], 1.0f );
+ audio_unlock();
+
if( h < 0.0f )
{
cl_playermdl_id --;
if( vg_get_button_down( "reset" ) )
{
- double delta = world.time - world.last_use;
-
- if( (delta <= RESET_MAX_TIME) && (world.last_use != 0.0) )
+ if( player.is_dead )
{
- player.rewinding = 1;
- player.rewind_sound_wait = 1;
- player.rewind_time = (float)player.rewind_length - 0.0001f;
- player_save_rewind_frame();
+ reset_player( 0, NULL );
audio_lock();
- audio_play_oneshot( &audio_rewind[0], 1.0f );
+ audio_play_oneshot( &audio_ui[0], 1.0f );
audio_unlock();
+ }
+ else
+ {
+ double delta = world.time - world.last_use;
- /* based on analytical testing. DONT CHANGE!
- *
- * time taken: y = (x^(4/5)) * 74.5
- * inverse : x = (2/149)^(4/5) * y^(4/5)
- */
-
- float constant = powf( 2.0f/149.0f, 4.0f/5.0f ),
- curve = powf( player.rewind_total_length, 4.0f/5.0f );
-
- player.rewind_predicted_time = constant * curve;
- player.diag_rewind_start = vg.time;
- player.diag_rewind_time = player.rewind_time;
+ if( (delta <= RESET_MAX_TIME) && (world.last_use != 0.0) )
+ {
+ player.rewinding = 1;
+ player.rewind_sound_wait = 1;
+ player.rewind_time = (float)player.rewind_length - 0.0001f;
+ player_save_rewind_frame();
+ audio_lock();
+ audio_play_oneshot( &audio_rewind[0], 1.0f );
+ audio_unlock();
+
+ /* based on analytical testing. DONT CHANGE!
+ *
+ * time taken: y = (x^(4/5)) * 74.5
+ * inverse : x = (2/149)^(4/5) * y^(4/5)
+ */
+
+ float constant = powf( 2.0f/149.0f, 4.0f/5.0f ),
+ curve = powf( player.rewind_total_length, 4.0f/5.0f );
+
+ player.rewind_predicted_time = constant * curve;
+ player.diag_rewind_start = vg.time;
+ player.diag_rewind_time = player.rewind_time;
- player.is_dead = 0;
- player.death_tick_allowance = 30;
- player_restore_frame();
+ player.is_dead = 0;
+ player.death_tick_allowance = 30;
+ player_restore_frame();
- if( !phys->on_board )
- {
- player.angles[0] = atan2f( -phys->rb.forward[2],
- -phys->rb.forward[0] );
- }
+ if( !phys->on_board )
+ {
+ player.angles[0] = atan2f( -phys->rb.forward[2],
+ -phys->rb.forward[0] );
+ }
- player.mdl.shoes[0] = 1;
- player.mdl.shoes[1] = 1;
+ player.mdl.shoes[0] = 1;
+ player.mdl.shoes[1] = 1;
- world_routes_notify_reset();
+ world_routes_notify_reset();
- /* apply 1 frame of movement */
- player_do_motion();
+ /* apply 1 frame of movement */
+ player_do_motion();
+ }
+ else
+ {
+ /* cant do that */
+ audio_lock();
+ audio_play_oneshot( &audio_rewind[4], 1.0f );
+ audio_unlock();
+ }
}
}
{
player.is_dead = 1;
player_ragdoll_copy_model( player.phys.rb.v );
+ world_routes_clear();
}
}
push_thresh_last = push_thresh;
- if( !vg_get_button("break") && push_thresh )
+ if( !vg_get_button("jump") && push_thresh )
{
player.phys.pushing = 1.0f;
player.phys.push_time = vg.time - player.phys.start_push;
player.is_dead = 0;
+ m3x3f the_long_way;
+ q_m3x3( rp->q, the_long_way );
+
+ v3f delta = {1.0f,0.0f,0.0f};
+ m3x3_mulv( the_long_way, delta, delta );
+
+ player.angles[0] = atan2f( delta[0], -delta[2] );
+ player.angles[1] = -asinf( delta[1] );
+
+
v4_copy( rp->q, phys->rb.q );
v3_copy( rp->co, phys->rb.co );
v3_zero( phys->rb.v );
-
+
phys->vswitch = 1.0f;
phys->slip_last = 0.0f;
phys->in_air = 1;
{
render_sky( camera );
render_world_routes( projection, camera[3] );
+ render_world_standard( projection, camera[3] );
render_world_vb( projection, camera[3] );
render_world_alphatest( projection, camera[3] );
render_terrain( projection, camera[3] );
world.routes[route].latest_pass = world.time;
}
+VG_STATIC void world_routes_clear(void)
+{
+ for( u32 i=0; i<world.route_count; i++ )
+ {
+ struct route *route = &world.routes[i];
+ route->active = 0;
+ }
+ world.current_run_version += 4;
+ world.last_use = 0.0;
+}
+
/*
* When going through a gate this is called for bookkeeping purposes
*/
for( int i=0; i<world.sfd.w; i++ )
{
+ u32 idx = (world.sfd.w*row_h + i) * 2;
+
if( end )
{
- world.sfd.buffer[world.sfd.w*row_h + i] = 0.0f;
+ world.sfd.buffer[idx] = 0.0f;
}
else
{
if( !str[i] )
end = 1;
- world.sfd.buffer[world.sfd.w*row_h + i] = sfd_encode_glyph( str[i] );
+ world.sfd.buffer[idx] = sfd_encode_glyph( str[i] );
}
}
}