Skip to content

Commit

Permalink
Reverted back to the old MSAA code
Browse files Browse the repository at this point in the history
	modified:   Sonic-06-Mod-Manager/src/UnifyPatcher.cs
  • Loading branch information
HyperPolygon64 committed Feb 2, 2020
1 parent 4f7979e commit 3ed02fb
Showing 1 changed file with 7 additions and 26 deletions.
33 changes: 7 additions & 26 deletions Sonic-06-Mod-Manager/src/UnifyPatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1121,38 +1121,19 @@ public static void ApplyTweaks(RushInterface rush) {
}

private static void MSAA(string directoryRoot, int MSAA, SearchOption searchOption) {
if (File.Exists(directoryRoot)) {
PatchEngine.DecompileLua(directoryRoot);
string[] files = Directory.GetFiles(directoryRoot, "*.lub", searchOption);

if (Path.GetFileName(directoryRoot) == "render_utility.lub") {
List<string> editedLua = File.ReadAllLines(directoryRoot).ToList();
foreach (var lub in files) {
PatchEngine.DecompileLua(lub);

if (Path.GetFileName(lub) == "render_utility.lub") {
List<string> editedLua = File.ReadAllLines(lub).ToList();

if (MSAA == 0) editedLua.Add("MSAAType = \"1x\"");
else if (MSAA == 1) editedLua.Add("MSAAType = \"2x\"");
else if (MSAA == 2) editedLua.Add("MSAAType = \"4x\"");
File.WriteAllLines(directoryRoot, editedLua);
File.WriteAllLines(lub, editedLua);
} else {
string[] editedLua = File.ReadAllLines(directoryRoot);
int lineNum = 0;
int modified = 0;

foreach (string line in editedLua) {
if (line.Contains("MSAAType")) {
string[] tempLine = line.Split(' ');
if (MSAA == 0) tempLine[2] = "\"1x\"";
else if (MSAA == 1) tempLine[2] = "\"2x\"";
else if (MSAA == 2) tempLine[2] = "\"4x\"";
editedLua[lineNum] = string.Join(" ", tempLine);
modified++;
}
lineNum++;
}
if (modified != 0) File.WriteAllLines(directoryRoot, editedLua);
}
} else if (Directory.Exists(directoryRoot)) {
foreach (string lub in Directory.GetFiles(directoryRoot, "*.lub", searchOption)) {
PatchEngine.DecompileLua(lub);

string[] editedLua = File.ReadAllLines(lub);
int lineNum = 0;
int modified = 0;
Expand Down

0 comments on commit 3ed02fb

Please sign in to comment.