Subversion Repositories spk

Rev

Rev 165 | Rev 172 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 165 Rev 170
Line 204... Line 204...
204
		{
204
		{
205
			printf ( "Failed to open the spk files, %s\n", filename.c_str() );
205
			printf ( "Failed to open the spk files, %s\n", filename.c_str() );
206
			return;
206
			return;
207
		}
207
		}
208
 
208
 
209
		printf ( ";File Format Version: %.2f\n", spkfile.GetFileVersion() );
209
		printf(";File Format Version: %.2f\n", spkfile.fileVersion());
210
 
210
 
211
		printf ( "Assigning Ease Of Use:\t\t%d\nAssigning Game Changing:\t%d\nAssigning Recommended:\t\t%d\n", ease, changing, rec);
211
		printf ( "Assigning Ease Of Use:\t\t%d\nAssigning Game Changing:\t%d\nAssigning Recommended:\t\t%d\n", ease, changing, rec);
212
		spkfile.setEaseOfUse(ease);
212
		spkfile.setEaseOfUse(ease);
213
		spkfile.setGameChanging(changing);
213
		spkfile.setGameChanging(changing);
214
		spkfile.setRecommended(rec);
214
		spkfile.setRecommended(rec);
Line 354... Line 354...
354
	CXspFile ship;
354
	CXspFile ship;
355
	if ( ship.extractShip(pVfs, tShipsLine.token(";", -2), 0) )
355
	if ( ship.extractShip(pVfs, tShipsLine.token(";", -2), 0) )
356
	{
356
	{
357
		printf ( "Ship has been successfully extracted\n" );
357
		printf ( "Ship has been successfully extracted\n" );
358
 
358
 
359
		printf("\t- Models:\t %d\n", ship.CountFiles(FILETYPE_SHIPMODEL));
359
		printf("\t- Models:\t %d\n", ship.countFiles(FILETYPE_SHIPMODEL));
360
		printf("\t- Textures:\t %d\n", ship.CountFiles(FILETYPE_SHIPOTHER));
360
		printf("\t- Textures:\t %d\n", ship.countFiles(FILETYPE_SHIPOTHER));
361
		printf("\t- Dummies:\t %d\n", ship.GetDummies()->size());
361
		printf("\t- Dummies:\t %d\n", ship.GetDummies()->size());
362
		printf("\t- Components:\t %d\n", ship.GetComponents()->size());
362
		printf("\t- Components:\t %d\n", ship.GetComponents()->size());
363
		printf("\t- Bodies:\t %d\n", ship.GetBodies()->Count());
363
		printf("\t- Bodies:\t %d\n", ship.getBodies().size());
364
		printf("\t- Cockpits:\t %d\n", ship.GetCockpits()->size());
364
		printf("\t- Cockpits:\t %d\n", ship.GetCockpits()->size());
365
		printf("\t- Text Entries:\t %d\n", ship.GetTexts()->size());
365
		printf("\t- Text Entries:\t %d\n", ship.GetTexts()->size());
366
 
366
 
367
		printf("\nEnter the name for the ship: ");
367
		printf("\nEnter the name for the ship: ");
368
		ship.setName(GetInput());
368
		ship.setName(GetInput());
Line 483... Line 483...
483
		if ( check == SPKFILE_SINGLE )
483
		if ( check == SPKFILE_SINGLE )
484
			pSpkFile = (CSpkFile *)pBaseFile;
484
			pSpkFile = (CSpkFile *)pBaseFile;
485
		else
485
		else
486
			pXspFile = (CXspFile *)pBaseFile;
486
			pXspFile = (CXspFile *)pBaseFile;
487
 
487
 
488
		printf ( "File Format Version: %.2f\n";, pBaseFile->GetFileVersion() );
488
		printf("File Format Version: %.2f\n";, pBaseFile->fileVersion());
489
 
489
 
490
		CyString sType;
490
		CyString sType;
491
		if ( check == SPKFILE_SINGLESHIP )
491
		if ( check == SPKFILE_SINGLESHIP )
492
			sType = "Ship";
492
			sType = "Ship";
493
		else
493
		else
Line 622... Line 622...
622
				printf ( "\t%s by %s (Minimum Version=%s)\n", needed->sName.c_str(), needed->sAuthor.c_str(), needed->sMinVersion.c_str() );
622
				printf ( "\t%s by %s (Minimum Version=%s)\n", needed->sName.c_str(), needed->sAuthor.c_str(), needed->sMinVersion.c_str() );
623
		}
623
		}
