guides
[carveJwlIkooP6JGAAIwe30JlM.git] / skaterift.c
index c8da6ad414281a75aad8f24523bdd9ac8384721b..6cb3579e819c5b5261229e7c25decda86bad586d 100644 (file)
@@ -14,7 +14,7 @@
 #if 1
 
 #define SR_NETWORKED
-#define VG_DEVWINDOW
+//#define VG_DEVWINDOW
 
 /* 
  *     system headers
@@ -45,6 +45,7 @@
 #include "entity.c"
 #include "workshop.c"
 #include "addon.c"
+#include "highscores.c"
 
 static struct player_avatar localplayer_avatar;
 static struct player_model  localplayer_models[3];
@@ -57,10 +58,12 @@ int main( int argc, char *argv[] )
    return 0;
 }
 
+#if 0
 VG_STATIC void highscores_save_at_exit(void)
 {
    highscores_serialize_all();
 }
+#endif
 
 VG_STATIC void vg_launch_opt(void)
 {
@@ -78,11 +81,13 @@ vg_info("            |   \\/   | |        /     |      |    \\ | /   | \n" );
 vg_info("            '        ' '--' [] '----- '----- '     ' '---'  " 
         "SOFTWARE\n" );
 
+   /* 31.05.23 (hgn): this is only a server feature now */
+#if 0
    highscores_init( 2000, 50 );
    if( !highscores_read() )
       highscores_create_db();
-
    vg_loader_step( NULL, highscores_save_at_exit );
+#endif
 
    steam_init();
    vg_loader_step( NULL, steam_end );
@@ -157,6 +162,37 @@ VG_STATIC void vg_load(void)
    world_loader.location = k_world_load_type_local;
    world_load_mdl( "maps/mp_spawn/main.mdl" );
 
+   /* Completing addon registrations
+    * -------------------------------------
+    */
+   vg_msg msg;
+
+   /* understate diy. */
+   addon_reg *spawn = addon_mount_local_addon( "maps/mp_spawn", 
+                                                k_workshop_file_type_world, 
+                                                ".mdl" );
+   vg_msg_init( &msg, spawn->metadata, sizeof(spawn->metadata) );
+   vg_msg_frame( &msg, "workshop" );
+   vg_msg_wkvstr( &msg, "title", "Understate DIY" );
+   vg_msg_end_frame( &msg );
+   vg_msg_wkvstr( &msg, "location", "USA" );
+   spawn->metadata_len = msg.cur;
+
+   /* mtzero island */
+   addon_reg *mtzero = addon_mount_local_addon( "maps/mp_mtzero",
+                                                k_workshop_file_type_world,
+                                                ".mdl" );
+   vg_msg_init( &msg, mtzero->metadata, sizeof(mtzero->metadata) );
+   vg_msg_frame( &msg, "workshop" );
+   vg_msg_wkvstr( &msg, "title", "Mt.Zero Island" );
+   vg_msg_end_frame( &msg );
+   vg_msg_wkvstr( &msg, "location", "Australia" );
+   mtzero->metadata_len = msg.cur;
+   global_skateshop.selected_world_id=1;
+   global_skateshop.pointcloud_world_id=1;
+   skateshop_preview_loader_thread( mtzero ); /* HACK */
+
+   vg_async_call( async_addon_reg_update, NULL, 0 );
    vg_console_load_autos();
    menu_link();
 
@@ -329,6 +365,7 @@ VG_STATIC void render_scene_gate_subview(void)
 {
    render_fb_bind( gpipeline.fb_main, 1 );
    world_instance *view_world = localplayer.viewable_world;
+   if( !view_world ) return; /* ??? */
 
    int depth = 1;
    if( localplayer.gate_waiting ) depth = 0;