projects
/
carveJwlIkooP6JGAAIwe30JlM.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some niceer ui stuff
[carveJwlIkooP6JGAAIwe30JlM.git]
/
world_load.c
diff --git
a/world_load.c
b/world_load.c
index 1547d225a67c39f15ca69fdb03607d7b0c11d0fe..afd4986826e0a63f856e39950fad077c3ca36bf4 100644
(file)
--- a/
world_load.c
+++ b/
world_load.c
@@
-59,6
+59,9
@@
VG_STATIC void world_load_mdl( const char *path )
mdl_load_array( meta, &world->ent_skateshop, "ent_skateshop", heap );
mdl_load_array( meta, &world->ent_swspreview,"ent_swspreview", heap );
mdl_load_array( meta, &world->ent_ccmd, "ent_ccmd", heap );
mdl_load_array( meta, &world->ent_skateshop, "ent_skateshop", heap );
mdl_load_array( meta, &world->ent_swspreview,"ent_swspreview", heap );
mdl_load_array( meta, &world->ent_ccmd, "ent_ccmd", heap );
+ mdl_load_array( meta, &world->ent_challenge, "ent_challenge", heap );
+ mdl_load_array( meta, &world->ent_unlock, "ent_unlock", heap );
+ mdl_load_array( meta, &world->ent_relay, "ent_relay", heap );
mdl_array_ptr infos;
mdl_load_array( meta, &infos, "ent_worldinfo", vg_mem.scratch );
mdl_array_ptr infos;
mdl_load_array( meta, &infos, "ent_worldinfo", vg_mem.scratch );
@@
-83,8
+86,6
@@
VG_STATIC void world_load_mdl( const char *path )
world_gen_load_surfaces();
world_gen_routes_ent_init();
world_gen_entities_init();
world_gen_load_surfaces();
world_gen_routes_ent_init();
world_gen_entities_init();
- world->volume_bh = bh_create( heap, &bh_system_volumes, world,
- mdl_arrcount( &world->ent_volume ), 1 );
/* main bulk */
world_gen_generate_meshes();
/* main bulk */
world_gen_generate_meshes();
@@
-97,21
+98,14
@@
VG_STATIC void world_load_mdl( const char *path )
world->status = k_world_status_loaded;
}
world->status = k_world_status_loaded;
}
-/*
- * op: k_async_op_world_loading
- * k_async_op_world_preloading
- * -----------------------------------------------------------------------------
- */
-
-static void async_skaterift_world_loaded( void *payload, u32 size )
-{
- skaterift_end_op();
+static void skaterift_world_change_done( void *payload, u32 size ){
+ world_loader.state = k_world_loader_none;
}
/*
* Does a complete world switch using the remaining free slots
*/
}
/*
* Does a complete world switch using the remaining free slots
*/
-static void skaterift_world_changer_thread( void *
data
){
+static void skaterift_world_changer_thread( void *
_
){
char path_buf[4096];
vg_str path;
vg_strnull( &path, path_buf, 4096 );
char path_buf[4096];
vg_str path;
vg_strnull( &path, path_buf, 4096 );
@@
-127,7
+121,6
@@
static void skaterift_world_changer_thread( void *data ){
vg_str folder = path;
if( !vg_strgood( &folder ) ) {
vg_error( "Load target too long\n" );
vg_str folder = path;
if( !vg_strgood( &folder ) ) {
vg_error( "Load target too long\n" );
- vg_async_call( workshop_async_any_complete, NULL, 0 );
return;
}
return;
}
@@
-137,7
+130,6
@@
static void skaterift_world_changer_thread( void *data ){
vg_dir dir;
if( !vg_dir_open(&dir, folder.buffer) ){
vg_error( "opendir('%s') failed\n", folder.buffer );
vg_dir dir;
if( !vg_dir_open(&dir, folder.buffer) ){
vg_error( "opendir('%s') failed\n", folder.buffer );
- vg_async_call( async_skaterift_world_loaded, NULL, 0 );
return;
}
return;
}
@@
-193,13
+185,12
@@
static void skaterift_world_changer_thread( void *data ){
}
}
}
}
- vg_async_call(
async_skaterift_world_loaded
, NULL, 0 );
+ vg_async_call(
skaterift_world_change_done
, NULL, 0 );
}
/* holding pattern before we can start loading the new world, since we might be
* waiting for audio to stop */
}
/* holding pattern before we can start loading the new world, since we might be
* waiting for audio to stop */
-static void skaterift_change_world_preupdate(void)
-{
+static void skaterift_change_world_preupdate(void){
for( u32 i=1; i<vg_list_size(world_static.worlds); i++ ){
world_instance *inst = &world_static.worlds[i];
for( u32 i=1; i<vg_list_size(world_static.worlds); i++ ){
world_instance *inst = &world_static.worlds[i];
@@
-212,7
+203,7
@@
static void skaterift_change_world_preupdate(void)
}
vg_info( "worlds cleared, begining load\n" );
}
vg_info( "worlds cleared, begining load\n" );
-
skaterift_shift_op( k_async_op_world_loading )
;
+
world_loader.state = k_world_loader_load
;
/* finally can start the loader */
vg_loader_start( skaterift_world_changer_thread, NULL );
/* finally can start the loader */
vg_loader_start( skaterift_world_changer_thread, NULL );
@@
-233,7
+224,7
@@
static void skaterift_change_world_start(void){
vg_error( "Cannot change worlds while in non-root world\n" );
}
else{
vg_error( "Cannot change worlds while in non-root world\n" );
}
else{
-
skaterift_begin_op( k_async_op_world_preloading )
;
+
world_loader.state = k_world_loader_preload
;
vg_linear_clear( vg_mem.scratch ); /* ?? */
vg_info( "unloading old worlds\n" );
vg_linear_clear( vg_mem.scratch ); /* ?? */
vg_info( "unloading old worlds\n" );
@@
-347,8
+338,8
@@
VG_STATIC void world_init_blank( world_instance *world )
world->surface_count = 0;
world->geo_bh = NULL;
world->surface_count = 0;
world->geo_bh = NULL;
- world->
volume
_bh = NULL;
- world->
audio_bh
= NULL;
+ world->
entity
_bh = NULL;
+ world->
entity_list
= NULL;
world->rendering_gate = NULL;
world->water.enabled = 0;
world->rendering_gate = NULL;
world->water.enabled = 0;