X-Git-Url: https://harrygodden.com/git/?a=blobdiff_plain;f=player_model.h;h=4766c1695951653828931bc91c1a39fcc3478d96;hb=bceb3a28f8127fa27a17f480bd21fa20a340e848;hp=20e5c0a46c4d8e0d80d35279b70f7d09ade974d6;hpb=d00b1df8f80e4714dc2f9aa2189d242bb4d09a2f;p=carveJwlIkooP6JGAAIwe30JlM.git diff --git a/player_model.h b/player_model.h index 20e5c0a..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,81 +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 } - }; - - for( int i=0; i