/*---------------------------------------------------------------------* Project: TexConv File: main.c Copyright 1998-2001 Nintendo. All rights reserved. These coded instructions, statements and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. Change History: $Log: main.cpp,v $ Revision 1.2 2008/05/23 04:16:03 iwai_yuma Improved for handling of VC2005. Revision 1.1 2006/02/17 09:03:29 mitu 1st version 3 4/11/01 3:19p John Updated header copyrights and pathname. 2 12/06/99 2:03p Ryan changed usage guide message 1 12/03/99 3:48p Ryan 4 10/28/99 10:01p Yasu Change main() to return by int 3 10/12/99 10:19p Howardc 2 10/12/99 7:54p Mikepc changed include io.h to input.h. removed (static) batchConvert function. It now resides in a separate application. 1 10/08/99 3:06p Mikepc changed old .c to .cpp extension. Required for use of tplConv.h prototypes. 1 10/08/99 3:01p Mikepc changed old .c extension to .cpp to make this a cpp project. This was required for inclusion of tplConv.h prototypes 9 9/28/99 3:27p Mikepc removed final 'wait until enter key pressed' command in main to assist MaxConv's batch processing. 8 9/16/99 8:46p Mikepc removed quick convert command line option 7 8/26/99 4:55p Mikepc -changed #include from tplCon.h to tplConv.h - this includes only the top level CreateTplFile and QuickConvert functions 6 8/26/99 11:36a Mikepc 5 8/26/99 11:06a Mikepc added batch file processing option to main $NoKeywords: $ -----------------------------------------------------------------------*/ #include #include #include #include #include #include "input.h" #include "tga.h" //--------------------------------------------------------------------- int main(int argc, char** argv) { char srcTxtFile[ SRC_TXT_FILE_SIZE ]; char dstTplFile[ DST_TPL_FILE_SIZE ]; unsigned int done = IO_NOT_DONE; // install user-defined function to read tga files TCSetFileCacheSize( 1 ); TCInstallFileReadFn( "TGA", ReadTgaFile ); if(argc == 1) { // get source, dest file names from user input, check for a 'quick script' if( (done = GetFileNames( srcTxtFile, dstTplFile )) == IO_QUIT ) { printf("program terminated at user's request.\n"); return 1; } TCCreateTplFile( srcTxtFile, dstTplFile); printf("created tpl %s\n\n", dstTplFile ); } else if(argc == 3) { // get source, dest file names from argv strncpy_s( srcTxtFile, 255, argv[1], strlen( argv[1] ) ); strncpy_s( dstTplFile, 255, argv[2], strlen( argv[2] ) ); // strcpy(srcTxtFile, argv[1] ); // strcpy(dstTplFile, argv[2] ); TCCreateTplFile( srcTxtFile, dstTplFile); printf("created tpl %s\n\n", dstTplFile ); } else { //printf( "error: tc requires 1 or 3 command line args to run.\n" ); printf( "\nTexConv [ScriptFile] [OutputFile]\n" ); printf( " ScriptFile\tfull path to conversion script file\n" ); printf( " OutputFile\tfull path to destination TPL file\n" ); return 2; } return 0; } //--------------------------------------------------------------------