Compare commits
	
		
			No commits in common. "8191d30b20c5f09d46913d640cc820b2848c94db" and "a6e4e8547080fc2a654cf9eae2cb21a646b68723" have entirely different histories.
		
	
	
		
			8191d30b20
			...
			a6e4e85470
		
	
		|  | @ -147,40 +147,38 @@ public class ResourcePathManager | |||
|             throw new InvalidOperationException("Failed to find all installation config paths."); | ||||
|         } | ||||
| 
 | ||||
|         // We need to know where all the texture and object resources are | ||||
|         // Get the paths of the base Fam and Obj resources so we can extract them. | ||||
|         var installCfgLines = File.ReadAllLines(configPaths[(int)ConfigFile.Install]); | ||||
|         if (!FindConfigVar(installCfgLines, "resname_base", out var resPaths)) | ||||
|         { | ||||
|             throw new InvalidOperationException("Failed to find resnames in install config"); | ||||
|         } | ||||
|          | ||||
|         var zipPaths = new List<string>(); | ||||
|         FindConfigVar(installCfgLines, "resname_base", out var resPaths); | ||||
|         var baseFamPath = ""; | ||||
|         var baseObjPath = ""; | ||||
|         foreach (var resPath in resPaths.Split('+')) | ||||
|         { | ||||
|             var dir = Path.Join(installPath, ConvertSeparator(resPath)); | ||||
|             if (!Directory.Exists(dir)) | ||||
|             { | ||||
|                 continue; | ||||
|             } | ||||
|              | ||||
|             foreach (var path in Directory.GetFiles(dir)) | ||||
|             { | ||||
|                 var name = Path.GetFileName(path).ToLower(); | ||||
|                 if (name is "fam.crf" or "obj.crf") | ||||
|                 if (name == "fam.crf" && baseFamPath == "") | ||||
|                 { | ||||
|                     zipPaths.Add(path); | ||||
|                     baseFamPath = path; | ||||
|                 } | ||||
|                 else if (name == "obj.crf" && baseObjPath == "") | ||||
|                 { | ||||
|                     baseObjPath = path; | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         // Do the extraction bro | ||||
|         // The path order is a priority order, so we don't want to overwrite any files when extracting | ||||
|         // TODO: Check if there's any problems caused by case sensitivity | ||||
|         foreach (var zipPath in zipPaths) | ||||
|         (string, string)[] resources = [("fam", baseFamPath), ("obj", baseObjPath)]; | ||||
|         foreach (var (extractName, zipPath) in resources) | ||||
|         { | ||||
|             var resType = Path.GetFileNameWithoutExtension(zipPath); | ||||
|             var extractPath = Path.Join(_extractionPath, resType); | ||||
|             ZipFile.OpenRead(zipPath).ExtractToDirectory(extractPath, false); | ||||
|             var extractPath = Path.Join(_extractionPath, extractName); | ||||
|             if (Directory.Exists(extractPath)) | ||||
|             { | ||||
|                 Directory.Delete(extractPath, true); | ||||
|             } | ||||
|             ZipFile.OpenRead(zipPath).ExtractToDirectory(extractPath); | ||||
|         } | ||||
| 
 | ||||
|         FindConfigVar(installCfgLines, "load_path", out var omsPath); | ||||
|  |  | |||
|  | @ -92,15 +92,7 @@ public class LightMapper | |||
|         Timing.TimeStage("Trace Scene", () => TraceScene(settings)); | ||||
|         Timing.TimeStage("Update AnimLight Cell Mapping", SetAnimLightCellMaps); | ||||
| 
 | ||||
|         // We always do object casting, so it's nice to let dromed know that :) | ||||
|         lmParams.ShadowType = LmParams.LightingMode.Objcast; | ||||
|         if (rendParams is { useSunlight: true, sunlightMode: RendParams.SunlightMode.SingleUnshadowed }) | ||||
|         { | ||||
|             rendParams.sunlightMode = RendParams.SunlightMode.SingleObjcastShadows; | ||||
|         } else if (rendParams is { useSunlight: true, sunlightMode: RendParams.SunlightMode.QuadUnshadowed }) | ||||
|         { | ||||
|             rendParams.sunlightMode = RendParams.SunlightMode.QuadObjcastShadows; | ||||
|         } | ||||
|         // lmParams.ShadowType = LmParams.LightingMode.Raycast; | ||||
|     } | ||||
| 
 | ||||
|     public void Save(string missionName) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue