X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;ds=sidebyside;f=skaterift.c;h=714ed11cbdd44f05a73585a2e998aa8a0a406c40;hb=74b2136d5b41b18e2eec698f1fd11b503aa1100a;hp=14529f67e0e3ea20bd447cad1c72124993e95304;hpb=60b814f700fb47b6730d603dd85a5affad67272e;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/skaterift.c b/skaterift.c index 14529f6..714ed11 100644 --- a/skaterift.c +++ b/skaterift.c @@ -57,6 +57,7 @@ #include "vg/vg_audio_dsp.h" #include "world_routes_ui.c" #include "particle.c" +#include "player_effects.c" static int k_tools_mode = 0; @@ -124,12 +125,12 @@ static void skaterift_restore_state(void){ vg_msg kvsav; vg_msg_init( &kvsav, sav.buf, sizeof(sav.buf) ); + skaterift.achievements |= vg_msg_getkvu32( &kvsav, "ach", 0 ); u32 board_reg_id = 0, player_reg_id = 0; vg_msg_cursor orig = kvsav.cur; - if( vg_msg_seekframe( &kvsav, "player" ) ){ addon_alias q; @@ -155,9 +156,9 @@ static void skaterift_restore_state(void){ kvsav.cur = orig; } -static addon_reg *skaterift_mount_world_unloadable( const char *path ){ +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" ); - reg->flags |= ADDON_REG_HIDDEN; + reg->flags |= (ADDON_REG_HIDDEN | ext); return reg; } @@ -195,7 +196,7 @@ static void vg_load(void){ skaterift.replay.size = bytes; replay_clear( &skaterift.replay ); - particle_init( &particles_grind, 300 ); + particle_alloc( &particles_grind, 300 ); player_load_animation_reference( "models/ch_none.mdl" ); player_model_load( &localplayer.fallback_model, "models/ch_none.mdl" ); @@ -215,9 +216,10 @@ static void vg_load(void){ */ /* hub world */ - addon_reg *hub = skaterift_mount_world_unloadable( "maps/dev_hub" ); - skaterift_mount_world_unloadable( "maps/mp_spawn" ); - skaterift_mount_world_unloadable( "maps/mp_mtzero" ); + addon_reg *hub = skaterift_mount_world_unloadable( "maps/dev_hub", 0 ); + skaterift_mount_world_unloadable( "maps/mp_spawn", ADDON_REG_CITY ); + skaterift_mount_world_unloadable( "maps/mp_mtzero", ADDON_REG_MTZERO ); + skaterift_mount_world_unloadable( "maps/dev_tutorial", 0 ); /* load home/permanent world manually */ world_static.load_state = k_world_loader_load; @@ -244,6 +246,8 @@ static void vg_load(void){ /* and now */ skaterift_restore_state(); + update_ach_models(); + vg_loader_step( NULL, skaterift_autosave_synchronous ); //board_processview_thread(NULL); @@ -479,15 +483,16 @@ static void render_scene(void){ world_instance *view_world = get_view_world(); render_world( view_world, &skaterift.cam, 0, 0, 1, 1 ); +#if 0 particle_spawn( &particles_grind, localplayer.rb.co, (v3f){vg_randf64()*2.0f,vg_randf64()*3.0f,vg_randf64()*2.0f}, vg_randf64(), 0xff0000ff ); +#endif particle_system_update( &particles_grind, vg.time_delta ); //particle_system_debug( &particles_grind ); particle_system_prerender( &particles_grind ); particle_system_render( &particles_grind, &skaterift.cam ); - /* * render transition */