add sqlite and use it
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift.c
index b5029c4ca30745d85ce619c4e0e045e118d1ed2a..5b69d566664d31bcbfb8dc84cc5854031b475d9a 100644 (file)
 static struct player_avatar localplayer_avatar;
 
 int main( int argc, char *argv[] ){
+#if 0
+   u8 buf[ 512 ];
+   bitpack_ctx ctx = {
+      .buffer = buf,
+      .buffer_len = 512,
+      .bytes = 0,
+      .mode = k_bitpack_compress
+   };
+
+   v4f q = {  0.388, -0.565, 0.515, 0.515 };
+   vg_info( "q: %f %f %f %f\n", q[0], q[1], q[2], q[3] );
+
+   /* compress */
+   bitpack_qquat( &ctx, q );
+
+   vg_info( "compressed bytes: %u\n", ctx.bytes );
+
+   /* decompress */
+   ctx.bytes = 0;
+   ctx.mode = k_bitpack_decompress;
+
+   bitpack_qquat( &ctx, q );
+   vg_info( "q: %f %f %f %f\n", q[0], q[1], q[2], q[3] );
+
+   return 0;
+#endif
+
    vg_mem.use_libc_malloc = 0;
    vg_set_mem_quota( 160*1024*1024 );
    vg_enter( argc, argv, "Voyager Game Engine" ); 
@@ -84,6 +111,7 @@ vg_info("            '        ' '--' [] '----- '----- '     ' '---'  "
 
    steam_init();
    vg_loader_step( NULL, steam_end );
+   vg_loader_step( remote_players_init, NULL );
    vg_loader_step( network_init, network_end );
 }
 
@@ -324,6 +352,7 @@ static void vg_pre_update(void){
    player__pre_update();
    world_entity_focus_preupdate();
    skaterift_replay_pre_update();
+   remote_sfx_pre_update();
 
    world_update( world_current_instance(), localplayer.rb.co );
    audio_ambient_sprites_update( world_current_instance(), localplayer.rb.co );
@@ -455,6 +484,7 @@ static void render_player_transparent(void){
 
    /* Draw player to window buffer and blend background ontop */
    player__render( &small_cam );
+   render_remote_players_tags( localplayer.viewable_world, &skaterift.cam );
 }
 
 static void render_scene(void){
@@ -483,6 +513,7 @@ static void render_scene(void){
                                     GL_COLOR_ATTACHMENT1 } );
       view_world = &world_static.instances[respawn_chooser.world_id];
       render_world_override( view_world );
+      render_world_routes( view_world, &skaterift.cam, 1 );
    }
    else{
       render_world( view_world, &skaterift.cam, 0 );
@@ -555,7 +586,7 @@ static void render_main_game(void){
    /* --------------------------------------------------------------------- */
 
    world_instance *view_world = localplayer.viewable_world;
-   if( view_world != NULL ){
+   if( (view_world != NULL) && (skaterift.activity != k_skaterift_respawning) ){
       render_world_cubemaps( view_world );
 
       ent_gate *gate = view_world->rendering_gate;