Beispiel #1
0
 /// <summary>
 /// Load a CR2W file as a CResource
 /// </summary>
 /// <param name="resource">Path of the resource file</param>
 /// <param name="isDepotPath">Use the absolute depot path of the file</param>
 /// <returns>CResource instance from the file</returns>
 public static CResource LoadResource(string resource, bool isDepotPath = false)
 {
     if (!File.Exists(resource))
     {
         throw new FileNotFoundException($"The file '{resource}' could not be found.");
     }
     using (var br = new CR2WBinaryReader(resource, false))
     {
         return(br.CreateResource());
     }
 }