X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=world_gen.h;fp=world_gen.h;h=2bada3aa5fcd79acb692054b0c9a239c38accddf;hb=e5d79dc0355e04baecce8908e29b8e7569d1e857;hp=c8c7fb797b419ca80da92801d127b3c7c3ff2dd9;hpb=ec90a4b46865009c1e1b1679f6926e35d2ee3f12;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/world_gen.h b/world_gen.h index c8c7fb7..2bada3a 100644 --- a/world_gen.h +++ b/world_gen.h @@ -637,6 +637,7 @@ VG_STATIC void world_init_blank( world_instance *world ) world->rendering_gate = NULL; world->water.enabled = 0; + world->time = 0.0; /* default lighting conditions * -------------------------------------------------------------*/ @@ -838,6 +839,25 @@ VG_STATIC void world_load( u32 index, const char *path ) mdl_load_array( meta, &world->ent_skateshop, "ent_skateshop", heap ); mdl_load_array( meta, &world->ent_swspreview,"ent_swspreview", heap ); + mdl_array_ptr infos; + mdl_load_array( meta, &infos, "ent_worldinfo", vg_mem.scratch ); + + if( mdl_arrcount(&infos) ){ + world->info = *((ent_worldinfo *)mdl_arritm(&infos,0)); + } + else{ + world->info.pstr_author = 0; + world->info.pstr_desc = 0; + world->info.pstr_name = 0; + world->info.timezone = 0.0f; + } + + time_t t; + struct tm *tm; + time( &t ); + tm = gmtime( &t ); + world->time = (float)tm->tm_min/20.0f + (world->info.timezone/24.0f); + /* process resources from pack */ world_process_resources( world );