#include <acknex.h>
void main ()
{
int bone_index = 0, parent_index = 0, child_index = 0;
video_mode = 12;
wait(2);
level_load ( "" );
FONT *fnt10 = font_create ( "Arial#12" );
ENTITY *entBones = ent_create ( "biped.mdl", nullvector, NULL );
int numBones = ent_bones ( entBones );
int step = screen_size.x / numBones;
//----------------------------------------------------------------------------------------
TEXT **txtBones = sys_malloc ( sizeof(TEXT*) * numBones );
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
{
txtBones[bone_index] = txt_create ( numBones, 1 );
txtBones[bone_index]->pos_x = bone_index * step;
txtBones[bone_index]->font = fnt10;
txtBones[bone_index]->flags = SHOW;
}
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
ent_bonehandle ( entBones, (txtBones[bone_index]->pstring)[0], bone_index+1 );
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
{
int parent_index = 1;
long handle = ent_boneparent ( entBones, (txtBones[bone_index]->pstring)[parent_index], bone_index+1 );
while ( handle )
{
parent_index += 1;
handle = ent_boneparent ( entBones, (txtBones[bone_index]->pstring)[parent_index], (var)handle );
}
}
//----------------------------------------------------------------------------------------
TEXT **txtBones2 = sys_malloc ( sizeof(TEXT*) * numBones );
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
{
txtBones2[bone_index] = txt_create ( numBones, 1 );
txtBones2[bone_index]->pos_x = bone_index * step;
txtBones2[bone_index]->pos_y = 250;
txtBones2[bone_index]->font = fnt10;
txtBones2[bone_index]->flags = SHOW;
}
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
ent_bonehandle ( entBones, (txtBones2[bone_index]->pstring)[0], bone_index+1 );
for ( bone_index=0; bone_index<numBones; bone_index+=1 )
{
child_index = 0;
long handle = ent_boneparent ( entBones, (txtBones2[bone_index]->pstring)[child_index], 0 );
while ( handle )
{
child_index += 1;
ent_bonehandle ( entBones, (txtBones2[bone_index]->pstring)[child_index], (var)handle );
handle = ent_boneparent ( entBones, (txtBones2[bone_index]->pstring)[child_index], 0 );
}
}
//----------------------------------------------------------------------------------------
while ( !key_esc )
wait(1);
sys_exit ( NULL );
}