Skip to content

Play your own Switch games on iPhone/iPad — one-click macOS app, no terminal. | 把 Switch 游戏装进 iPhone:图形界面一键构建,不用命令行。Bring your own game.

Launchers: read the shader chain version from the chosen engine folder

v0lumehif83e51e60ead
diff --git a/frontend/Sources/NSPortBuilder/FreeSpace.swift b/frontend/Sources/NSPortBuilder/FreeSpace.swift
index 41bb6dcd..4c69ab7e 100644
--- a/frontend/Sources/NSPortBuilder/FreeSpace.swift
+++ b/frontend/Sources/NSPortBuilder/FreeSpace.swift
@@ -95,7 +95,7 @@ enum BuildFolder {
/// the NSP script's chain_of() does (`#define DMSH_CHAIN "(.*)"`). nil when the header is missing or has none, and then no
/// shader version counts as old.
nonisolated static func currentChain(repo: String) -> String? {
- guard !repo.isEmpty, let text = try? String(contentsOfFile: repo + "/dm/gfx/nvn/dmsh_chain.h", encoding: .utf8),
+ guard !repo.isEmpty, let text = try? String(contentsOfFile: EngineLayout.root(repo) + "/dm/gfx/nvn/dmsh_chain.h", encoding: .utf8),
let range = text.range(of: #"#define DMSH_CHAIN "(.*)""#, options: .regularExpression) else { return nil }
let line = text[range]
guard let open = line.firstIndex(of: "\""), let close = line.lastIndex(of: "\""), open < close else { return nil }