X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_model.h;h=4766c1695951653828931bc91c1a39fcc3478d96;hb=bceb3a28f8127fa27a17f480bd21fa20a340e848;hp=f2b375aa19988ba7391f5042cb67880ae8aa1ddf;hpb=da929c58442de91be106438ebf2f2daabf7f2430;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_model.h b/player_model.h index f2b375a..4766c16 100644 --- a/player_model.h +++ b/player_model.h @@ -30,7 +30,7 @@ static void player_model_free(void *_) /* * Load model from file (.mdl) */ -static void player_load_model( const char *name ) +static void player_load_model( const char *name, int replace_mode ) { char buf[64]; @@ -43,82 +43,87 @@ static void player_load_model( const char *name ) return; } - struct player_model temp; - - mdl_unpack_glmesh( src, &temp.mesh ); - skeleton_setup( &temp.sk, src ); + mesh_free( &player.mdl.mesh ); + mdl_unpack_glmesh( src, &player.mdl.mesh ); - /* - * Link animations - */ - struct _load_anim + if( !replace_mode ) { - const char *name; - struct skeleton_anim **anim; - } - anims[] = { - { "pose_stand", &temp.anim_stand }, - { "pose_highg", &temp.anim_highg }, - { "pose_slide", &temp.anim_slide }, - { "pose_air", &temp.anim_air }, - { "push", &temp.anim_push }, - { "push_reverse", &temp.anim_push_reverse }, - { "ollie", &temp.anim_ollie }, - { "ollie_reverse",&temp.anim_ollie_reverse }, - { "grabs", &temp.anim_grabs }, - { "walk", &temp.anim_walk }, - { "run", &temp.anim_run }, - { "idle_cycle", &temp.anim_idle }, - { "jump", &temp.anim_jump } - }; - - for( int i=0; i