Adding name and such to world map list
authorhgn <hgodden00@gmail.com>
Tue, 25 Feb 2025 15:14:43 +0000 (15:14 +0000)
committerhgn <hgodden00@gmail.com>
Tue, 25 Feb 2025 15:14:43 +0000 (15:14 +0000)
21 files changed:
build.c
content_skaterift/maps/dev_flatworld/addon.inf [new file with mode: 0644]
content_skaterift/maps/dev_heaven/addon.inf [new file with mode: 0644]
content_skaterift/maps/dev_hub/addon.inf [new file with mode: 0644]
content_skaterift/maps/dev_tutorial/addon.inf [new file with mode: 0644]
content_skaterift/maps/mp_line1/addon.inf [new file with mode: 0644]
content_skaterift/maps/mp_mtzero/addon.inf [new file with mode: 0644]
content_skaterift/maps/mp_spawn/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_ela/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_fbi/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_fbi2/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_j/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_jesus/addon.inf [new file with mode: 0644]
content_skaterift/playermodels/skaterift_president/addon.inf [new file with mode: 0644]
src/addon.c
src/addon.h
src/addon_types.h
src/menu.c
src/skaterift.c
src/world_load.c
src/world_map.c

diff --git a/build.c b/build.c
index cb72732f0ce15783fe370f7959b3b1c77edabd4f..a99b68b930a258ec91131d66bac5b48105f4cc84 100644 (file)
--- a/build.c
+++ b/build.c
@@ -29,7 +29,7 @@ void write_msg( vg_msg *msg, const char *path ){
 }
 
 void write_generic_addon_inf( u32 type, const char *title,
-                              const char *content, const char *dest )
+                              const char *content, const char *dest, u32 flags )
 {
    u8 descriptor_buf[ 512 ];
    vg_msg descriptor = {0};
@@ -41,6 +41,8 @@ void write_generic_addon_inf( u32 type, const char *title,
       vg_msg_wkvnum( &descriptor, "type", k_vg_msg_u32, 1, &type );
    vg_msg_end_frame( &descriptor );
    vg_msg_wkvstr( &descriptor, "content", content );
+   if( flags )
+      vg_msg_wkvnum( &descriptor, "flags", k_vg_msg_u32, 1, &flags );
    write_msg( &descriptor, dest );
 }
 
@@ -54,38 +56,94 @@ void build_game_metadata(void)
    vg_info( "Building game metadata\n" );
    write_generic_addon_inf( k_addon_type_board, 
                             "Longboard", "board.mdl", 
-                            "content_skaterift/boards/skaterift_long/addon.inf");
+                            "content_skaterift/boards/skaterift_long/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_board, 
                             "Fractal", "board.mdl", 
-                            "content_skaterift/boards/skaterift_fract/addon.inf");
+                            "content_skaterift/boards/skaterift_fract/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_board,
                             "Striped", "board.mdl",
-                            "content_skaterift/boards/skaterift_striped/addon.inf");
+                            "content_skaterift/boards/skaterift_striped/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_board,
                             "Licco", "board.mdl",
-                            "content_skaterift/boards/skaterift_licco/addon.inf");
+                            "content_skaterift/boards/skaterift_licco/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_board,
                             "Hypno", "board.mdl",
-                            "content_skaterift/boards/skaterift_spiral/addon.inf");
+                            "content_skaterift/boards/skaterift_spiral/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_board,
                             "Shark", "board.mdl",
-                            "content_skaterift/boards/skaterift_shark/addon.inf");
+                            "content_skaterift/boards/skaterift_shark/addon.inf", 0 );
 
    write_generic_addon_inf( k_addon_type_player,
                             "De'folde", "ch_new.mdl",
-                            "content_skaterift/playermodels/skaterift_new/addon.inf" );
+                            "content_skaterift/playermodels/skaterift_new/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_player,
                             "Jordan", "ch_jordan.mdl",
-                            "content_skaterift/playermodels/skaterift_jordan/addon.inf" );
+                            "content_skaterift/playermodels/skaterift_jordan/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_player,
                             "Outlaw", "ch_outlaw.mdl",
-                            "content_skaterift/playermodels/skaterift_outlaw/addon.inf" );
+                            "content_skaterift/playermodels/skaterift_outlaw/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_player,
                             "Chip", "ch_chip.mdl",
-                            "content_skaterift/playermodels/skaterift_chip/addon.inf" );
+                            "content_skaterift/playermodels/skaterift_chip/addon.inf", 0 );
    write_generic_addon_inf( k_addon_type_player,
                             "Aaron", "ch_aaron.mdl",
-                            "content_skaterift/playermodels/skaterift_aaron/addon.inf" );
+                            "content_skaterift/playermodels/skaterift_aaron/addon.inf", 0 );
+   write_generic_addon_inf( k_addon_type_player,
+                            "J", "ch_j.mdl",
+                            "content_skaterift/playermodels/skaterift_j/addon.inf", 0 );
+   write_generic_addon_inf( k_addon_type_player,
+                            "Ela", "ch_ela.mdl",
+                            "content_skaterift/playermodels/skaterift_ela/addon.inf", 0 );
+
+   write_generic_addon_inf( k_addon_type_player,
+                            "Jesus", "ch_jesus.mdl",
+                            "content_skaterift/playermodels/skaterift_jesus/addon.inf", ADDON_REG_HIDDEN );
+   write_generic_addon_inf( k_addon_type_player,
+                            "FBI", "ch_fbi.mdl",
+                            "content_skaterift/playermodels/skaterift_fbi/addon.inf", ADDON_REG_HIDDEN );
+   write_generic_addon_inf( k_addon_type_player,
+                            "FBI2", "ch_fbi2.mdl",
+                            "content_skaterift/playermodels/skaterift_fbi2/addon.inf", ADDON_REG_HIDDEN );
+   write_generic_addon_inf( k_addon_type_player,
+                            "President", "ch_president.mdl",
+                            "content_skaterift/playermodels/skaterift_president/addon.inf", ADDON_REG_HIDDEN );
+
+
+   struct 
+   {
+      const char *title, *location, *file;
+      u32 flags;
+   }
+   maps[] =
+   {
+      { "Mt.Zero Island", "Australia", "content_skaterift/maps/mp_mtzero/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_MTZERO | ADDON_REG_PREMIUM },
+      { "Flat World", "...", "content_skaterift/maps/dev_flatworld/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_HIDDEN },
+      { "Heaven", "...", "content_skaterift/maps/dev_heaven/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_HIDDEN },
+      { "Valley", "Cambodia", "content_skaterift/maps/mp_line1/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_PREMIUM },
+      { "Training Island", "Australia", "content_skaterift/maps/dev_tutorial/addon.inf", ADDON_REG_CAMPAIGN },
+      { "Center Island", "Australia", "content_skaterift/maps/dev_hub/addon.inf", ADDON_REG_CAMPAIGN },
+      { "Downtown", "USA, Georgia", "content_skaterift/maps/mp_spawn/addon.inf", ADDON_REG_CAMPAIGN | ADDON_REG_CITY | ADDON_REG_PREMIUM }
+   };
+
+   for( u32 i=0; i<VG_ARRAY_LEN(maps); i ++ )
+   {
+      u8 descriptor_buf[ 512 ];
+      vg_msg descriptor = {0};
+      descriptor.buf = descriptor_buf;
+      descriptor.max = sizeof(descriptor_buf);
+      vg_msg_frame( &descriptor, "workshop" );
+      {
+         vg_msg_wkvstr( &descriptor, "title", maps[i].title );
+         vg_msg_wkvstr( &descriptor, "author", "Skaterift" );
+         u32 type = k_addon_type_world;
+         vg_msg_wkvnum( &descriptor, "type", k_vg_msg_u32, 1, &type );
+      }
+      vg_msg_end_frame( &descriptor );
+      vg_msg_wkvstr( &descriptor, "content", "main.mdl" );
+      if( maps[i].flags )
+         vg_msg_wkvnum( &descriptor, "flags", k_vg_msg_u32, 1, &maps[i].flags );
+      write_msg( &descriptor, maps[i].file );
+   }
 }
 
 #define _S( NAME, VS, FS ) \
diff --git a/content_skaterift/maps/dev_flatworld/addon.inf b/content_skaterift/maps/dev_flatworld/addon.inf
new file mode 100644 (file)
index 0000000..d4fef53
Binary files /dev/null and b/content_skaterift/maps/dev_flatworld/addon.inf differ
diff --git a/content_skaterift/maps/dev_heaven/addon.inf b/content_skaterift/maps/dev_heaven/addon.inf
new file mode 100644 (file)
index 0000000..95f2519
Binary files /dev/null and b/content_skaterift/maps/dev_heaven/addon.inf differ
diff --git a/content_skaterift/maps/dev_hub/addon.inf b/content_skaterift/maps/dev_hub/addon.inf
new file mode 100644 (file)
index 0000000..c295c1c
Binary files /dev/null and b/content_skaterift/maps/dev_hub/addon.inf differ
diff --git a/content_skaterift/maps/dev_tutorial/addon.inf b/content_skaterift/maps/dev_tutorial/addon.inf
new file mode 100644 (file)
index 0000000..9a0bf69
Binary files /dev/null and b/content_skaterift/maps/dev_tutorial/addon.inf differ
diff --git a/content_skaterift/maps/mp_line1/addon.inf b/content_skaterift/maps/mp_line1/addon.inf
new file mode 100644 (file)
index 0000000..0e44d05
Binary files /dev/null and b/content_skaterift/maps/mp_line1/addon.inf differ
diff --git a/content_skaterift/maps/mp_mtzero/addon.inf b/content_skaterift/maps/mp_mtzero/addon.inf
new file mode 100644 (file)
index 0000000..39fda55
Binary files /dev/null and b/content_skaterift/maps/mp_mtzero/addon.inf differ
diff --git a/content_skaterift/maps/mp_spawn/addon.inf b/content_skaterift/maps/mp_spawn/addon.inf
new file mode 100644 (file)
index 0000000..79e6c26
Binary files /dev/null and b/content_skaterift/maps/mp_spawn/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_ela/addon.inf b/content_skaterift/playermodels/skaterift_ela/addon.inf
new file mode 100644 (file)
index 0000000..54f5411
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_ela/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_fbi/addon.inf b/content_skaterift/playermodels/skaterift_fbi/addon.inf
new file mode 100644 (file)
index 0000000..5961ecf
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_fbi/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_fbi2/addon.inf b/content_skaterift/playermodels/skaterift_fbi2/addon.inf
new file mode 100644 (file)
index 0000000..0705e5d
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_fbi2/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_j/addon.inf b/content_skaterift/playermodels/skaterift_j/addon.inf
new file mode 100644 (file)
index 0000000..9e372d1
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_j/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_jesus/addon.inf b/content_skaterift/playermodels/skaterift_jesus/addon.inf
new file mode 100644 (file)
index 0000000..18e258c
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_jesus/addon.inf differ
diff --git a/content_skaterift/playermodels/skaterift_president/addon.inf b/content_skaterift/playermodels/skaterift_president/addon.inf
new file mode 100644 (file)
index 0000000..da72eec
Binary files /dev/null and b/content_skaterift/playermodels/skaterift_president/addon.inf differ
index ab80e9fe56bb684b4176ce2d03d1cbca76f9fe46..6fc77728ea1e3eef879af7a8a320714a461fdc16 100644 (file)
@@ -71,12 +71,14 @@ addon_reg *get_addon_from_index( enum addon_type type, u32 index, u32 whitelist,
 
 u32 get_index_from_addon( enum addon_type type, addon_reg *a, u32 whitelist, u32 blacklist )
 {
-   u32 count = 0;
-   for( u32 i=0; count<addon_system.registry_type_counts[type]; i++ )
+   u32 typecount = 0, count = 0;
+   for( u32 i=0; typecount<addon_system.registry_type_counts[type]; i++ )
    {
       addon_reg *reg = &addon_system.registry[i];
       if( reg->alias.type == type )
       {
+         typecount ++;
+
          if( addon_filter( reg, whitelist, blacklist ) )
          {
             if( reg == a )
@@ -326,23 +328,28 @@ static addon_reg *addon_alloc_reg( PublishedFileId_t workshop_id, enum addon_typ
 /*
  * If the addon.inf exists int the folder, load into the reg
  */
-static int addon_try_load_metadata( addon_reg *reg, vg_str folder_path ){
+static int addon_try_load_metadata( addon_reg *reg, vg_str folder_path )
+{
    vg_str meta_path = folder_path;
    vg_strcat( &meta_path, "/addon.inf" );
-   if( !vg_strgood( &meta_path ) ){
+   if( !vg_strgood( &meta_path ) )
+   {
       vg_error( "The metadata path is too long\n" );
       return 0;
    }
 
    FILE *fp = fopen( meta_path.buffer, "rb" );
-   if( !fp ){
+   if( !fp )
+   {
       vg_error( "Could not open the '%s'\n", meta_path.buffer );
       return 0;
    }
 
    reg->metadata_len = fread( reg->metadata, 1, 512, fp );
-   if( reg->metadata_len != 512 ){
-      if( !feof(fp) ){
+   if( reg->metadata_len != 512 )
+   {
+      if( !feof(fp) )
+      {
          fclose(fp);
          vg_error( "unknown error codition" );
          reg->metadata_len = 0;
@@ -353,13 +360,15 @@ static int addon_try_load_metadata( addon_reg *reg, vg_str folder_path ){
    return 1;
 }
 
-static void addon_print_info( addon_reg *reg ){
+static void addon_print_info( addon_reg *reg )
+{
    vg_info( "addon_reg #%u{\n", addon_system.registry_count );
    vg_info( "  type: %d\n", reg->alias.type );
    vg_info( "  workshop_id: " PRINTF_U64 "\n", reg->alias.workshop_id );
    vg_info( "  folder: [%u]%s\n", reg->foldername_hash, reg->alias.foldername );
    vg_info( "  metadata_len: %u\n", reg->metadata_len );
    vg_info( "  cache_id: %hu\n", reg->cache_id );
+   vg_info( "  flags: %hu\n", reg->flags );
    vg_info( "}\n" );
 }
 
@@ -404,9 +413,7 @@ static addon_reg *addon_mount_workshop_folder( PublishedFileId_t workshop_id, vg
 /*
  * Mount a local folder. may or may not have addon.inf
  */
-addon_reg *addon_mount_local_addon( const char *folder,
-                                    enum addon_type type,
-                                    const char *content_ext )
+addon_reg *addon_mount_local_addon( const char *folder, enum addon_type type, const char *content_ext )
 {
    char folder_path_buf[4096];
    vg_str folder_path;
@@ -433,7 +440,16 @@ addon_reg *addon_mount_local_addon( const char *folder,
    addon_set_foldername( reg, folder_name );
    addon_try_load_metadata( reg, folder_path );
 
-   if( reg->metadata_len == 0 )
+   if( reg->metadata_len )
+   {
+      vg_msg msg;
+      vg_msg_init( &msg, reg->metadata, reg->metadata_len );
+
+      u32 flags = 0x00;
+      vg_msg_getkvintg( &msg, "flags", k_vg_msg_u32, &flags, NULL );
+      reg->flags |= flags;
+   }
+   else
    {
       /* create our own content commands */
       vg_msg msg;
@@ -445,13 +461,16 @@ addon_reg *addon_mount_local_addon( const char *folder,
       vg_warn( "Creating own metadata for: %s\n", folder_path.buffer );
 
       vg_dir subdir;
-      if( !vg_dir_open(&subdir, folder_path.buffer) ){
+      if( !vg_dir_open(&subdir, folder_path.buffer) )
+      {
          vg_error( "Failed to open '%s'\n", folder_path.buffer );
          return NULL;
       }
 
-      while( vg_dir_next_entry(&subdir) ){
-         if( vg_dir_entry_type(&subdir) == k_vg_entry_type_file ){
+      while( vg_dir_next_entry(&subdir) )
+      {
+         if( vg_dir_entry_type(&subdir) == k_vg_entry_type_file )
+         {
             const char *fname = vg_dir_entry_name(&subdir);
             vg_str file = folder_path;
             vg_strcat( &file, "/" );
@@ -471,7 +490,8 @@ addon_reg *addon_mount_local_addon( const char *folder,
       if( !content_count ) return NULL;
       if( msg.error == k_vg_msg_error_OK )
          reg->metadata_len = msg.cur.co;
-      else{
+      else
+      {
          vg_error( "Error creating metadata: %d\n", msg.error );
          return NULL;
       }
@@ -588,11 +608,13 @@ void addon_mount_content_folder( enum addon_type type,
  */
 int addon_get_content_folder( addon_reg *reg, vg_str *folder, int async)
 {
-   if( reg->alias.workshop_id ){
+   if( reg->alias.workshop_id )
+   {
       struct async_workshop_filepath_info *info = NULL;
       vg_async_item *call = NULL;
 
-      if( async ){
+      if( async )
+      {
          call = vg_async_alloc( sizeof(struct async_workshop_filepath_info) );
          info = call->payload;
       }
@@ -603,23 +625,26 @@ int addon_get_content_folder( addon_reg *reg, vg_str *folder, int async)
       info->id = reg->alias.workshop_id;
       info->len = folder->len;
 
-      if( async ){
+      if( async )
+      {
          vg_async_dispatch( call, async_workshop_get_filepath );
          vg_async_stall(); /* too bad! */
       }
-      else {
+      else 
+      {
          async_workshop_get_filepath( info, 0 );
       }
 
-      if( info->buf[0] == '\0' ){
-         vg_error( "Failed SteamAPI_GetItemInstallInfo(" PRINTF_U64 ")\n",
-                     reg->alias.workshop_id );
+      if( folder->buffer[0] == '\0' )
+      {
+         vg_error( "Failed SteamAPI_GetItemInstallInfo(" PRINTF_U64 ")\n", reg->alias.workshop_id );
          return 0;
       }
       folder->i = strlen( folder->buffer );
       return 1;
    }
-   else{
+   else
+   {
       folder->i = 0;
       
       const char *local_folder = 
index 9cbfb6874686ddb99c4c9f02fca2482cd7350d38..d0f90602387e8b43bcdc901bcac40fdc8f902cea 100644 (file)
@@ -15,16 +15,6 @@ struct addon_alias
    char foldername[ ADDON_FOLDERNAME_MAX ];
 };
 
-#define ADDON_REG_HIDDEN   0x1
-#define ADDON_REG_MTZERO   0x2
-#define ADDON_REG_CITY     0x4
-#define ADDON_REG_PREMIUM  0x8
-
-#define ADDON_REG_CAMPAIGN 0x10
-#define ADDON_REG_WORKSHOP 0x20
-#define ADDON_REG_VENUS    0x40
-#define ADDON_REG_INFINITE 0x80
-
 struct addon_system
 {
    struct addon_reg
@@ -34,7 +24,6 @@ struct addon_system
       u8 metadata[512];  /* vg_msg buffer */
       u32 metadata_len;
       u32 flags;
-
       u16 cache_id;
    }
    *registry;
index 45cd7acbeafc32a3cfc6bb9a51b1bcf96c91b9e5..8e0b5dc7eaad96effae1c590e408da18983bcec0 100644 (file)
@@ -12,6 +12,16 @@ enum addon_type{
 #define ADDON_MOUNTED_MAX 128 /* total count that we have knowledge of */
 #define ADDON_UID_MAX 76
 
+#define ADDON_REG_HIDDEN   0x1
+#define ADDON_REG_MTZERO   0x2
+#define ADDON_REG_CITY     0x4
+#define ADDON_REG_PREMIUM  0x8
+
+#define ADDON_REG_CAMPAIGN 0x10
+#define ADDON_REG_WORKSHOP 0x20
+#define ADDON_REG_VENUS    0x40
+#define ADDON_REG_INFINITE 0x80
+
 #ifdef VG_ENGINE
 
 struct addon_type_info 
index ed82d77aeb6b8115bf376463e6bf384942c9507b..34358ccf28a967b6895b0b1ac491ef9169526061 100644 (file)
@@ -33,7 +33,7 @@ void menu_init(void)
 static void menu_update_world_filter(void)
 {
    menu.world_list_whitelist = 0;
-   menu.world_list_blacklist = 0;//ADDON_REG_HIDDEN;
+   menu.world_list_blacklist = ADDON_REG_HIDDEN;
 
    if( world_map.superworld_list_selected == k_superworld_campaign )
       menu.world_list_whitelist = ADDON_REG_CAMPAIGN;
@@ -384,10 +384,15 @@ void menu_update_world_list(void)
                                                 menu.world_list_whitelist, menu.world_list_blacklist );
          menu.world_list_entries[ menu.world_list_display_count ] = reg;
 
+         const char *name = NULL;
+
          vg_msg msg;
          vg_msg_init( &msg, reg->metadata, reg->metadata_len );
 
-         const char *name = vg_msg_getkvstr( &msg, "location" );
+         if( vg_msg_seekframe( &msg, "workshop" ) )
+         {
+            name = vg_msg_getkvstr( &msg, "title" );
+         }
 
          if( !name )
             name = reg->alias.foldername;
@@ -836,7 +841,7 @@ void menu_gui( ui_context *ctx )
          char buf[128];
          vg_str str;
          vg_strnull( &str, buf, sizeof(buf) );
-         u32 colour;
+         u32 colour = 0;
          network_status_string( &str, &colour );
          menu_standard_widget( ctx, inner_online_panel, label_box, 1 );
          ui_text( ctx, label_box, buf, 1, k_ui_align_middle_left, colour );
index 13b07717b68ebef3ee391220ad68b7d05918136a..a13ec267b40206c3ee47551774801d350f6553c8 100644 (file)
@@ -65,26 +65,6 @@ void game_launch_opt(void)
       skaterift.override_load_world = arg;
 }
 
-static addon_reg *skaterift_mount_world_unloadable( const char *path, u32 ext )
-{
-   addon_reg *reg = addon_mount_local_addon( path, k_addon_type_world, ".mdl" );
-   if( !reg ) vg_fatal_error( "world not found\n" );
-   reg->flags |= (ext);
-   return reg;
-}
-
-static void skaterift_load_world_content(void)
-{
-   /* hub world */
-   _world.default_hub_addon = skaterift_mount_world_unloadable( "maps/dev_hub", ADDON_REG_CAMPAIGN );
-   skaterift_mount_world_unloadable( "maps/dev_heaven",  ADDON_REG_CAMPAIGN | ADDON_REG_HIDDEN );
-   skaterift_mount_world_unloadable( "maps/mp_spawn",    ADDON_REG_CAMPAIGN | ADDON_REG_CITY|ADDON_REG_PREMIUM );
-   skaterift_mount_world_unloadable( "maps/mp_mtzero",   ADDON_REG_CAMPAIGN | ADDON_REG_MTZERO|ADDON_REG_PREMIUM );
-   skaterift_mount_world_unloadable( "maps/dev_tutorial",ADDON_REG_CAMPAIGN );
-   skaterift_mount_world_unloadable( "maps/dev_flatworld", ADDON_REG_HIDDEN );
-   skaterift_mount_world_unloadable( "maps/mp_line1",    ADDON_REG_CAMPAIGN | ADDON_REG_PREMIUM );
-}
-
 static void skaterift_load_player_content(void)
 {
    particle_alloc( &particles_grind, 300 );
@@ -129,7 +109,11 @@ void game_load(void)
 
    vg_loader_set_user_information( "Loading content files" );
    vg_loader_step( audio_init, NULL );
-   vg_loader_step( skaterift_load_world_content, NULL );
+
+   _world.default_hub_addon = addon_mount_local_addon( "maps/dev_hub", k_addon_type_world, ".mdl" );
+   if( !_world.default_hub_addon )
+      vg_fatal_error( "Hub world not found\n" );
+
    vg_console_load_autos();
 
    vg_loader_set_user_information( "Mounting addons" );
index e4e04f4171266fdc607d8fbf48bd738b83ff608f..8b537ce5eb7fbf257ea671cc091e0a6915be02f9 100644 (file)
@@ -52,6 +52,39 @@ static void world_instance_load_mdl( world_instance *world, const char *path, vo
 #endif
 
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_spawn,     ent_spawn,      heap );
+
+      if( af_arrcount( &world->ent_spawn ) == 0 )
+      {
+         vg_warn( "There are no spawn points in the world; defaulting to first non-local gate.\n" );
+         world->ent_spawn.data = vg_linear_alloc( heap, 1*sizeof(ent_spawn) );
+         world->ent_spawn.count = 1;
+         world->ent_spawn.stride = sizeof(ent_spawn);
+
+         ent_gate *found_gate = NULL;
+         for( u32 i=0; i<af_arrcount( &world->ent_gate ); i ++ )
+         {
+            ent_gate *gate = af_arritm( &world->ent_gate, i );
+            if( gate->flags & k_ent_gate_nonlocal )
+            {
+               found_gate = gate;
+               break;
+            }
+         }
+
+         ent_spawn *fallback_spawn = af_arritm( &world->ent_spawn, 0 );
+         fallback_spawn->pstr_name = 0;
+         q_identity( fallback_spawn->transform.q );
+         v3_copy( (v3f){1,1,1}, fallback_spawn->transform.s );
+
+         if( found_gate )
+            v3_copy( found_gate->co[0], fallback_spawn->transform.co );
+         else
+         {
+            vg_warn( "There are no non-local gates either. Defaulting to 0,0,0.\n" );
+            v3_zero( fallback_spawn->transform.co );
+         }
+      }
+
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_light,     ent_light,      heap );
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_route_node,ent_route_node, heap );
       AF_LOAD_ARRAY_STRUCT( af, &world->ent_path_index,ent_path_index, heap );
index 214647e7ce331bd1ca5a0a39fbbbfd59519d78c6..87df0cac25cce87b24dec52e91d1da98ad6cf056 100644 (file)
@@ -346,8 +346,8 @@ void render_world_map(void)
          f32 a = v3_dot(v0,v1);
          cam.fov = acosf( a ) * 45.0f;
 
-         cam.angles[0] -= 0.07f*a + ofs[0]*0.1f;
-         cam.angles[1] += 0.03f*a + ofs[1]*0.1f;
+         cam.angles[0] -= /*0.07f*a*/ + ofs[0]*0.1f;
+         cam.angles[1] += /*0.03f*a*/ + ofs[1]*0.1f;
          cam.angles[2] = ofs[2]*0.01f;
 
          world_map_update_final_camera( &cam );
@@ -371,6 +371,7 @@ void render_world_map(void)
       vg_framebuffer_bind( g_render.fb_workshop_preview, 1.0f );
       glClearColor( 0.02f,0.02f,0.08f, 0.0f );
       glClear( GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT );
+      glDisable( GL_CULL_FACE );
 
       vg_camera cam, *smooth_cam = &world_map.superworld_cam;
       ent_camera *cam_temp = af_arritm( &world_map.ent_camera, world_map.superworld_list_selected );