Browse Source

utils: mdldec: qc.c: put every sequence property to separate line.

pull/2/head
Andrey Akhmichin 1 year ago committed by Alibek Omarov
parent
commit
02d5bab04b
  1. 90
      utils/mdldec/qc.c

90
utils/mdldec/qc.c

@ -482,83 +482,44 @@ static void WriteSequenceInfo( FILE *fp ) @@ -482,83 +482,44 @@ static void WriteSequenceInfo( FILE *fp )
{
seqdesc = (mstudioseqdesc_t *)( (byte *)model_hdr + model_hdr->seqindex ) + i;
fprintf( fp, "$sequence \"%s\" ", seqdesc->label );
fprintf( fp, "$sequence \"%s\" {\n", seqdesc->label );
if( seqdesc->numblends > 1 )
{
if( seqdesc->numblends > 2 )
{
fputs( "{\n", fp );
for( j = 0; j < seqdesc->numblends; j++ )
{
fputs( " ", fp );
fprintf( fp, "\"%s_blend%i\" ", seqdesc->label, j + 1 );
fputs( "\n", fp );
}
fputs( " ", fp );
}
else
{
fprintf( fp, "\"%s_blend1\" ", seqdesc->label );
fprintf( fp, "\"%s_blend2\" ", seqdesc->label );
fprintf( fp, "\t\"%s_blend%02i\"\n", seqdesc->label, j + 1 );
}
GetMotionTypeString( seqdesc->blendtype[0], motion_types, sizeof( motion_types ), false );
fprintf( fp, "blend %s %.0f %.0f",
motion_types, seqdesc->blendstart[0], seqdesc->blendend[0] );
}
else
{
fprintf( fp, "\"%s\"", seqdesc->label );
}
if( seqdesc->motiontype )
{
GetMotionTypeString( seqdesc->motiontype, motion_types, sizeof( motion_types ), true );
fprintf( fp, "%s", motion_types );
fprintf( fp, "\t\"%s\"\n", seqdesc->label );
}
fprintf( fp, " fps %.0f ", seqdesc->fps );
if( seqdesc->flags == 1 )
fputs( "loop ", fp );
if( seqdesc->activity )
{
activity = FindActivityName( seqdesc->activity );
if( activity )
{
fprintf( fp, "%s %i ", activity, seqdesc->actweight );
fprintf( fp, "\t%s %i\n", activity, seqdesc->actweight );
}
else
{
printf( "WARNING: Sequence %s has a custom activity flag (ACT_%i %i).\n",
seqdesc->label, seqdesc->activity, seqdesc->actweight );
fprintf( fp, "ACT_%i %i ", seqdesc->activity, seqdesc->actweight );
fprintf( fp, "\tACT_%i %i\n", seqdesc->activity, seqdesc->actweight );
}
}
if( seqdesc->entrynode && seqdesc->exitnode )
if( seqdesc->blendtype[0] )
{
if( seqdesc->entrynode == seqdesc->exitnode )
fprintf( fp, "node %i ", seqdesc->entrynode );
else if( seqdesc->nodeflags )
fprintf( fp, "rtransition %i %i ", seqdesc->entrynode, seqdesc->exitnode );
else
fprintf( fp, "transition %i %i ", seqdesc->entrynode, seqdesc->exitnode );
}
GetMotionTypeString( seqdesc->blendtype[0], motion_types, sizeof( motion_types ), false );
if( seqdesc->numevents > 2 )
{
fputs( "{\n", fp );
fprintf( fp, "\tblend %s %.0f %.0f\n",
motion_types, seqdesc->blendstart[0], seqdesc->blendend[0] );
}
for( j = 0; j < seqdesc->numevents; j++ )
{
@ -572,26 +533,29 @@ static void WriteSequenceInfo( FILE *fp ) @@ -572,26 +533,29 @@ static void WriteSequenceInfo( FILE *fp )
fputs( " }\n", fp );
}
fputs( "}", fp );
}
else
{
for( j = 0; j < seqdesc->numevents; j++ )
{
event = (mstudioevent_t *)( (byte *)model_hdr + seqdesc->eventindex ) + j;
fprintf( fp, "{ event %i %i", event->event, event->frame );
fprintf( fp, "\tfps %.0f\n", seqdesc->fps );
if( event->options[0] != '\0')
fprintf( fp, " \"%s\"", event->options );
if( seqdesc->flags == 1 )
fputs( "\tloop\n", fp );
fputs( " } ", fp );
}
if( seqdesc->motiontype )
{
GetMotionTypeString( seqdesc->motiontype, motion_types, sizeof( motion_types ), true );
fprintf( fp, "\t%s\n", motion_types );
}
fputs( "\n", fp );
if( seqdesc->entrynode && seqdesc->exitnode )
{
if( seqdesc->entrynode == seqdesc->exitnode )
fprintf( fp, "\tnode %i\n", seqdesc->entrynode );
else if( seqdesc->nodeflags )
fprintf( fp, "\trtransition %i %i\n", seqdesc->entrynode, seqdesc->exitnode );
else
fprintf( fp, "\ttransition %i %i\n", seqdesc->entrynode, seqdesc->exitnode );
}
if( seqdesc->numblends > 2 )
fputs( "}\n", fp );
}

Loading…
Cancel
Save