Subversion Repositories spk

Rev

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

Rev 218 Rev 226
Line 55... Line 55...
55
			}
55
			}
56
			else if ( checkFlags.Compare("--verbose") )
56
			else if ( checkFlags.Compare("--verbose") )
57
				verbose = true;
57
				verbose = true;
58
		}
58
		}
59
 
59
 
60
		Utils::String modfile(argv[startPos]);
60
		Utils::WString modfile = Utils::WString::FromString(argv[startPos]);
61
		Utils::String difffile(argv[startPos + 1]);
61
		Utils::WString difffile = Utils::WString::FromString(argv[startPos + 1]);
62
		Utils::WString gamedir;
62
		Utils::WString gamedir;
63
		if ( argc > (startPos + 2) ) gamedir = argv[startPos + 2];
63
		if ( argc > (startPos + 2) ) gamedir = Utils::WString::FromString(argv[startPos + 2]);
64
		if ( gamedir.empty() ) gamedir = ".";
64
		if ( gamedir.empty() ) gamedir = L".";
65
		gamedir = CFileIO(gamedir).fullFilename();
65
		gamedir = CFileIO(gamedir).fullFilename();
66
 
66
 
67
		CModDiff Diff(gamedir.toString(), "addon");
67
		CModDiff Diff(gamedir, L"addon");
68
		if ( !Diff.IsLoaded() ) 
68
		if ( !Diff.IsLoaded() ) 
69
		{
69
		{
70
			wprintf  (L"Error: Unable to load game directory, %s\n", gamedir.c_str());
70
			wprintf  (L"Error: Unable to load game directory, %s\n", gamedir.c_str());
71
			Error();
71
			Error();
72
		}
72
		}
Line 76... Line 76...
76
		else
76
		else
77
			wprintf ( L"Game Directory: '%s' loaded\n", gamedir.c_str());
77
			wprintf ( L"Game Directory: '%s' loaded\n", gamedir.c_str());
78
 
78
 
79
		if ( !Diff.CreateDiff(modfile) )
79
		if ( !Diff.CreateDiff(modfile) )
80
		{
80
		{
81
			printf("Error: Unable to create diff for mod file, %s (%d)\n", modfile.c_str(), Diff.Error());
81
			wprintf(L"Error: Unable to create diff for mod file, %s (%d)\n", modfile.c_str(), Diff.Error());
82
			Error();
82
			Error();
83
		}
83
		}
84
 
84
 
85
		if ( Diff.GetDiffFiles().empty() )
85
		if ( Diff.GetDiffFiles().empty() )
86
		{
86
		{
Line 108... Line 108...
108
				}
108
				}
109
			}
109
			}
110
		}
110
		}
111
 
111
 
112
		if ( Diff.WriteDiff(difffile) )
112
		if ( Diff.WriteDiff(difffile) )
113
			printf("Diff file: %s, written\n", difffile.c_str());
113
			wprintf(L"Diff file: %s, written\n", difffile.c_str());
114
		else
114
		else
115
			printf("Error: Unable to write diff file: %s\n", difffile.c_str());
115
			wprintf(L"Error: Unable to write diff file: %s\n", difffile.c_str());
116
	}
116
	}
117
 
117
 
118
#ifdef _DEBUG
118
#ifdef _DEBUG
119
	char pause;
119
	char pause;
120
	scanf ( "%s", &pause );
120
	scanf ( "%s", &pause );