diff --git a/utils/mdldec/mdldec.c b/utils/mdldec/mdldec.c index 9e4952e6..2a5481dc 100644 --- a/utils/mdldec/mdldec.c +++ b/utils/mdldec/mdldec.c @@ -526,30 +526,32 @@ ShowHelp */ static void ShowHelp( const char *app_name ) { - LogPrintf( "usage: %s [-dhlmuVv] ", app_name ); - LogPrintf( " %s [-dhlmuVv] ", app_name ); - LogPutS( "\nnote:"); - LogPutS( "\tby default this decompiler aimed to support extended MDL10 format from XashXT/PrimeXT/Paranoia2."); - LogPutS( "\tif you use an old GoldSource studio model compiler you may be need to edit .qc-file after decompilation."); - LogPutS( "\noptions:"); - LogPutS( "\t-d\tplace smd and texture files to separate directories." ); + LogPrintf( "usage: %s [-ahlmtuVv] ", app_name ); + LogPrintf( " %s [-ahlmtuVv] ", app_name ); + LogPutS( "\nnote:" ); + LogPutS( "\tby default this decompiler aimed to support extended MDL10 format from XashXT/PrimeXT/Paranoia2." ); + LogPutS( "\tif you use an old GoldSource studio model compiler you may be need to edit .qc-file after decompilation." ); + LogPutS( "\noptions:" ); + LogPutS( "\t-a\tplace files with animations to separate directory." ); + LogPutS( "\t-l\tdo not output logs." ); LogPutS( "\t-m\tuse only GoldSource-compatible motion types and ignore deprecated motion types with \"A\" prefix." ); - LogPutS( "\t-u\tenable UV coords shifting for DoomMusic's and Sven-Coop's studio model compilers."); - LogPutS( "\t-V\tignore some validation checks for broken models."); - LogPutS( "\t-l\tdo not output logs."); - LogPutS( "\t-v\tshow version."); - LogPutS( "\t-h\tthis message."); + LogPutS( "\t-t\tplace texture files to separate directory." ); + LogPutS( "\t-u\tenable UV coords shifting for DoomMusic's and Sven-Coop's studio model compilers." ); + LogPutS( "\t-V\tignore some validation checks for broken models." ); + LogPutS( "\t-v\tshow version." ); + LogPutS( "\t-h\tthis message." ); } int main( int argc, char *argv[] ) { int opt, ret = 0 ; - while( ( opt = getopt( argc, argv, "dhlmuVv" )) != -1 ) + while( ( opt = getopt( argc, argv, "ahlmtuVv" )) != -1 ) { switch( opt ) { - case 'd': globalsettings |= SETTINGS_SEPARATERESOURCES; break; + case 'a': globalsettings |= SETTINGS_SEPARATEANIMSFOLDER; break; + case 't': globalsettings |= SETTINGS_SEPARATETEXTURESFOLDER; break; case 'l': globalsettings |= SETTINGS_NOLOGS; break; case 'm': globalsettings |= SETTINGS_LEGACYMOTION; break; case 'u': globalsettings |= SETTINGS_UVSHIFTING; break; diff --git a/utils/mdldec/qc.c b/utils/mdldec/qc.c index 2f46a5ae..281fbcf8 100644 --- a/utils/mdldec/qc.c +++ b/utils/mdldec/qc.c @@ -481,7 +481,7 @@ static void WriteSequenceInfo( FILE *fp ) seqdesc = (mstudioseqdesc_t *)( (byte *)model_hdr + model_hdr->seqindex ); - seq_path = ( globalsettings & SETTINGS_SEPARATERESOURCES ) ? DEFAULT_SEQUENCEPATH : ""; + seq_path = ( globalsettings & SETTINGS_SEPARATEANIMSFOLDER ) ? SEQUENCEPATH : ""; for( i = 0; i < model_hdr->numseq; ++i, ++seqdesc ) { @@ -607,8 +607,8 @@ void WriteQCScript( void ) fprintf( fp, "$modelname \"%s.mdl\"\n", modelfile ); fputs( "$cd \".\"\n", fp ); - if( globalsettings & SETTINGS_SEPARATERESOURCES ) - fputs( "$cdtexture \"./" DEFAULT_TEXTUREPATH "\"\n", fp ); + if( globalsettings & SETTINGS_SEPARATETEXTURESFOLDER ) + fputs( "$cdtexture \"./" TEXTUREPATH "\"\n", fp ); else fputs( "$cdtexture \"./\"\n", fp ); fputs( "$cliptotextures\n", fp ); fputs( "$scale 1.0\n", fp ); diff --git a/utils/mdldec/settings.h b/utils/mdldec/settings.h index 3923dd0c..437dc2a2 100644 --- a/utils/mdldec/settings.h +++ b/utils/mdldec/settings.h @@ -10,7 +10,8 @@ enum SETTINGS_UVSHIFTING = BIT(1), SETTINGS_NOLOGS = BIT(2), SETTINGS_NOVALIDATION = BIT(3), - SETTINGS_SEPARATERESOURCES = BIT(4), + SETTINGS_SEPARATEANIMSFOLDER = BIT(4), + SETTINGS_SEPARATETEXTURESFOLDER = BIT(5), }; #endif // SETTINGS_H diff --git a/utils/mdldec/smd.c b/utils/mdldec/smd.c index f0534cbf..beb2038f 100644 --- a/utils/mdldec/smd.c +++ b/utils/mdldec/smd.c @@ -591,7 +591,7 @@ static void WriteSequences( void ) char path[MAX_SYSPATH]; mstudioseqdesc_t *seqdesc = (mstudioseqdesc_t *)( (byte *)model_hdr + model_hdr->seqindex ); - len = Q_snprintf( path, MAX_SYSPATH, ( globalsettings & SETTINGS_SEPARATERESOURCES ) ? "%s" DEFAULT_SEQUENCEPATH : "%s", destdir ); + len = Q_snprintf( path, MAX_SYSPATH, ( globalsettings & SETTINGS_SEPARATEANIMSFOLDER ) ? "%s" SEQUENCEPATH : "%s", destdir ); if( len == -1 || !MakeDirectory( path )) { diff --git a/utils/mdldec/smd.h b/utils/mdldec/smd.h index 295e3cc4..cee7f092 100644 --- a/utils/mdldec/smd.h +++ b/utils/mdldec/smd.h @@ -16,7 +16,7 @@ GNU General Public License for more details. #ifndef SMD_H #define SMD_H -#define DEFAULT_SEQUENCEPATH "anims/" +#define SEQUENCEPATH "anims/" void WriteSMD( void ); diff --git a/utils/mdldec/texture.c b/utils/mdldec/texture.c index 98a6c997..1ff34095 100644 --- a/utils/mdldec/texture.c +++ b/utils/mdldec/texture.c @@ -137,7 +137,7 @@ void WriteTextures( void ) mstudiotexture_t *texture = (mstudiotexture_t *)( (byte *)texture_hdr + texture_hdr->textureindex ); char path[MAX_SYSPATH]; - len = Q_snprintf( path, MAX_SYSPATH, ( globalsettings & SETTINGS_SEPARATERESOURCES ) ? "%s" DEFAULT_TEXTUREPATH : "%s", destdir ); + len = Q_snprintf( path, MAX_SYSPATH, ( globalsettings & SETTINGS_SEPARATETEXTURESFOLDER ) ? "%s" TEXTUREPATH : "%s", destdir ); if( len == -1 || !MakeDirectory( path )) { diff --git a/utils/mdldec/texture.h b/utils/mdldec/texture.h index da067e34..90f338b5 100644 --- a/utils/mdldec/texture.h +++ b/utils/mdldec/texture.h @@ -16,7 +16,7 @@ GNU General Public License for more details. #ifndef TEXTURE_H #define TEXTURE_H -#define DEFAULT_TEXTUREPATH "textures/" +#define TEXTUREPATH "textures/" void WriteTextures( void );