This commit is contained in:
Jan Racek
2026-03-27 21:29:24 +01:00
parent 45a552be5a
commit 13ed569eaf
85 changed files with 1953 additions and 2470 deletions

View File

@@ -126,7 +126,7 @@ namespace SplashEdit.EditorCode
}
// Fix nested directory (sometimes archives have one extra level)
FixNestedDirectory(installDir);
SplashEdit.RuntimeCode.Utils.FixNestedDirectory(installDir);
try { File.Delete(tempFile); } catch { }
@@ -155,27 +155,6 @@ namespace SplashEdit.EditorCode
}
}
private static void FixNestedDirectory(string dir)
{
// If extraction created exactly one subdirectory, flatten it
var subdirs = Directory.GetDirectories(dir);
if (subdirs.Length == 1)
{
string nested = subdirs[0];
foreach (string file in Directory.GetFiles(nested))
{
string dest = Path.Combine(dir, Path.GetFileName(file));
if (!File.Exists(dest)) File.Move(file, dest);
}
foreach (string sub in Directory.GetDirectories(nested))
{
string dest = Path.Combine(dir, Path.GetFileName(sub));
if (!Directory.Exists(dest)) Directory.Move(sub, dest);
}
try { Directory.Delete(nested, true); } catch { }
}
}
/// <summary>
/// Converts a Unity AudioClip to PS1 SPU ADPCM format using psxavenc.
/// Returns the ADPCM byte array, or null on failure.