This commit is contained in:
Михаил Капелько committed 2026-10-19 18:13:27 +03:00
1 parent 4f40b509f6
commit 5c93de7764
1 file changed
+4 -24
+4 -24
View File
@@ -42,30 +42,10 @@ final class RenderGLView: NSOpenGLView {
}
private func loadModel() {
var paths: [String] = []
if let resources = Bundle.main.resourceURL {
print("ИГР RenderGV.loadM-1 resources: '\(resources.path)'")
paths.append(resources.appendingPathComponent("assets/cube.gltf").path)
}
let cwd = FileManager.default.currentDirectoryPath
paths.append("\(cwd)/assets/cube.gltf")
print("ИГР RenderGV.loadM-2 cwd: '\(cwd)'")
if let exe = Bundle.main.executableURL {
let dir = exe.deletingLastPathComponent()
print("ИГР RenderGV.loadM-2 exedir: '\(dir)'")
paths.append(dir.appendingPathComponent("assets/cube.gltf").path)
}
for path in paths {
print("ИГР RenderGV.loadM-10 path: '\(path)'")
if FileManager.default.fileExists(atPath: path) {
print("ИГР RenderGV.loadM-11 load")
sr_load_model(path)
return
}
guard let resources = Bundle.main.resourceURL else { return }
let path = resources.appendingPathComponent("assets/cube.gltf").path
if FileManager.default.fileExists(atPath: path) {
sr_load_model(path)
}
}