X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=skaterift.c;h=714ed11cbdd44f05a73585a2e998aa8a0a406c40;hb=e311bbe2fa903a7e2a922f202f389b799193195d;hp=d8aae1bde47d3b99950d19b32a394b98ffb5fc77;hpb=810a45773a2ade051c5ffb50321dab89bd2a45e9;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/skaterift.c b/skaterift.c index d8aae1b..714ed11 100644 --- a/skaterift.c +++ b/skaterift.c @@ -56,6 +56,8 @@ #include "player_remote.c" #include "vg/vg_audio_dsp.h" #include "world_routes_ui.c" +#include "particle.c" +#include "player_effects.c" static int k_tools_mode = 0; @@ -123,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; @@ -154,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; } @@ -194,6 +196,8 @@ static void vg_load(void){ skaterift.replay.size = bytes; replay_clear( &skaterift.replay ); + particle_alloc( &particles_grind, 300 ); + player_load_animation_reference( "models/ch_none.mdl" ); player_model_load( &localplayer.fallback_model, "models/ch_none.mdl" ); player__bind(); @@ -212,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; @@ -241,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); @@ -476,6 +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 */