Skip to content

Commit 64a2a01

Browse files
committed
Adjusted the Anti-Aliasing toggle
Would previously decompile everything in cache.arc, which caused the multiplayer renderer to die. Still decompiles all render scripts in scripts.arc just in case, as those don't seem important for this.
1 parent 520f1cc commit 64a2a01

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

Sonic-06-Mod-Manager/src/UnifyPatcher.cs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@ public static void ApplyTweaks(RushInterface rush) {
14241424
if (antiAliasing != 1 || forceMSAA) {
14251425
rush.Status = $"Tweaking Anti-Aliasing...";
14261426
Console.WriteLine($"[{DateTime.Now:hh:mm:ss tt}] [Tweak] <cache.arc> Set Anti-Aliasing to {antiAliasing}...");
1427-
MSAA(Path.Combine(tweak, $"{system}\\scripts\\render\\"), antiAliasing, SearchOption.TopDirectoryOnly);
1427+
MSAA(Path.Combine(tweak, $"{system}\\scripts\\render\\"), antiAliasing, SearchOption.TopDirectoryOnly, 0);
14281428
}
14291429
}
14301430

@@ -1496,7 +1496,7 @@ public static void ApplyTweaks(RushInterface rush) {
14961496
if (antiAliasing != 1 || forceMSAA) {
14971497
rush.Status = $"Tweaking Anti-Aliasing...";
14981498
Console.WriteLine($"[{DateTime.Now:hh:mm:ss tt}] [Tweak] <scripts.arc> Set Anti-Aliasing to {antiAliasing}...");
1499-
MSAA(Path.Combine(tweak, $"{system}\\scripts\\render\\"), antiAliasing, SearchOption.AllDirectories);
1499+
MSAA(Path.Combine(tweak, $"{system}\\scripts\\render\\"), antiAliasing, SearchOption.AllDirectories, 1);
15001500
}
15011501

15021502
// Repack archive as tweak
@@ -1582,23 +1582,32 @@ public static void ApplyTweaks(RushInterface rush) {
15821582
}
15831583
}
15841584

1585-
private static void MSAA(string directoryRoot, int MSAA, SearchOption searchOption) {
1585+
private static void MSAA(string directoryRoot, int MSAA, SearchOption searchOption, int arcSource) {
15861586
#if !DEBUG
15871587
try {
15881588
#endif
15891589
string[] files = Directory.GetFiles(directoryRoot, "*.lub", searchOption);
15901590

15911591
foreach (var lub in files) {
1592-
PatchEngine.DecompileLua(lub);
15931592

15941593
if (Path.GetFileName(lub) == "render_utility.lub") {
1594+
PatchEngine.DecompileLua(lub);
1595+
15951596
List<string> editedLua = File.ReadAllLines(lub).ToList();
15961597

15971598
if (MSAA == 0) editedLua.Add("MSAAType = \"1x\"");
15981599
else if (MSAA == 1) editedLua.Add("MSAAType = \"2x\"");
15991600
else if (MSAA == 2) editedLua.Add("MSAAType = \"4x\"");
16001601
File.WriteAllLines(lub, editedLua);
1601-
} else {
1602+
} else if (arcSource == 0 && Path.GetFileName(lub) != "render_event.lub" && Path.GetFileName(lub) != "render_kdv_c.lub" && Path.GetFileName(lub) != "render_test_lightmap.lub"
1603+
&& Path.GetFileName(lub) != "render_test_wvo.lub")
1604+
{
1605+
continue;
1606+
}
1607+
else
1608+
{
1609+
PatchEngine.DecompileLua(lub);
1610+
16021611
string[] editedLua = File.ReadAllLines(lub);
16031612
int lineNum = 0;
16041613
int modified = 0;

Sonic-06-Mod-Manager/src/UnifyProgram.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace Unify
4040
{
4141
static class Program
4242
{
43-
public static readonly string GlobalVersionNumber = $"Version 3.38";
43+
public static readonly string GlobalVersionNumber = $"Version 3.39";
4444

4545
#if !DEBUG
4646
public static readonly string VersionNumber = GlobalVersionNumber;

0 commit comments

Comments
 (0)