624
		if ( pBaseFile->easeOfUse() != -1 ) printf ( "Ease Of Use Rating: %d\n", pBaseFile->easeOfUse() );
624
		if ( pBaseFile->easeOfUse() != -1 ) printf ( "Ease Of Use Rating: %d\n", pBaseFile->easeOfUse() );
625
		if ( pBaseFile->gameChanging() != -1 ) printf ( "Game Changing Rating: %d\n", pBaseFile->gameChanging() );
625
		if ( pBaseFile->gameChanging() != -1 ) printf ( "Game Changing Rating: %d\n", pBaseFile->gameChanging() );
626
		if ( pBaseFile->recommended() != -1 ) printf ( "Recommendation Rating: %d\n", pBaseFile->recommended() );
626
		if ( pBaseFile->recommended() != -1 ) printf ( "Recommendation Rating: %d\n", pBaseFile->recommended() );
627
		if ( pBaseFile->GetIcon() )
627
		if (pBaseFile->icon())
628
		{
-
 
629
			C_File *icon = pBaseFile->GetIcon();
-
 
630
			printf ( "Icon File Found, Type: %s, Size: %s\n", pBaseFile->iconExt().c_str(), icon->dataSizeString().c_str() );
628
			printf ( "Icon File Found, Type: %s, Size: %s\n", pBaseFile->iconExt().c_str(), pBaseFile->icon()->dataSizeString().c_str() );
631
		}
-
 
632
 
629
 
633
		if ( pBaseFile->GetFileList()->size() )
630
		if ( pBaseFile->GetFileList()->size() )
634
		{
631
		{
635
			printf("\nListing files in package:\n");
632
			printf("\nListing files in package:\n");
636
			CLinkList<C_File> *list = pBaseFile->GetFileList();
633
			CLinkList<C_File> *list = pBaseFile->GetFileList();
Line 1096... Line 1093...
1096
	// extracts a file from single packages file
1093
	// extracts a file from single packages file
1097
	if ( check == SPKFILE_SINGLE || check == SPKFILE_BASE || check == SPKFILE_SINGLESHIP )
1094
	if ( check == SPKFILE_SINGLE || check == SPKFILE_BASE || check == SPKFILE_SINGLESHIP )
1098
	{
1095
	{
1099
		// first get the file type is valid
1096
		// first get the file type is valid
1100
		// converts the string type into its filetype flag
1097
		// converts the string type into its filetype flag
1101
		int t = GetFileTypeFromString(type);
1098
		FileType t = GetFileTypeFromString(type);
1102
		// incorrect text type, display the error
1099
		// incorrect text type, display the error
1103
		if ( t == -1 )
1100
		if (t == FileType::FILETYPE_UNKNOWN)
1104
		{
1101
		{
1105
			printf ( "The file type \"%s\" is invalid\n", type.c_str() );
1102
			printf ( "The file type \"%s\" is invalid\n", type.c_str() );
1106
			return;
1103
			return;
1107
		}
1104
		}
1108
 
1105
 
Line 1131... Line 1128...
1131
 
1128
 
1132
		printf ( "(Done)\n" );
1129
		printf ( "(Done)\n" );
1133
 
1130
 
1134
		// uses the FindFile function to find the selected file in the archive
1131
		// uses the FindFile function to find the selected file in the archive
1135
		// requires the filename, type and custom directory (only for Extra File Type)
1132
		// requires the filename, type and custom directory (only for Extra File Type)
1136
		C_File *f = pBaseFile->FindFile ( addfile, t );
1133
		C_File *f = pBaseFile->findFile(addfile, t);
1137
		if ( !f )
1134
		if ( !f )
1138
		{
1135
		{
1139
			printf ( "Unable to find the file \"%s\" in the package\n", addfile.c_str() );
1136
			printf ( "Unable to find the file \"%s\" in the package\n", addfile.c_str() );
1140
			return;
1137
			return;
1141
		}
1138
		}