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 54... Line 54...
54
			}
54
			}
55
			else if ( checkFlags.Compare("--verbose") )
55
			else if ( checkFlags.Compare("--verbose") )
56
				verbose = true;
56
				verbose = true;
57
		}
57
		}
58
 
58
 
59
		Utils::String modfile(argv[startPos]);
59
		Utils::WString modfile = Utils::WString::FromString(argv[startPos]);
60
		Utils::String difffile(argv[startPos + 1]);
60
		Utils::WString difffile = Utils::WString::FromString(argv[startPos + 1]);
61
		Utils::WString gamedir;
61
		Utils::WString gamedir;
62
		if ( argc > 3 ) gamedir = argv[startPos + 2];
62
		if ( argc > 3 ) gamedir = Utils::WString::FromString(argv[startPos + 2]);
63
		if ( gamedir.empty() ) gamedir = L".";
63
		if ( gamedir.empty() ) gamedir = L".";
64
		gamedir = CFileIO(gamedir).fullFilename();
64
		gamedir = CFileIO(gamedir).fullFilename();
65
 
65
 
66
		CModDiff Diff(gamedir.toString(), L"addon");
66
		CModDiff Diff(gamedir, L"addon");
67
		if ( !Diff.IsLoaded() ) 
67
		if ( !Diff.IsLoaded() ) 
68
		{
68
		{
69
			wprintf  (L"Error: Unable to load game directory, %s\n", gamedir.c_str());
69
			wprintf  (L"Error: Unable to load game directory, %s\n", gamedir.c_str());
70
			Error();
70
			Error();
71
		}
71
		}
Line 73... Line 73...
73
		Diff.ApplyMod(modfile);
73
		Diff.ApplyMod(modfile);
74
 
74
 
75
		wprintf ( L"Game Directory: '%s' loaded\n", gamedir.c_str());
75
		wprintf ( L"Game Directory: '%s' loaded\n", gamedir.c_str());
76
		if ( !Diff.ReadDiff(difffile) )
76
		if ( !Diff.ReadDiff(difffile) )
77
		{
77
		{
78
			printf ("Error: Unable to load diff file, %s\n", difffile.c_str());
78
			wprintf(L"Error: Unable to load diff file, %s\n", difffile.c_str());
79
			Error();
79
			Error();
80
		}
80
		}
81
 
81
 
82
		if ( !Diff.ApplyDiff(modfile) )
82
		if ( !Diff.ApplyDiff(modfile) )
83
		{
83
		{
84
			printf ("Error: Unable to write to mod file, %s\n", modfile.c_str());
84
			wprintf(L"Error: Unable to write to mod file, %s\n", modfile.c_str());
85
			Error();
85
			Error();
86
		}
86
		}
87
 
87
 
88
		printf("Diff has been applied to mod, %s\n", modfile.c_str());
88
		wprintf(L"Diff has been applied to mod, %s\n", modfile.c_str());
89
	}
89
	}
90
 
90
 
91
#ifdef _DEBUG
91
#ifdef _DEBUG
92
	char pause;
92
	char pause;
93
	scanf ( "%s", &pause );
93
	scanf ( "%s", &pause );