Subversion Repositories spk

Rev

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

Rev 1 Rev 60
Line 61... Line 61...
61
		CyString gamedir;
61
		CyString gamedir;
62
		if ( argc > (startPos + 2) ) gamedir = argv[startPos + 2];
62
		if ( argc > (startPos + 2) ) gamedir = argv[startPos + 2];
63
		if ( gamedir.Empty() ) gamedir = ".";
63
		if ( gamedir.Empty() ) gamedir = ".";
64
		gamedir = CFileIO(gamedir).GetFullFilename();
64
		gamedir = CFileIO(gamedir).GetFullFilename();
65
 
65
 
66
		CModDiff Diff(gamedir);
66
		CModDiff Diff(gamedir.ToString(), "addon");
67
		if ( !Diff.IsLoaded() ) 
67
		if ( !Diff.IsLoaded() ) 
68
		{
68
		{
69
			printf  ("Error: Unable to load game directory, %s\n", gamedir.c_str());
69
			printf  ("Error: Unable to load game directory, %s\n", gamedir.c_str());
70
			Error();
70
			Error();
71
		}
71
		}
Line 73... Line 73...
73
		if ( gamedir.Compare(".") )
73
		if ( gamedir.Compare(".") )
74
			printf ( "Game Directory: 'CURRENT' loaded\n");
74
			printf ( "Game Directory: 'CURRENT' loaded\n");
75
		else
75
		else
76
			printf ( "Game Directory: '%s' loaded\n", gamedir.c_str());
76
			printf ( "Game Directory: '%s' loaded\n", gamedir.c_str());
77
 
77
 
78
		if ( !Diff.CreateDiff(modfile) )
78
		if ( !Diff.CreateDiff(modfile.ToString()) )
79
		{
79
		{
80
			printf("Error: Unable to create diff for mod file, %s (%d)\n", modfile.c_str(), Diff.Error());
80
			printf("Error: Unable to create diff for mod file, %s (%d)\n", modfile.c_str(), Diff.Error());
81
			Error();
81
			Error();
82
		}
82
		}
83
 
83
 
Line 99... Line 99...
99
					{
99
					{
100
						case DIFFTYPE_CHANGE:
100
						case DIFFTYPE_CHANGE:
101
							printf( "\tPosition(%d) Entry(%d) %s => %s\n", e->iID, ((SDiffEntryChange *)e)->iPos, ((SDiffEntryChange *)e)->sFrom.c_str(), ((SDiffEntryChange *)e)->sEntry.c_str());
101
							printf( "\tPosition(%d) Entry(%d) %s => %s\n", e->iID, ((SDiffEntryChange *)e)->iPos, ((SDiffEntryChange *)e)->sFrom.c_str(), ((SDiffEntryChange *)e)->sEntry.c_str());
102
							break;
102
							break;
103
						case DIFFTYPE_ADDITION:
103
						case DIFFTYPE_ADDITION:
104
							printf( "\tPosition(%d) Add Entry: ...%s\n", e->iID, ((SDiffEntryAddition *)e)->sEntry.GetToken(";", -2).c_str());
104
							printf( "\tPosition(%d) Add Entry: ...%s\n", e->iID, ((SDiffEntryAddition *)e)->sEntry.token(";", -2).c_str());
105
							break;
105
							break;
106
					}
106
					}
107
				}
107
				}
108
			}
108
			}
109
		}
109
		}
110
 
110
 
111
		if ( Diff.WriteDiff(difffile) )
111
		if ( Diff.WriteDiff(difffile.ToString()) )
112
			printf("Diff file: %s, written\n", difffile.c_str());
112
			printf("Diff file: %s, written\n", difffile.c_str());
113
		else
113
		else
114
			printf("Error: Unable to write diff file: %s\n", difffile.c_str());
114
			printf("Error: Unable to write diff file: %s\n", difffile.c_str());
115
	}
115
	}
116
 
116